Skip to content

Commit

Permalink
drm/sun4i: Protect the TCON pixel clocks
Browse files Browse the repository at this point in the history
Both TCON clocks are very sensitive to clock changes, since any change
might lead to improper timings.

Make sure our rate is never changed.

Tested-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/d5224d2e81ecf73dc09f234e580ada52c00eaee3.1519204731.git-series.maxime.ripard@bootlin.com
  • Loading branch information
Maxime Ripard authored and Maxime Ripard committed Feb 26, 2018
1 parent 80b79e3 commit 79d103a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/sun4i/sun4i_tcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static void sun4i_tcon0_mode_set_common(struct sun4i_tcon *tcon,
const struct drm_display_mode *mode)
{
/* Configure the dot clock */
clk_set_rate(tcon->dclk, mode->crtc_clock * 1000);
clk_set_rate_exclusive(tcon->dclk, mode->crtc_clock * 1000);

/* Set the resolution */
regmap_write(tcon->regs, SUN4I_TCON0_BASIC0_REG,
Expand Down Expand Up @@ -421,7 +421,7 @@ static void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon,
WARN_ON(!tcon->quirks->has_channel_1);

/* Configure the dot clock */
clk_set_rate(tcon->sclk1, mode->crtc_clock * 1000);
clk_set_rate_exclusive(tcon->sclk1, mode->crtc_clock * 1000);

/* Adjust clock delay */
clk_delay = sun4i_tcon_get_clk_delay(mode, 1);
Expand Down

0 comments on commit 79d103a

Please sign in to comment.