summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2019-11-16 11:32:57 -0800
committerKever Yang <kever.yang@rock-chips.com>2019-11-23 22:29:49 +0800
commitc9fca5ec8849b8fa16b16cece091645e7d3aa02b (patch)
tree3eb632e02cb8bd651539f774db73a587a9afc625
parent5ef1e02e997ade6e482e589a5c5ed7cf442b173b (diff)
downloadu-boot-c9fca5ec8849b8fa16b16cece091645e7d3aa02b.tar.gz
u-boot-c9fca5ec8849b8fa16b16cece091645e7d3aa02b.tar.xz
u-boot-c9fca5ec8849b8fa16b16cece091645e7d3aa02b.zip
rockchip: i2c: don't sent stop bit after each message
That's not correct and it breaks SMBUS-style reads and and writes for some chips (e.g. SYR82X/SYR83X). Stop bit should be sent only after the last message. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
-rw-r--r--drivers/i2c/rk_i2c.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c
index cdd94bb05a..32b2ee8578 100644
--- a/drivers/i2c/rk_i2c.c
+++ b/drivers/i2c/rk_i2c.c
@@ -253,7 +253,6 @@ static int rk_i2c_read(struct rk_i2c *i2c, uchar chip, uint reg, uint r_len,
}
i2c_exit:
- rk_i2c_send_stop_bit(i2c);
rk_i2c_disable(i2c);
return err;
@@ -332,7 +331,6 @@ static int rk_i2c_write(struct rk_i2c *i2c, uchar chip, uint reg, uint r_len,
}
i2c_exit:
- rk_i2c_send_stop_bit(i2c);
rk_i2c_disable(i2c);
return err;
@@ -360,6 +358,9 @@ static int rockchip_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
}
}
+ rk_i2c_send_stop_bit(i2c);
+ rk_i2c_disable(i2c);
+
return 0;
}