mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 10:24:49 +00:00
i2c: rcar_iic: Read ICSR only once
Read ICSR only once to avoid missing interrupts. This happens on R8A7791 Porter during reset, when reading the PMIC register 0x13, which may fail sometimes because of the missed DTE interrupt. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
f08023c07d
commit
eb54682e91
1 changed files with 4 additions and 2 deletions
|
@ -58,12 +58,14 @@ static void sh_irq_dte(struct udevice *dev)
|
|||
static int sh_irq_dte_with_tack(struct udevice *dev)
|
||||
{
|
||||
struct rcar_iic_priv *priv = dev_get_priv(dev);
|
||||
u8 icsr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < IRQ_WAIT; i++) {
|
||||
if (RCAR_IC_DTE & readb(priv->base + RCAR_IIC_ICSR))
|
||||
icsr = readb(priv->base + RCAR_IIC_ICSR);
|
||||
if (RCAR_IC_DTE & icsr)
|
||||
break;
|
||||
if (RCAR_IC_TACK & readb(priv->base + RCAR_IIC_ICSR))
|
||||
if (RCAR_IC_TACK & icsr)
|
||||
return -ETIMEDOUT;
|
||||
udelay(10);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue