linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: gpio: merge two very similar comments
@ 2019-01-19 11:36 Wolfram Sang
  2019-01-23 10:18 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2019-01-19 11:36 UTC (permalink / raw)
  To: linux-i2c; +Cc: linux-renesas-soc, Haavard Skinnemoen, Wolfram Sang

I think it is clear enough if we have the explanation once and make it
clear it is applicable for both SCL and SDA.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index c008d209f0b8..b9d43bc2853f 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 
 	/*
 	 * First get the GPIO pins; if it fails, we'll defer the probe.
-	 * If the SDA line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
+	 * If the SCL/SDA lines are marked from platform data or device tree
+	 * as "open drain" it means something outside of our control is making
+	 * these lines being handled as open drain, and we should just handle
+	 * them as any other output. Else we enforce open drain as this is
 	 * required for an I2C bus.
 	 */
 	if (pdata->sda_is_open_drain)
@@ -300,13 +300,6 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->sda))
 		return PTR_ERR(priv->sda);
 
-	/*
-	 * If the SCL line is marked from platform data or device tree as
-	 * "open drain" it means something outside of our control is making
-	 * this line being handled as open drain, and we should just handle
-	 * it as any other output. Else we enforce open drain as this is
-	 * required for an I2C bus.
-	 */
 	if (pdata->scl_is_open_drain)
 		gflags = GPIOD_OUT_HIGH;
 	else
-- 
2.11.0


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

* Re: [PATCH] i2c: gpio: merge two very similar comments
  2019-01-19 11:36 [PATCH] i2c: gpio: merge two very similar comments Wolfram Sang
@ 2019-01-23 10:18 ` Simon Horman
  2019-01-23 18:42   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2019-01-23 10:18 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc, Haavard Skinnemoen

On Sat, Jan 19, 2019 at 12:36:42PM +0100, Wolfram Sang wrote:
> I think it is clear enough if we have the explanation once and make it
> clear it is applicable for both SCL and SDA.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> index c008d209f0b8..b9d43bc2853f 100644
> --- a/drivers/i2c/busses/i2c-gpio.c
> +++ b/drivers/i2c/busses/i2c-gpio.c
> @@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
>  
>  	/*
>  	 * First get the GPIO pins; if it fails, we'll defer the probe.
> -	 * If the SDA line is marked from platform data or device tree as
> -	 * "open drain" it means something outside of our control is making
> -	 * this line being handled as open drain, and we should just handle
> -	 * it as any other output. Else we enforce open drain as this is
> +	 * If the SCL/SDA lines are marked from platform data or device tree
> +	 * as "open drain" it means something outside of our control is making
> +	 * these lines being handled as open drain, and we should just handle
> +	 * them as any other output. Else we enforce open drain as this is
>  	 * required for an I2C bus.

<2c>
	If the SCL/SDA lines are marked "open drain" by platform data or
	device tree then this means that something outside of our control is
	marking these lines to be handled as open drain, and we should just
	handle them as we handle any other output. Else we enforce open
	drain as this is required for an I2C bus.
</2c>

>  	 */
>  	if (pdata->sda_is_open_drain)
> @@ -300,13 +300,6 @@ static int i2c_gpio_probe(struct platform_device *pdev)
>  	if (IS_ERR(priv->sda))
>  		return PTR_ERR(priv->sda);
>  
> -	/*
> -	 * If the SCL line is marked from platform data or device tree as
> -	 * "open drain" it means something outside of our control is making
> -	 * this line being handled as open drain, and we should just handle
> -	 * it as any other output. Else we enforce open drain as this is
> -	 * required for an I2C bus.
> -	 */
>  	if (pdata->scl_is_open_drain)
>  		gflags = GPIOD_OUT_HIGH;
>  	else
> -- 
> 2.11.0
> 

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

* Re: [PATCH] i2c: gpio: merge two very similar comments
  2019-01-23 10:18 ` Simon Horman
@ 2019-01-23 18:42   ` Wolfram Sang
  2019-01-24 11:39     ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2019-01-23 18:42 UTC (permalink / raw)
  To: Simon Horman
  Cc: Wolfram Sang, linux-i2c, linux-renesas-soc, Haavard Skinnemoen

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

On Wed, Jan 23, 2019 at 11:18:54AM +0100, Simon Horman wrote:
> On Sat, Jan 19, 2019 at 12:36:42PM +0100, Wolfram Sang wrote:
> > I think it is clear enough if we have the explanation once and make it
> > clear it is applicable for both SCL and SDA.
> > 
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> >  drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
> >  1 file changed, 4 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> > index c008d209f0b8..b9d43bc2853f 100644
> > --- a/drivers/i2c/busses/i2c-gpio.c
> > +++ b/drivers/i2c/busses/i2c-gpio.c
> > @@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
> >  
> >  	/*
> >  	 * First get the GPIO pins; if it fails, we'll defer the probe.
> > -	 * If the SDA line is marked from platform data or device tree as
> > -	 * "open drain" it means something outside of our control is making
> > -	 * this line being handled as open drain, and we should just handle
> > -	 * it as any other output. Else we enforce open drain as this is
> > +	 * If the SCL/SDA lines are marked from platform data or device tree
> > +	 * as "open drain" it means something outside of our control is making
> > +	 * these lines being handled as open drain, and we should just handle
> > +	 * them as any other output. Else we enforce open drain as this is
> >  	 * required for an I2C bus.
> 
> <2c>
> 	If the SCL/SDA lines are marked "open drain" by platform data or
> 	device tree then this means that something outside of our control is
> 	marking these lines to be handled as open drain, and we should just
> 	handle them as we handle any other output. Else we enforce open
> 	drain as this is required for an I2C bus.
> </2c>

Cool, thanks Simon. Should I add your SoB when sending V2?


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

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

* Re: [PATCH] i2c: gpio: merge two very similar comments
  2019-01-23 18:42   ` Wolfram Sang
@ 2019-01-24 11:39     ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-01-24 11:39 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Wolfram Sang, linux-i2c, linux-renesas-soc, Haavard Skinnemoen

On Wed, Jan 23, 2019 at 07:42:58PM +0100, Wolfram Sang wrote:
> On Wed, Jan 23, 2019 at 11:18:54AM +0100, Simon Horman wrote:
> > On Sat, Jan 19, 2019 at 12:36:42PM +0100, Wolfram Sang wrote:
> > > I think it is clear enough if we have the explanation once and make it
> > > clear it is applicable for both SCL and SDA.
> > > 
> > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > ---
> > >  drivers/i2c/busses/i2c-gpio.c | 15 ++++-----------
> > >  1 file changed, 4 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> > > index c008d209f0b8..b9d43bc2853f 100644
> > > --- a/drivers/i2c/busses/i2c-gpio.c
> > > +++ b/drivers/i2c/busses/i2c-gpio.c
> > > @@ -286,10 +286,10 @@ static int i2c_gpio_probe(struct platform_device *pdev)
> > >  
> > >  	/*
> > >  	 * First get the GPIO pins; if it fails, we'll defer the probe.
> > > -	 * If the SDA line is marked from platform data or device tree as
> > > -	 * "open drain" it means something outside of our control is making
> > > -	 * this line being handled as open drain, and we should just handle
> > > -	 * it as any other output. Else we enforce open drain as this is
> > > +	 * If the SCL/SDA lines are marked from platform data or device tree
> > > +	 * as "open drain" it means something outside of our control is making
> > > +	 * these lines being handled as open drain, and we should just handle
> > > +	 * them as any other output. Else we enforce open drain as this is
> > >  	 * required for an I2C bus.
> > 
> > <2c>
> > 	If the SCL/SDA lines are marked "open drain" by platform data or
> > 	device tree then this means that something outside of our control is
> > 	marking these lines to be handled as open drain, and we should just
> > 	handle them as we handle any other output. Else we enforce open
> > 	drain as this is required for an I2C bus.
> > </2c>
> 
> Cool, thanks Simon. Should I add your SoB when sending V2?

Sure,

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>




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

end of thread, other threads:[~2019-01-24 11:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-19 11:36 [PATCH] i2c: gpio: merge two very similar comments Wolfram Sang
2019-01-23 10:18 ` Simon Horman
2019-01-23 18:42   ` Wolfram Sang
2019-01-24 11:39     ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).