mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
i2c: rcar_i2c: Fix sending of slave addresses
Do the reset before clearing the MSR, otherwise it may result in a read or write operation instead if the start condition is repeated. Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
3b59eaef4f
commit
3ad31eb1cc
1 changed files with 3 additions and 1 deletions
|
@ -134,9 +134,11 @@ static int rcar_i2c_set_addr(struct udevice *dev, u8 chip, u8 read)
|
|||
}
|
||||
|
||||
writel((chip << 1) | read, priv->base + RCAR_I2C_ICMAR);
|
||||
writel(0, priv->base + RCAR_I2C_ICMSR);
|
||||
/* Reset */
|
||||
writel(RCAR_I2C_ICMCR_MDBS | RCAR_I2C_ICMCR_MIE | RCAR_I2C_ICMCR_ESG,
|
||||
priv->base + RCAR_I2C_ICMCR);
|
||||
/* Clear Status */
|
||||
writel(0, priv->base + RCAR_I2C_ICMSR);
|
||||
|
||||
ret = wait_for_bit_le32(priv->base + RCAR_I2C_ICMSR, mask,
|
||||
true, 100, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue