Skip to contentSkip to conversation

i2c-hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver.

PATCH Applied Tao Lan 3 participants 3 messages Sep 30, 2022 – Jun 14, 2023 I2C subsystem host drivers

lore
Share & tools
lore

Tao Lan

author
#0 lore raw

PATCH 1/1 i2c-hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver.

From: taolan <[email protected]>

For compatibility, some devices need to work with controller between messages using a stop.

---
 drivers/i2c/busses/i2c-hix5hd2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-hix5hd2.c +5 -1
index 61ae58f57047..e5042e34ecc7 100644
@@ -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;
Signature · 1 line
2.22.0