Commit 2f7d0e82 authored by Benjamin Gaignard's avatar Benjamin Gaignard

drm: sti: clear all mixer control

Make sure that mixer control register is correctly reset
before use it.
Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
parent 76569207
...@@ -38,6 +38,8 @@ static void sti_drm_crtc_prepare(struct drm_crtc *crtc) ...@@ -38,6 +38,8 @@ static void sti_drm_crtc_prepare(struct drm_crtc *crtc)
if (clk_prepare_enable(compo->clk_compo_aux)) if (clk_prepare_enable(compo->clk_compo_aux))
DRM_INFO("Failed to prepare/enable compo_aux clk\n"); DRM_INFO("Failed to prepare/enable compo_aux clk\n");
} }
sti_mixer_clear_all_layers(mixer);
} }
static void sti_drm_crtc_commit(struct drm_crtc *crtc) static void sti_drm_crtc_commit(struct drm_crtc *crtc)
......
...@@ -215,6 +215,15 @@ int sti_mixer_set_layer_status(struct sti_mixer *mixer, ...@@ -215,6 +215,15 @@ int sti_mixer_set_layer_status(struct sti_mixer *mixer,
return 0; return 0;
} }
void sti_mixer_clear_all_layers(struct sti_mixer *mixer)
{
u32 val;
DRM_DEBUG_DRIVER("%s clear all layer\n", sti_mixer_to_str(mixer));
val = sti_mixer_reg_read(mixer, GAM_MIXER_CTL) & 0xFFFF0000;
sti_mixer_reg_write(mixer, GAM_MIXER_CTL, val);
}
void sti_mixer_set_matrix(struct sti_mixer *mixer) void sti_mixer_set_matrix(struct sti_mixer *mixer)
{ {
unsigned int i; unsigned int i;
......
...@@ -39,6 +39,7 @@ struct sti_mixer *sti_mixer_create(struct device *dev, int id, ...@@ -39,6 +39,7 @@ struct sti_mixer *sti_mixer_create(struct device *dev, int id,
int sti_mixer_set_layer_status(struct sti_mixer *mixer, int sti_mixer_set_layer_status(struct sti_mixer *mixer,
struct sti_layer *layer, bool status); struct sti_layer *layer, bool status);
void sti_mixer_clear_all_layers(struct sti_mixer *mixer);
int sti_mixer_set_layer_depth(struct sti_mixer *mixer, struct sti_layer *layer); int sti_mixer_set_layer_depth(struct sti_mixer *mixer, struct sti_layer *layer);
int sti_mixer_active_video_area(struct sti_mixer *mixer, int sti_mixer_active_video_area(struct sti_mixer *mixer,
struct drm_display_mode *mode); struct drm_display_mode *mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment