All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: imx: use proper GPIO directions for recovery
@ 2017-12-04 12:31 Wolfram Sang
  2017-12-05  0:28 ` Phil Reid
  2017-12-07 11:04 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-12-04 12:31 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-renesas-soc, Wolfram Sang, Clemens Gruber, Phil Reid,
	Andy Shevchenko

When converting to GPIOD, the GPIO directions of SCL/SDA have been
swapped. Fix it!

Fixes: ad36a27959cabb ("i2c: imx: switch to using gpiod for bus recovery gpios")
Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Cc: Phil Reid <preid@electromag.com.au>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index c4cf26571b6612..6c0d59ddf5b6fd 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1006,8 +1006,8 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
 			PINCTRL_STATE_DEFAULT);
 	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
 			"gpio");
-	rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_OUT_HIGH);
-	rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_IN);
+	rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
+	rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH);
 
 	if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER ||
 	    PTR_ERR(rinfo->scl_gpiod) == -EPROBE_DEFER) {
-- 
2.11.0

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

* Re: [PATCH] i2c: imx: use proper GPIO directions for recovery
  2017-12-04 12:31 [PATCH] i2c: imx: use proper GPIO directions for recovery Wolfram Sang
@ 2017-12-05  0:28 ` Phil Reid
  2017-12-07 11:04 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Phil Reid @ 2017-12-05  0:28 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: linux-renesas-soc, Clemens Gruber, Andy Shevchenko

On 4/12/2017 20:31, Wolfram Sang wrote:
> When converting to GPIOD, the GPIO directions of SCL/SDA have been
> swapped. Fix it!
Sorry about that.

Reviewed-by: Phil Reid <preid@electromag.com.au>


> 
> Fixes: ad36a27959cabb ("i2c: imx: switch to using gpiod for bus recovery gpios")
> Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
> Cc: Phil Reid <preid@electromag.com.au>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>   drivers/i2c/busses/i2c-imx.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index c4cf26571b6612..6c0d59ddf5b6fd 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -1006,8 +1006,8 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
>   			PINCTRL_STATE_DEFAULT);
>   	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
>   			"gpio");
> -	rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_OUT_HIGH);
> -	rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_IN);
> +	rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
> +	rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH);
>   
>   	if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER ||
>   	    PTR_ERR(rinfo->scl_gpiod) == -EPROBE_DEFER) {
> 


-- 
Regards
Phil Reid

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

* Re: [PATCH] i2c: imx: use proper GPIO directions for recovery
  2017-12-04 12:31 [PATCH] i2c: imx: use proper GPIO directions for recovery Wolfram Sang
  2017-12-05  0:28 ` Phil Reid
@ 2017-12-07 11:04 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-12-07 11:04 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-renesas-soc, Clemens Gruber, Phil Reid, Andy Shevchenko

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

On Mon, Dec 04, 2017 at 01:31:54PM +0100, Wolfram Sang wrote:
> When converting to GPIOD, the GPIO directions of SCL/SDA have been
> swapped. Fix it!
> 
> Fixes: ad36a27959cabb ("i2c: imx: switch to using gpiod for bus recovery gpios")
> Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
> Cc: Phil Reid <preid@electromag.com.au>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.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:[~2017-12-07 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 12:31 [PATCH] i2c: imx: use proper GPIO directions for recovery Wolfram Sang
2017-12-05  0:28 ` Phil Reid
2017-12-07 11:04 ` 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.