drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 31 Jan 2019 13:25:50 +0000 (14:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:02:36 +0000 (14:02 -0700)
commit7cf4466df6cadc4fe4f884e6ada20dd552acb82c
tree03a0ab09a78a775884a09b2888cec4e31afedcf7
parentae26a7109c150b9214d04bbc45a1867529cbc160
drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init

[ Upstream commit b14e945bda8ae227d1bf2b1837c0c4a61721cd1a ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/sun4i/sun4i_tcon.c