Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/hdmi: add runtime PM calls to DDC transfer function

We must be sure that the HDMI controller is powered on, while performing
the DDC transfer. Add corresponding runtime PM calls to
msm_hdmi_i2c_xfer().

Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/651727/
Link: https://lore.kernel.org/r/20250505-fd-hdmi-hpd-v5-8-48541f76318c@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Dmitry Baryshkov and committed by
Dmitry Baryshkov
531b4e2c 81aa8341

+12 -2
+12 -2
drivers/gpu/drm/msm/hdmi/hdmi_i2c.c
··· 107 107 if (num == 0) 108 108 return num; 109 109 110 + ret = pm_runtime_resume_and_get(&hdmi->pdev->dev); 111 + if (ret) 112 + return ret; 113 + 110 114 init_ddc(hdmi_i2c); 111 115 112 116 ret = ddc_clear_irq(hdmi_i2c); 113 117 if (ret) 114 - return ret; 118 + goto fail; 115 119 116 120 for (i = 0; i < num; i++) { 117 121 struct i2c_msg *p = &msgs[i]; ··· 173 169 hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS), 174 170 hdmi_read(hdmi, REG_HDMI_DDC_HW_STATUS), 175 171 hdmi_read(hdmi, REG_HDMI_DDC_INT_CTRL)); 176 - return ret; 172 + goto fail; 177 173 } 178 174 179 175 ddc_status = hdmi_read(hdmi, REG_HDMI_DDC_SW_STATUS); ··· 206 202 } 207 203 } 208 204 205 + pm_runtime_put(&hdmi->pdev->dev); 206 + 209 207 return i; 208 + 209 + fail: 210 + pm_runtime_put(&hdmi->pdev->dev); 211 + return ret; 210 212 } 211 213 212 214 static u32 msm_hdmi_i2c_func(struct i2c_adapter *adapter)