Skip to contentSkip to conversation

i2c: mux: pca954x: Use __i2c_transfer because of quirks

RFC PATCH Applied Alexander Sverdlin 4 participants 4 messages Jun 12, 2015 – Jun 17, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 2/2 i2c: mux: pca954x: Use __i2c_transfer because of quirks

pca9541 and pca954x are calling master_xfer() of the parent adapter directly thus bypassing the quirks checks of the adapter. Use __i2c_transfer() instead.

---
 drivers/i2c/muxes/i2c-mux-pca9541.c |    4 ++--
 drivers/i2c/muxes/i2c-mux-pca954x.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/muxes/i2c-mux-pca9541.c +2 -2
index cb77277..0c8d4d2 100644
@@ -104,7 +104,7 @@ static int pca9541_reg_write(struct i2c_client *client, u8 command, u8 val)
 		buf[0] = command;
 		buf[1] = val;
 		msg.buf = buf;
-		ret = adap->algo->master_xfer(adap, &msg, 1);
+		ret = __i2c_transfer(adap, &msg, 1);
 	} else {
 		union i2c_smbus_data data;
 
@@ -144,7 +144,7 @@ static int pca9541_reg_read(struct i2c_client *client, u8 command)
 				.buf = &val
 			}
 		};
-		ret = adap->algo->master_xfer(adap, msg, 2);
+		ret = __i2c_transfer(adap, msg, 2);
 		if (ret == 2)
 			ret = val;
 		else if (ret >= 0)
drivers/i2c/muxes/i2c-mux-pca954x.c +1 -1
index bea0d2d..ea4aa9d 100644
@@ -134,7 +134,7 @@ static int pca954x_reg_write(struct i2c_adapter *adap,
 		msg.len = 1;
 		buf[0] = val;
 		msg.buf = buf;
-		ret = adap->algo->master_xfer(adap, &msg, 1);
+		ret = __i2c_transfer(adap, &msg, 1);
 	} else {
 		union i2c_smbus_data data;
 		ret = adap->algo->smbus_xfer(adap, client->addr,
#2 lore raw
In reply to a message not in the archive

Hi Alexander,

Thank you for the patch.

Quoted 6 lines · On Friday 12 June 2015 14:41:00 Alexander Sverdlin wrote:

pca9541 and pca954x are calling master_xfer() of the parent adapter directly thus bypassing the quirks checks of the adapter. Use __i2c_transfer() instead.

Quoted 40 lines
---
 drivers/i2c/muxes/i2c-mux-pca9541.c |    4 ++--
 drivers/i2c/muxes/i2c-mux-pca954x.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/i2c/muxes/i2c-mux-pca9541.c index cb77277..0c8d4d2 100644

drivers/i2c/muxes/i2c-mux-pca9541.c +1 -1
@@ -104,7 +104,7 @@ static int pca9541_reg_write(struct i2c_client *client,
 u8 command, u8 val) buf[0] = command;
 		buf[1] = val;
 		msg.buf = buf;
-		ret = adap->algo->master_xfer(adap, &msg, 1);
+		ret = __i2c_transfer(adap, &msg, 1);
 	} else {
 		union i2c_smbus_data data;
 
@@ -144,7 +144,7 @@ static int pca9541_reg_read(struct i2c_client *client,

u8 command) .buf = &val

drivers/i2c/muxes/i2c-mux-pca9541.c +1 -1
 			}
 		};
-		ret = adap->algo->master_xfer(adap, msg, 2);
+		ret = __i2c_transfer(adap, msg, 2);
 		if (ret == 2)
 			ret = val;
 		else if (ret >= 0)
(quoted diff) +0 -0

b/drivers/i2c/muxes/i2c-mux-pca954x.c index bea0d2d..ea4aa9d 100644

drivers/i2c/muxes/i2c-mux-pca954x.c +1 -1
@@ -134,7 +134,7 @@ static int pca954x_reg_write(struct i2c_adapter *adap,
 		msg.len = 1;
 		buf[0] = val;
 		msg.buf = buf;
-		ret = adap->algo->master_xfer(adap, &msg, 1);
+		ret = __i2c_transfer(adap, &msg, 1);
 	} else {
 		union i2c_smbus_data data;
 		ret = adap->algo->smbus_xfer(adap, client->addr,
Signature · 3 lines
Regards,

Laurent Pinchart
Acked-by Tested-by
#3 lore raw

Dear Alexander,

Quoted 5 lines · On Fri, 12 Jun 2015 22:28:50 +0300 Laurent Pinchart…

Hi Alexander,

Thank you for the patch.

On Friday 12 June 2015 14:41:00 Alexander Sverdlin wrote:

Quoted 8 lines
Quoted 6 lines

pca9541 and pca954x are calling master_xfer() of the parent adapter directly thus bypassing the quirks checks of the adapter. Use __i2c_transfer() instead.

Just quickly tested the patch, seems fine. So feel free to add my

Thanks

Quoted 42 lines
Quoted 41 lines
---
 drivers/i2c/muxes/i2c-mux-pca9541.c |    4 ++--
 drivers/i2c/muxes/i2c-mux-pca954x.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/i2c/muxes/i2c-mux-pca9541.c index cb77277..0c8d4d2 100644

drivers/i2c/muxes/i2c-mux-pca9541.c +1 -1
@@ -104,7 +104,7 @@ static int pca9541_reg_write(struct i2c_client *client,
 u8 command, u8 val) buf[0] = command;
 		buf[1] = val;
 		msg.buf = buf;
-		ret = adap->algo->master_xfer(adap, &msg, 1);
+		ret = __i2c_transfer(adap, &msg, 1);
 	} else {
 		union i2c_smbus_data data;
 
@@ -144,7 +144,7 @@ static int pca9541_reg_read(struct i2c_client *client,

u8 command) .buf = &val

drivers/i2c/muxes/i2c-mux-pca9541.c +1 -1
 			}
 		};
-		ret = adap->algo->master_xfer(adap, msg, 2);
+		ret = __i2c_transfer(adap, msg, 2);
 		if (ret == 2)
 			ret = val;
 		else if (ret >= 0)
(quoted diff) +0 -0

b/drivers/i2c/muxes/i2c-mux-pca954x.c index bea0d2d..ea4aa9d 100644

drivers/i2c/muxes/i2c-mux-pca954x.c +1 -1
@@ -134,7 +134,7 @@ static int pca954x_reg_write(struct i2c_adapter *adap,
 		msg.len = 1;
 		buf[0] = val;
 		msg.buf = buf;
-		ret = adap->algo->master_xfer(adap, &msg, 1);
+		ret = __i2c_transfer(adap, &msg, 1);
 	} else {
 		union i2c_smbus_data data;
 		ret = adap->algo->smbus_xfer(adap, client->addr,