linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION
@ 2020-09-20 20:34 Ed Wildgoose
  2020-09-24 13:29 ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Wildgoose @ 2020-09-20 20:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: fe, Ed Wildgoose, Enrico Weigelt, metux IT consult,
	Linus Walleij, Bartosz Golaszewski, linux-gpio

The original commit appears to have the logic reversed in
amd_fch_gpio_get_direction. Also confirmed by observing the value of
"direction" in the sys tree.

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
---
 drivers/gpio/gpio-amd-fch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
index 4e44ba4d7..2a21354ed 100644
--- a/drivers/gpio/gpio-amd-fch.c
+++ b/drivers/gpio/gpio-amd-fch.c
@@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
 	ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
+	return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
 }
 
 static void amd_fch_gpio_set(struct gpio_chip *gc,
-- 
2.26.2


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

* Re: [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION
  2020-09-20 20:34 [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION Ed Wildgoose
@ 2020-09-24 13:29 ` Bartosz Golaszewski
  2020-09-28  9:44   ` Ed Wildgoose
  0 siblings, 1 reply; 4+ messages in thread
From: Bartosz Golaszewski @ 2020-09-24 13:29 UTC (permalink / raw)
  To: Ed Wildgoose
  Cc: LKML, fe, Enrico Weigelt, metux IT consult, Linus Walleij, linux-gpio

On Sun, Sep 20, 2020 at 10:34 PM Ed Wildgoose <lists@wildgooses.com> wrote:
>
> The original commit appears to have the logic reversed in
> amd_fch_gpio_get_direction. Also confirmed by observing the value of
> "direction" in the sys tree.
>
> Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
> ---
>  drivers/gpio/gpio-amd-fch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
> index 4e44ba4d7..2a21354ed 100644
> --- a/drivers/gpio/gpio-amd-fch.c
> +++ b/drivers/gpio/gpio-amd-fch.c
> @@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
>         ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION);
>         spin_unlock_irqrestore(&priv->lock, flags);
>
> -       return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
> +       return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
>  }
>
>  static void amd_fch_gpio_set(struct gpio_chip *gc,
> --
> 2.26.2
>

Can you add a Fixes tag with the original commit?

Bartosz

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

* [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION
  2020-09-24 13:29 ` Bartosz Golaszewski
@ 2020-09-28  9:44   ` Ed Wildgoose
  2020-09-28 10:23     ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Wildgoose @ 2020-09-28  9:44 UTC (permalink / raw)
  To: bgolaszewski
  Cc: fe, Ed Wildgoose, Enrico Weigelt, metux IT consult,
	Linus Walleij, linux-gpio, linux-kernel

The original commit appears to have the logic reversed in
amd_fch_gpio_get_direction. Also confirmed by observing the value of
"direction" in the sys tree.

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver")
---
 drivers/gpio/gpio-amd-fch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
index 4e44ba4d7..2a21354ed 100644
--- a/drivers/gpio/gpio-amd-fch.c
+++ b/drivers/gpio/gpio-amd-fch.c
@@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
 	ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION);
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
+	return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
 }
 
 static void amd_fch_gpio_set(struct gpio_chip *gc,
-- 
2.26.2


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

* Re: [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION
  2020-09-28  9:44   ` Ed Wildgoose
@ 2020-09-28 10:23     ` Bartosz Golaszewski
  0 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2020-09-28 10:23 UTC (permalink / raw)
  To: Ed Wildgoose
  Cc: fe, Enrico Weigelt, metux IT consult, Linus Walleij, linux-gpio, LKML

On Mon, Sep 28, 2020 at 11:45 AM Ed Wildgoose <lists@wildgooses.com> wrote:
>
> The original commit appears to have the logic reversed in
> amd_fch_gpio_get_direction. Also confirmed by observing the value of
> "direction" in the sys tree.
>
> Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
> Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver")
> ---
>  drivers/gpio/gpio-amd-fch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
> index 4e44ba4d7..2a21354ed 100644
> --- a/drivers/gpio/gpio-amd-fch.c
> +++ b/drivers/gpio/gpio-amd-fch.c
> @@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
>         ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION);
>         spin_unlock_irqrestore(&priv->lock, flags);
>
> -       return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
> +       return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
>  }
>
>  static void amd_fch_gpio_set(struct gpio_chip *gc,
> --
> 2.26.2
>

Queued for fixes, thanks!

Bartosz

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

end of thread, other threads:[~2020-09-28 10:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-20 20:34 [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION Ed Wildgoose
2020-09-24 13:29 ` Bartosz Golaszewski
2020-09-28  9:44   ` Ed Wildgoose
2020-09-28 10:23     ` Bartosz Golaszewski

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).