Skip to content

Commit 0520628

Browse files
taolanwsakernel
authored andcommitted
i2c: hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver.
For compatibility, some devices need to work with controller between messages using a stop. Signed-off-by: taolan <[email protected]> Acked-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 9d178e0 commit 0520628

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/i2c/busses/i2c-hix5hd2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ static int hix5hd2_i2c_xfer(struct i2c_adapter *adap,
360360
pm_runtime_get_sync(priv->dev);
361361

362362
for (i = 0; i < num; i++, msgs++) {
363-
stop = (i == num - 1);
363+
if ((i == num - 1) || (msgs->flags & I2C_M_STOP))
364+
stop = 1;
365+
else
366+
stop = 0;
367+
364368
ret = hix5hd2_i2c_xfer_msg(priv, msgs, stop);
365369
if (ret < 0)
366370
goto out;

0 commit comments

Comments
 (0)