[U-Boot] [PATCH V2 3/4] lpi2c: Fix bus stop problem in xfer
Heiko Schocher
hs at denx.de
Thu Jul 12 14:10:08 UTC 2018
Hello Peng,
Am 08.07.2018 um 05:46 schrieb Peng Fan:
> From: Ye Li <ye.li at 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 at nxp.com>
> Acked-by: Peng Fan <peng.fan at nxp.com>
> Reviewed-by: Heiko Schocher <hs at 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
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de
More information about the U-Boot
mailing list