aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bridge
diff options
context:
space:
mode:
authorAndy Yan <andy.yan@rock-chips.com>2014-12-05 01:31:09 -0500
committerPhilipp Zabel <p.zabel@pengutronix.de>2015-01-07 12:31:58 -0500
commita4d3b8b050d5dbd61f7baeb249e702bc0a75f981 (patch)
treef15d5a7068310cde3ed58a3a1c2e343c80ca144e /drivers/gpu/drm/bridge
parent632d035bace26f57cd22cfc5e2a384989f8a9f50 (diff)
drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done
HDMI_IH_I2CMPHY_STAT0 is a clear on write register, which indicates i2cm operation status(i2c transfer done or error), every hdmi phy register configuration must check this register to make sure the configuration has complete. But the indication bit should be cleared after check, otherwise the corresponding bit will hold on forever, this may give a wrong signal for next check. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/bridge')
-rw-r--r--drivers/gpu/drm/bridge/dw_hdmi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index 8ef21dad3639..d39dccd41e5a 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -666,11 +666,15 @@ static inline void hdmi_phy_test_dout(struct dw_hdmi *hdmi,
666 666
667static bool hdmi_phy_wait_i2c_done(struct dw_hdmi *hdmi, int msec) 667static bool hdmi_phy_wait_i2c_done(struct dw_hdmi *hdmi, int msec)
668{ 668{
669 while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) { 669 u32 val;
670
671 while ((val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
670 if (msec-- == 0) 672 if (msec-- == 0)
671 return false; 673 return false;
672 udelay(1000); 674 udelay(1000);
673 } 675 }
676 hdmi_writeb(hdmi, val, HDMI_IH_I2CMPHY_STAT0);
677
674 return true; 678 return true;
675} 679}
676 680