diff options
| author | Paul Kocialkowski <paul.kocialkowski@bootlin.com> | 2019-01-31 08:25:50 -0500 |
|---|---|---|
| committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-02-01 08:10:51 -0500 |
| commit | b14e945bda8ae227d1bf2b1837c0c4a61721cd1a (patch) | |
| tree | 85adcfffe7431279aa217c24baf4b9da8a2f5115 | |
| parent | 053ff09f1a8f2151339f9fda457c5250929d1c49 (diff) | |
drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init
When initializing clocks, a reference to the TCON channel 0 clock is
obtained. However, the clock is never prepared and enabled later.
Switching from simplefb to DRM actually disables the clock (that was
usually configured by U-Boot) because of that.
On the V3s, this results in a hang when writing to some mixer registers
when switching over to DRM from simplefb.
Fix this by preparing and enabling the clock when initializing other
clocks. Waiting for sun4i_tcon_channel_enable to enable the clock is
apparently too late and results in the same mixer register access hang.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190131132550.26355-1-paul.kocialkowski@bootlin.com
| -rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 0420f5c978b9..cf45d0f940f9 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c | |||
| @@ -761,6 +761,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, | |||
| 761 | return PTR_ERR(tcon->sclk0); | 761 | return PTR_ERR(tcon->sclk0); |
| 762 | } | 762 | } |
| 763 | } | 763 | } |
| 764 | clk_prepare_enable(tcon->sclk0); | ||
| 764 | 765 | ||
| 765 | if (tcon->quirks->has_channel_1) { | 766 | if (tcon->quirks->has_channel_1) { |
| 766 | tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); | 767 | tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); |
| @@ -775,6 +776,7 @@ static int sun4i_tcon_init_clocks(struct device *dev, | |||
| 775 | 776 | ||
| 776 | static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon) | 777 | static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon) |
| 777 | { | 778 | { |
| 779 | clk_disable_unprepare(tcon->sclk0); | ||
| 778 | clk_disable_unprepare(tcon->clk); | 780 | clk_disable_unprepare(tcon->clk); |
| 779 | } | 781 | } |
| 780 | 782 | ||
