From c1b183050a01c89f9a02649c7a7eeb761a58b134 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 5 Jul 2021 10:48:07 +0200 Subject: [PATCH] drm/vc4: hdmi: Move initial register read after pm_runtime_get Commit ecdd08fd9bba ("drm/vc4: hdmi: Make sure the device is powered with CEC") made sure that the device is powered while there is CEC-related accesses but missed one register read in the variable declaration. Move the variable assignment after the pm_runtime_resume_and_get. Fixes: ecdd08fd9bba ("drm/vc4: hdmi: Make sure the device is powered with CEC") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 1197d3b..b26710e 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1780,13 +1780,14 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ const u32 usecs = 1000000 / CEC_CLOCK_FREQ; - u32 val = HDMI_READ(HDMI_CEC_CNTRL_5); + u32 val; int ret; ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); if (ret) return ret; + val = HDMI_READ(HDMI_CEC_CNTRL_5); val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET | VC4_HDMI_CEC_CNT_TO_4700_US_MASK | VC4_HDMI_CEC_CNT_TO_4500_US_MASK); -- 2.7.4