mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-25 05:04:23 +08:00
i2c: rcar_i2c: Fix order of restart and clear status
In case of repeated START condition, the restart has to be kicked before clear status (MSR register). If it is kicked after clear status, R-Car I2C may transfer data (TXD register) or receive data (RXD register) instead of transferring slave address (MAR register). Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
This commit is contained in:
parent
6dd38cc352
commit
cd818a381d
@ -119,10 +119,10 @@ rcar_i2c_raw_read(struct rcar_i2c *dev, u8 chip, uint addr)
|
||||
|
||||
/* set slave address, receive */
|
||||
writel((chip << 1) | 1, &dev->icmar);
|
||||
/* clear status */
|
||||
writel(0, &dev->icmsr);
|
||||
/* start master receive */
|
||||
writel(MCR_MDBS | MCR_MIE | MCR_ESG, &dev->icmcr);
|
||||
/* clear status */
|
||||
writel(0, &dev->icmsr);
|
||||
|
||||
while ((readl(&dev->icmsr) & (MSR_MAT | MSR_MDR))
|
||||
!= (MSR_MAT | MSR_MDR))
|
||||
|
Loading…
Reference in New Issue
Block a user