diff mbox series

gpio: mmio: Drop bgpio_dir_inverted

Message ID 20190404165715.4237-1-linus.walleij@linaro.org
State New
Headers show
Series gpio: mmio: Drop bgpio_dir_inverted | expand

Commit Message

Linus Walleij April 4, 2019, 4:57 p.m. UTC
The direction inversion semantics are now handled by simply
using the registers for in/out available, no need to keep
track of inversion semantics exmplicitly anymore.

Cc: Jan Kotas <jank@cadence.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-mmio.c    | 7 -------
 include/linux/gpio/driver.h | 4 ----
 2 files changed, 11 deletions(-)

Comments

Bartosz Golaszewski April 8, 2019, 6:42 a.m. UTC | #1
czw., 4 kwi 2019 o 18:57 Linus Walleij <linus.walleij@linaro.org> napisaƂ(a):
>
> The direction inversion semantics are now handled by simply
> using the registers for in/out available, no need to keep
> track of inversion semantics exmplicitly anymore.
>
> Cc: Jan Kotas <jank@cadence.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-mmio.c    | 7 -------
>  include/linux/gpio/driver.h | 4 ----
>  2 files changed, 11 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c
> index 04be18b95485..6f904c874678 100644
> --- a/drivers/gpio/gpio-mmio.c
> +++ b/drivers/gpio/gpio-mmio.c
> @@ -533,13 +533,6 @@ static int bgpio_setup_direction(struct gpio_chip *gc,
>                 gc->direction_output = bgpio_dir_out;
>                 gc->direction_input = bgpio_dir_in;
>                 gc->get_direction = bgpio_get_dir;
> -               /*
> -                * If only dirin is available, this means we need
> -                * inverted semantics when handling get/set registers
> -                * so detect this here.
> -                */
> -               if (dirin && !dirout)
> -                       gc->bgpio_dir_inverted = true;
>         } else {
>                 if (flags & BGPIOF_NO_OUTPUT)
>                         gc->direction_output = bgpio_dir_out_err;
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index 95a51794c24a..4d69d458cf9f 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -229,9 +229,6 @@ struct gpio_irq_chip {
>   * @reg_clr: output clear register (out=low) for generic GPIO
>   * @reg_dir_out: direction out setting register for generic GPIO
>   * @reg_dir_in: direction in setting register for generic GPIO
> - * @bgpio_dir_inverted: indicates that the direction register is inverted
> - *     (gpiolib private state variable) this means @reg_dir_in is
> - *     available but not @reg_dir_out.
>   * @bgpio_dir_unreadable: indicates that the direction register(s) cannot
>   *     be read and we need to rely on out internal state tracking.
>   * @bgpio_bits: number of register bits used for a generic GPIO i.e.
> @@ -305,7 +302,6 @@ struct gpio_chip {
>         void __iomem *reg_clr;
>         void __iomem *reg_dir_out;
>         void __iomem *reg_dir_in;
> -       bool bgpio_dir_inverted;
>         bool bgpio_dir_unreadable;
>         int bgpio_bits;
>         spinlock_t bgpio_lock;
> --
> 2.20.1
>

Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c
index 04be18b95485..6f904c874678 100644
--- a/drivers/gpio/gpio-mmio.c
+++ b/drivers/gpio/gpio-mmio.c
@@ -533,13 +533,6 @@  static int bgpio_setup_direction(struct gpio_chip *gc,
 		gc->direction_output = bgpio_dir_out;
 		gc->direction_input = bgpio_dir_in;
 		gc->get_direction = bgpio_get_dir;
-		/*
-		 * If only dirin is available, this means we need
-		 * inverted semantics when handling get/set registers
-		 * so detect this here.
-		 */
-		if (dirin && !dirout)
-			gc->bgpio_dir_inverted = true;
 	} else {
 		if (flags & BGPIOF_NO_OUTPUT)
 			gc->direction_output = bgpio_dir_out_err;
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 95a51794c24a..4d69d458cf9f 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -229,9 +229,6 @@  struct gpio_irq_chip {
  * @reg_clr: output clear register (out=low) for generic GPIO
  * @reg_dir_out: direction out setting register for generic GPIO
  * @reg_dir_in: direction in setting register for generic GPIO
- * @bgpio_dir_inverted: indicates that the direction register is inverted
- *	(gpiolib private state variable) this means @reg_dir_in is
- *	available but not @reg_dir_out.
  * @bgpio_dir_unreadable: indicates that the direction register(s) cannot
  *	be read and we need to rely on out internal state tracking.
  * @bgpio_bits: number of register bits used for a generic GPIO i.e.
@@ -305,7 +302,6 @@  struct gpio_chip {
 	void __iomem *reg_clr;
 	void __iomem *reg_dir_out;
 	void __iomem *reg_dir_in;
-	bool bgpio_dir_inverted;
 	bool bgpio_dir_unreadable;
 	int bgpio_bits;
 	spinlock_t bgpio_lock;