Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e6bcf3a authored by Emil Renner Berthing's avatar Emil Renner Berthing Committed by Greg Kroah-Hartman
Browse files

staging: imx-drm: imx-hdmi: clean up hdmi_phy_wait_i2c_done



Simplify hdmi_phy_wait_i2c_done so the call to hdmi_readb is
only done in one place. Also check for timout before waiting
as suggested by Troy Kisky.
This also fixes a checkpatch warning.

Signed-off-by: default avatarEmil Renner Berthing <kernel@esmil.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9e74d292
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -659,13 +659,10 @@ static inline void hdmi_phy_test_dout(struct imx_hdmi *hdmi,

static bool hdmi_phy_wait_i2c_done(struct imx_hdmi *hdmi, int msec)
{
	unsigned char val = 0;
	val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3;
	while (!val) {
		udelay(1000);
	while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
		if (msec-- == 0)
			return false;
		val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3;
		udelay(1000);
	}
	return true;
}