All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c-hix5hd2:  Add I2C_M_STOP flag support for i2c-hix5hd2 driver.
@ 2022-09-30  1:45 Tao Lan
  2023-06-10 13:54 ` Andi Shyti
  2023-06-14  8:39 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Tao Lan @ 2022-09-30  1:45 UTC (permalink / raw)
  To: linux-i2c, linux-kernel; +Cc: taolan

From: taolan <taolan@huawei.com>

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

Signed-off-by: taolan <taolan@huawei.com>
---
 drivers/i2c/busses/i2c-hix5hd2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c
index 61ae58f57047..e5042e34ecc7 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;
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-hix5hd2:  Add I2C_M_STOP flag support for i2c-hix5hd2 driver.
  2022-09-30  1:45 [PATCH] i2c-hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver Tao Lan
@ 2023-06-10 13:54 ` Andi Shyti
  2023-06-14  8:39 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Shyti @ 2023-06-10 13:54 UTC (permalink / raw)
  To: Tao Lan; +Cc: linux-i2c, linux-kernel

Hi Taolan,

On Fri, Sep 30, 2022 at 01:45:07AM +0000, Tao Lan wrote:
> From: taolan <taolan@huawei.com>
> 
> 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> 

Thanks,
Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-hix5hd2:  Add I2C_M_STOP flag support for i2c-hix5hd2 driver.
  2022-09-30  1:45 [PATCH] i2c-hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver Tao Lan
  2023-06-10 13:54 ` Andi Shyti
@ 2023-06-14  8:39 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-06-14  8:39 UTC (permalink / raw)
  To: Tao Lan; +Cc: linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

On Fri, Sep 30, 2022 at 01:45:07AM +0000, Tao Lan wrote:
> From: taolan <taolan@huawei.com>
> 
> For compatibility, some devices need to work with controller between
> messages using a stop.
> 
> Signed-off-by: taolan <taolan@huawei.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-14  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30  1:45 [PATCH] i2c-hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver Tao Lan
2023-06-10 13:54 ` Andi Shyti
2023-06-14  8:39 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.