drm/vc4: hdmi: Move the HSM clock enable to runtime_pm
authorMaxime Ripard <maxime@cerno.tech>
Tue, 25 May 2021 09:10:58 +0000 (11:10 +0200)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Fri, 2 Jul 2021 15:45:04 +0000 (16:45 +0100)
commit7b8a60c1cd5470827c196c201e17b214f52d51ef
tree8693fc1cc2fbed4cbbcff7ba0a525a529739dd80
parenta1c09667ba02061fa3b0ffabddd06789e93b887a
drm/vc4: hdmi: Move the HSM clock enable to runtime_pm

In order to access the HDMI controller, we need to make sure the HSM
clock is enabled. If we were to access it with the clock disabled, the
CPU would completely hang, resulting in an hard crash.

Since we have different code path that would require it, let's move that
clock enable / disable to runtime_pm that will take care of the
reference counting for us.

Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210525091059.234116-3-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_hdmi.c