UPSTREAM: 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.

Change-Id: I5ded4a43ed726b7cffa35d020ef763471bd01b41
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit c9fca5ec8849b8fa16b16cece091645e7d3aa02b)
This commit is contained in:
Vasily Khoruzhick 2019-11-16 11:32:57 -08:00 committed by Joseph Chen
parent 812e98a5b3
commit 133495af9d
1 changed files with 3 additions and 2 deletions

View File

@ -244,7 +244,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;
@ -323,7 +322,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;
@ -351,6 +349,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;
}