[U-Boot] [PATCH] i2c: designware: Allow sending restart conditions

Marek Vasut marex at denx.de
Mon Aug 7 18:45:31 UTC 2017


Allow sending restart conditions upon direction change as this is
required by some chips.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Stefan Roese <sr at denx.de>
Cc: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Heiko Schocher <hs at denx.de>
---
 drivers/i2c/designware_i2c.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c
index d4df35a69a..8cfed2194c 100644
--- a/drivers/i2c/designware_i2c.c
+++ b/drivers/i2c/designware_i2c.c
@@ -374,7 +374,8 @@ static void __dw_i2c_init(struct i2c_regs *i2c_base, int speed, int slaveaddr)
 	/* Disable i2c */
 	dw_i2c_enable(i2c_base, false);
 
-	writel((IC_CON_SD | IC_CON_SPD_FS | IC_CON_MM), &i2c_base->ic_con);
+	writel(IC_CON_SD | IC_CON_RE | IC_CON_SPD_FS | IC_CON_MM,
+	       &i2c_base->ic_con);
 	writel(IC_RX_TL, &i2c_base->ic_rx_tl);
 	writel(IC_TX_TL, &i2c_base->ic_tx_tl);
 	writel(IC_STOP_DET, &i2c_base->ic_intr_mask);
-- 
2.11.0



More information about the U-Boot mailing list