[PATCH] i2c-gpio: added support for I2C_M_STOP flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Current i2c bit algo implementation doesn't actually support I2C_M_STOP flag despite I2C_FUNC_PROTOCOL_MANGLING functionnality.
---
 drivers/i2c/algos/i2c-algo-bit.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index fad22b0..00446a6 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -557,6 +557,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
 	for (i = 0; i < num; i++) {
 		pmsg = &msgs[i];
 		nak_ok = pmsg->flags & I2C_M_IGNORE_NAK;
+		if (pmsg->flags & I2C_M_STOP) {
+			if (i) {
+				bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
+				i2c_stop(adap);
+			}
+		}
 		if (!(pmsg->flags & I2C_M_NOSTART)) {
 			if (i) {
 				bit_dbg(3, &i2c_adap->dev, "emitting "
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux