Skip to content

Commit b14e945

Browse files
paulkocialkowskimripard
authored andcommitted
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
1 parent 053ff09 commit b14e945

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ static int sun4i_tcon_init_clocks(struct device *dev,
761761
return PTR_ERR(tcon->sclk0);
762762
}
763763
}
764+
clk_prepare_enable(tcon->sclk0);
764765

765766
if (tcon->quirks->has_channel_1) {
766767
tcon->sclk1 = devm_clk_get(dev, "tcon-ch1");
@@ -775,6 +776,7 @@ static int sun4i_tcon_init_clocks(struct device *dev,
775776

776777
static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon)
777778
{
779+
clk_disable_unprepare(tcon->sclk0);
778780
clk_disable_unprepare(tcon->clk);
779781
}
780782

0 commit comments

Comments
 (0)