Skip to contentSkip to conversation

i2c: rcar_iic: Scale delays

PATCH New Marek Vasut 2 participants 4 messages Sep 19, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: rcar_iic: Scale delays

The delays in this driver used to depend on an incorrect timer frequency. This was corrected in 7984ac8d1635, which caused this driver to function incorrectly. Scale the delays accordingly to repair the malfunction.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 drivers/i2c/rcar_iic.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/i2c/rcar_iic.c +5 -5
index e91fc86c1a..86a74430ec 100644
@@ -51,7 +51,7 @@ static void sh_irq_dte(struct udevice *dev)
 	for (i = 0; i < IRQ_WAIT; i++) {
 		if (RCAR_IC_DTE & readb(priv->base + RCAR_IIC_ICSR))
 			break;
-		udelay(10);
+		udelay(3);
 	}
 }
 
@@ -65,7 +65,7 @@ static int sh_irq_dte_with_tack(struct udevice *dev)
 			break;
 		if (RCAR_IC_TACK & readb(priv->base + RCAR_IIC_ICSR))
 			return -ETIMEDOUT;
-		udelay(10);
+		udelay(3);
 	}
 	return 0;
 }
@@ -78,7 +78,7 @@ static void sh_irq_busy(struct udevice *dev)
 	for (i = 0; i < IRQ_WAIT; i++) {
 		if (!(RCAR_IC_BUSY & readb(priv->base + RCAR_IIC_ICSR)))
 			break;
-		udelay(10);
+		udelay(3);
 	}
 }
 
@@ -118,7 +118,7 @@ static int rcar_iic_read_common(struct udevice *dev, struct i2c_msg *msg)
 	if (rcar_iic_set_addr(dev, msg->addr, 1) != 0)
 		goto err;
 
-	udelay(10);
+	udelay(3);
 
 	writeb(RCAR_IIC_ICCR_ICE | RCAR_IIC_ICCR_SCP,
 	       priv->base + RCAR_IIC_ICCR);
@@ -151,7 +151,7 @@ static int rcar_iic_write_common(struct udevice *dev, struct i2c_msg *msg)
 	if (rcar_iic_set_addr(dev, msg->addr, 0) != 0)
 		goto err;
 
-	udelay(10);
+	udelay(3);
 
 	for (i = 0; i < msg->len; i++) {
 		writeb(msg->buf[i], priv->base + RCAR_IIC_ICDR);
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 i2c: rcar_iic: Scale delays

Quoted 6 lines · Marek Vasut

The delays in this driver used to depend on an incorrect timer frequency. This was corrected in 7984ac8d1635, which caused this driver to function incorrectly. Scale the delays accordingly to repair the malfunction.

Cc Nobuhiro Iwamatsu <[email protected]>

This is wrong, ignore.

Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 i2c: rcar_iic: Scale delays

Hello Marek,

Am 19.09.2018 um 16:31 schrieb Marek Vasut:

Quoted 9 lines · Marek Vasut
Quoted 6 lines

The delays in this driver used to depend on an incorrect timer frequency. This was corrected in 7984ac8d1635, which caused this driver to function incorrectly. Scale the delays accordingly to repair the malfunction.

Cc Nobuhiro Iwamatsu <[email protected]>

This is wrong, ignore.

What is wrong ? This patch?

May a define for the delay value is better here ...

Hmm, thinking about it .. is this driver really only working with correct delays ?

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#3 lore raw

PATCH 1/1 i2c: rcar_iic: Scale delays

Quoted 12 lines · Heiko Schocher

Hello Marek,

Am 19.09.2018 um 16:31 schrieb Marek Vasut:

Quoted 9 lines · Marek Vasut
Quoted 7 lines

The delays in this driver used to depend on an incorrect timer frequency.
This was corrected in 7984ac8d1635, which caused this driver to function incorrectly. Scale the delays accordingly to repair the malfunction.

Cc Nobuhiro Iwamatsu <[email protected]>
Quoted 8 lines
Quoted 1 line

This is wrong, ignore.

What is wrong ? This patch?

May a define for the delay value is better here ...

Hmm, thinking about it .. is this driver really only working with correct delays ?

The delays are correct and this driver is correct too, the timer was misconfigured, it's fixed by a different patch.

Signature · 2 lines
Best regards,
Marek Vasut