MLK-20939 imx_virt_i2c: Add a STOP flag for last message
authorYe Li <ye.li@nxp.com>
Mon, 18 Feb 2019 02:26:03 +0000 (18:26 -0800)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 11:28:18 +0000 (04:28 -0700)
commitb165fa3ee0ebabf77d4f68ee61d98a3cc5adbba5
treecf5ad18adafa5926d7efa83899749b7a94e5da00
parentb4dc011d56521de9f0f5fc11fca7062f18ba8459
MLK-20939 imx_virt_i2c: Add a STOP flag for last message

Add a new private flag I2C_M_SRTM_STOP(0x0200) to indicate if STOP
is needed for current message.
When reading/writing registers for slave devices, generally we have two messages,
the first message writes the register address, second message reads/writes the value.
Only the last message needs STOP. But previously M4 sends STOP for each message,
this causes some slave devices treat it as end of transfer. Then, second message won't
have any effect. To solve the problem, we introduce this private STOP flag, so M4 can
STOP according to the flag.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit e8f70409620da897917dfa29dbe65be82c9129fd)
drivers/i2c/imx_virt_i2c.c