summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authortaolan <taolan@huawei.com>2022-09-30 04:45:07 +0300
committerWolfram Sang <wsa@kernel.org>2023-06-14 11:38:30 +0300
commit0520628e5c6bce6b43af8b468ae9396617d5b9a4 (patch)
treeec05a9eb289b3515b2b2ae570cb7728df9e511e0 /drivers/i2c
parent9d178e00583ee803dd48ec60916c64b87f5449e7 (diff)
downloadlinux-0520628e5c6bce6b43af8b468ae9396617d5b9a4.tar.xz
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 <taolan@huawei.com> Acked-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-hix5hd2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c
index 64feaa9dca61..48163759c142 100644
--- a/drivers/i2c/busses/i2c-hix5hd2.c
+++ b/drivers/i2c/busses/i2c-hix5hd2.c
@@ -360,7 +360,11 @@ static int hix5hd2_i2c_xfer(struct i2c_adapter *adap,
pm_runtime_get_sync(priv->dev);
for (i = 0; i < num; i++, msgs++) {
- stop = (i == num - 1);
+ if ((i == num - 1) || (msgs->flags & I2C_M_STOP))
+ stop = 1;
+ else
+ stop = 0;
+
ret = hix5hd2_i2c_xfer_msg(priv, msgs, stop);
if (ret < 0)
goto out;