All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 2/2] i2c: mux: pca954x: Use __i2c_transfer because of quirks
@ 2015-06-12 12:41 Alexander Sverdlin
       [not found] ` <557AD35C.2070406-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Sverdlin @ 2015-06-12 12:41 UTC (permalink / raw)
  To: Guenter Roeck, Wolfram Sang, Laurent Pinchart, Jisheng Zhang,
	Uwe Kleine-König, linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Łukasz Gemborowski, Lawnick, Michael (Nokia - DE/Ulm)

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

Signed-off-by: Alexander Sverdlin <alexander.sverdlin-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Tested-by: Łukasz Gemborowski <lukasz.gemborowski-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
---
 drivers/i2c/muxes/i2c-mux-pca9541.c |    4 ++--
 drivers/i2c/muxes/i2c-mux-pca954x.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c
index cb77277..0c8d4d2 100644
--- a/drivers/i2c/muxes/i2c-mux-pca9541.c
+++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
@@ -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)
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index bea0d2d..ea4aa9d 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -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,

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

* Re: [RFC PATCH 2/2] i2c: mux: pca954x: Use __i2c_transfer because of quirks
       [not found] ` <557AD35C.2070406-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
@ 2015-06-12 19:28   ` Laurent Pinchart
  2015-06-15  2:23     ` Jisheng Zhang
  2015-06-17 12:36   ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2015-06-12 19:28 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Guenter Roeck, Wolfram Sang, Jisheng Zhang,
	Uwe Kleine-König, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	Łukasz Gemborowski, Lawnick, Michael (Nokia - DE/Ulm)

Hi Alexander,

Thank you for the patch.

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.
> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
> Tested-by: Łukasz Gemborowski <lukasz.gemborowski-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>

Acked-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>

> ---
>  drivers/i2c/muxes/i2c-mux-pca9541.c |    4 ++--
>  drivers/i2c/muxes/i2c-mux-pca954x.c |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c
> b/drivers/i2c/muxes/i2c-mux-pca9541.c index cb77277..0c8d4d2 100644
> --- a/drivers/i2c/muxes/i2c-mux-pca9541.c
> +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
> @@ -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)
> diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c
> b/drivers/i2c/muxes/i2c-mux-pca954x.c index bea0d2d..ea4aa9d 100644
> --- a/drivers/i2c/muxes/i2c-mux-pca954x.c
> +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
> @@ -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,

-- 
Regards,

Laurent Pinchart

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

* Re: [RFC PATCH 2/2] i2c: mux: pca954x: Use __i2c_transfer because of quirks
  2015-06-12 19:28   ` Laurent Pinchart
@ 2015-06-15  2:23     ` Jisheng Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Jisheng Zhang @ 2015-06-15  2:23 UTC (permalink / raw)
  To: Laurent Pinchart, Alexander Sverdlin, Guenter Roeck,
	Wolfram Sang, Uwe Kleine-König
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Łukasz Gemborowski,
	Lawnick, Michael (Nokia - DE/Ulm)

Dear Alexander,

On Fri, 12 Jun 2015 22:28:50 +0300
Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> wrote:

> Hi Alexander,
> 
> Thank you for the patch.
> 
> 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.
> > 
> > Signed-off-by: Alexander Sverdlin <alexander.sverdlin-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
> > Tested-by: Łukasz Gemborowski <lukasz.gemborowski-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>

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

Acked-by: Jisheng Zhang <jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Tested-by: Jisheng Zhang <jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>

Thanks

> 
> > ---
> >  drivers/i2c/muxes/i2c-mux-pca9541.c |    4 ++--
> >  drivers/i2c/muxes/i2c-mux-pca954x.c |    2 +-
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c
> > b/drivers/i2c/muxes/i2c-mux-pca9541.c index cb77277..0c8d4d2 100644
> > --- a/drivers/i2c/muxes/i2c-mux-pca9541.c
> > +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
> > @@ -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)
> > diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c
> > b/drivers/i2c/muxes/i2c-mux-pca954x.c index bea0d2d..ea4aa9d 100644
> > --- a/drivers/i2c/muxes/i2c-mux-pca954x.c
> > +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
> > @@ -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,
> 

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

* Re: [RFC PATCH 2/2] i2c: mux: pca954x: Use __i2c_transfer because of quirks
       [not found] ` <557AD35C.2070406-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
  2015-06-12 19:28   ` Laurent Pinchart
@ 2015-06-17 12:36   ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-06-17 12:36 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Guenter Roeck, Laurent Pinchart, Jisheng Zhang,
	Uwe Kleine-König, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	Łukasz Gemborowski, Lawnick, Michael (Nokia - DE/Ulm)

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

On Fri, Jun 12, 2015 at 02:41:00PM +0200, 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.
> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
> Tested-by: Łukasz Gemborowski <lukasz.gemborowski-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>

Applied to for-next with stable added, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-06-17 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-12 12:41 [RFC PATCH 2/2] i2c: mux: pca954x: Use __i2c_transfer because of quirks Alexander Sverdlin
     [not found] ` <557AD35C.2070406-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2015-06-12 19:28   ` Laurent Pinchart
2015-06-15  2:23     ` Jisheng Zhang
2015-06-17 12:36   ` 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.