[PATCH 39/72] imx-drm: hdmi: optimize i2c write wait

Steve Longerbeam slongerbeam at gmail.com
Fri Oct 31 15:54:22 PDT 2014


A wait of around 50 ~ 100 micro seconds seems to be enough to allow
I2C Master PHY done, so instead of wait 1000 usec at each time
of register check, wait 100 usec is more appropriate.

Signed-off-by: Jiada Wang <jiada_wang at mentor.com>
Signed-off-by: Steve Longerbeam <steve_longerbeam at mentor.com>
---
 drivers/staging/imx-drm/imx-hdmi.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c
index aaec6b2..801a3eb 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -655,12 +655,12 @@ static inline void hdmi_phy_test_dout(struct imx_hdmi *hdmi,
 	hdmi_writeb(hdmi, bit, HDMI_PHY_TST2);
 }
 
-static bool hdmi_phy_wait_i2c_done(struct imx_hdmi *hdmi, int msec)
+static bool hdmi_phy_wait_i2c_done(struct imx_hdmi *hdmi, int husec)
 {
 	while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
-		if (msec-- == 0)
+		if (husec-- == 0)
 			return false;
-		udelay(1000);
+		udelay(100);
 	}
 	return true;
 }
-- 
1.7.9.5



More information about the dri-devel mailing list