
Hello Peng,
Am 08.07.2018 um 05:46 schrieb Peng Fan:
From: Ye Li ye.li@nxp.com
In xfer function, both bus_i2c_read and bus_i2c_write will send a STOP command. This causes a problem when reading register data from i2c device.
Generally two operations comprise the register data reading: 1. Write the register address to i2c device. START | chip_addr | W | ACK | register_addr | ACK |
2. Read the Data from i2c device. START | chip_addr | R | ACK | DATA | NACK | STOP
The STOP command should happen at the end of the transfer, otherwise we will always get data from register address 0
Signed-off-by: Ye Li ye.li@nxp.com Acked-by: Peng Fan peng.fan@nxp.com Reviewed-by: Heiko Schocher hs@denx.de
V2: Add review tag
drivers/i2c/imx_lpi2c.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Applied to u-boot-i2c.git master
Thanks!
bye, Heiko