All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
@ 2023-01-12 14:51 Andy Shevchenko
  2023-01-12 16:22 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andy Shevchenko @ 2023-01-12 14:51 UTC (permalink / raw)
  To: Bartosz Golaszewski, Dmitry Torokhov, Andy Shevchenko,
	linux-gpio, linux-kernel, devicetree
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring, Frank Rowand

GPIO library for OF is the only user for enum of_gpio_flags.
Move it there.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-of.c | 15 +++++++++++++++
 include/linux/of_gpio.h   | 15 ---------------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index edc769d2d338..72d8a3da31e3 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -23,6 +23,21 @@
 #include "gpiolib.h"
 #include "gpiolib-of.h"
 
+/*
+ * This is Linux-specific flags. By default controllers' and Linux' mapping
+ * match, but GPIO controllers are free to translate their own flags to
+ * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
+ */
+enum of_gpio_flags {
+	OF_GPIO_ACTIVE_LOW = 0x1,
+	OF_GPIO_SINGLE_ENDED = 0x2,
+	OF_GPIO_OPEN_DRAIN = 0x4,
+	OF_GPIO_TRANSITORY = 0x8,
+	OF_GPIO_PULL_UP = 0x10,
+	OF_GPIO_PULL_DOWN = 0x20,
+	OF_GPIO_PULL_DISABLE = 0x40,
+};
+
 /**
  * of_gpio_named_count() - Count GPIOs for a device
  * @np:		device node to count GPIOs for
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 935225caf70d..5d58b3b0a97e 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -17,21 +17,6 @@
 
 struct device_node;
 
-/*
- * This is Linux-specific flags. By default controllers' and Linux' mapping
- * match, but GPIO controllers are free to translate their own flags to
- * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
- */
-enum of_gpio_flags {
-	OF_GPIO_ACTIVE_LOW = 0x1,
-	OF_GPIO_SINGLE_ENDED = 0x2,
-	OF_GPIO_OPEN_DRAIN = 0x4,
-	OF_GPIO_TRANSITORY = 0x8,
-	OF_GPIO_PULL_UP = 0x10,
-	OF_GPIO_PULL_DOWN = 0x20,
-	OF_GPIO_PULL_DISABLE = 0x40,
-};
-
 #ifdef CONFIG_OF_GPIO
 
 #include <linux/container_of.h>
-- 
2.39.0


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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-12 14:51 [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user Andy Shevchenko
@ 2023-01-12 16:22 ` Andy Shevchenko
  2023-01-13 20:23   ` Rob Herring
  2023-01-13 20:28 ` Rob Herring
  2023-01-26 14:46 ` Arnd Bergmann
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2023-01-12 16:22 UTC (permalink / raw)
  To: Bartosz Golaszewski, Dmitry Torokhov, linux-gpio, linux-kernel,
	devicetree
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring, Frank Rowand

On Thu, Jan 12, 2023 at 04:51:40PM +0200, Andy Shevchenko wrote:
> GPIO library for OF is the only user for enum of_gpio_flags.
> Move it there.

...

> +/*
> + * This is Linux-specific flags. By default controllers' and Linux' mapping
> + * match, but GPIO controllers are free to translate their own flags to
> + * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
> + */

Now that I re-read the comment, I think this can be postponed until we get a
consensus that no new driver is ever should do non 1:1 mapping.

If that consensus achieved, we may drop this enum altogether and replace it
with the generic flags..

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-12 16:22 ` Andy Shevchenko
@ 2023-01-13 20:23   ` Rob Herring
  2023-01-13 21:19     ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2023-01-13 20:23 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bartosz Golaszewski, Dmitry Torokhov, linux-gpio, linux-kernel,
	devicetree, Linus Walleij, Bartosz Golaszewski, Frank Rowand

On Thu, Jan 12, 2023 at 06:22:25PM +0200, Andy Shevchenko wrote:
> On Thu, Jan 12, 2023 at 04:51:40PM +0200, Andy Shevchenko wrote:
> > GPIO library for OF is the only user for enum of_gpio_flags.
> > Move it there.
> 
> ...
> 
> > +/*
> > + * This is Linux-specific flags. By default controllers' and Linux' mapping
> > + * match, but GPIO controllers are free to translate their own flags to
> > + * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
> > + */
> 
> Now that I re-read the comment, I think this can be postponed until we get a
> consensus that no new driver is ever should do non 1:1 mapping.
> 
> If that consensus achieved, we may drop this enum altogether and replace it
> with the generic flags..

We don't keep things with no users. We can move this back if there ever 
is a user.

Rob

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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-12 14:51 [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user Andy Shevchenko
  2023-01-12 16:22 ` Andy Shevchenko
@ 2023-01-13 20:28 ` Rob Herring
  2023-01-26 14:46 ` Arnd Bergmann
  2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2023-01-13 20:28 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rob Herring, Dmitry Torokhov, devicetree, Linus Walleij,
	linux-kernel, Bartosz Golaszewski, Bartosz Golaszewski,
	linux-gpio, Frank Rowand


On Thu, 12 Jan 2023 16:51:40 +0200, Andy Shevchenko wrote:
> GPIO library for OF is the only user for enum of_gpio_flags.
> Move it there.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpiolib-of.c | 15 +++++++++++++++
>  include/linux/of_gpio.h   | 15 ---------------
>  2 files changed, 15 insertions(+), 15 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-13 20:23   ` Rob Herring
@ 2023-01-13 21:19     ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2023-01-13 21:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bartosz Golaszewski, Dmitry Torokhov, linux-gpio, linux-kernel,
	devicetree, Linus Walleij, Bartosz Golaszewski, Frank Rowand

On Fri, Jan 13, 2023 at 02:23:51PM -0600, Rob Herring wrote:
> On Thu, Jan 12, 2023 at 06:22:25PM +0200, Andy Shevchenko wrote:
> > On Thu, Jan 12, 2023 at 04:51:40PM +0200, Andy Shevchenko wrote:
> > > GPIO library for OF is the only user for enum of_gpio_flags.
> > > Move it there.

...

> > > +/*
> > > + * This is Linux-specific flags. By default controllers' and Linux' mapping
> > > + * match, but GPIO controllers are free to translate their own flags to
> > > + * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
> > > + */
> > 
> > Now that I re-read the comment, I think this can be postponed until we get a
> > consensus that no new driver is ever should do non 1:1 mapping.
> > 
> > If that consensus achieved, we may drop this enum altogether and replace it
> > with the generic flags..
> 
> We don't keep things with no users. We can move this back if there ever 
> is a user.

Yes! But my point to go even deeper and replace this 1:1 mapped bits by
the generic ones.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-12 14:51 [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user Andy Shevchenko
  2023-01-12 16:22 ` Andy Shevchenko
  2023-01-13 20:28 ` Rob Herring
@ 2023-01-26 14:46 ` Arnd Bergmann
  2023-01-27  8:49   ` Andy Shevchenko
  2 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2023-01-26 14:46 UTC (permalink / raw)
  To: Andy Shevchenko, Bartosz Golaszewski, Dmitry Torokhov,
	open list:GPIO SUBSYSTEM, linux-kernel, devicetree
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring, Frank Rowand

On Thu, Jan 12, 2023, at 15:51, Andy Shevchenko wrote:
> GPIO library for OF is the only user for enum of_gpio_flags.
> Move it there.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I made the same patch independently, but you sent it first, so

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-26 14:46 ` Arnd Bergmann
@ 2023-01-27  8:49   ` Andy Shevchenko
  2023-01-27  9:16     ` Bartosz Golaszewski
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2023-01-27  8:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bartosz Golaszewski, Dmitry Torokhov, open list:GPIO SUBSYSTEM,
	linux-kernel, devicetree, Linus Walleij, Bartosz Golaszewski,
	Rob Herring, Frank Rowand

On Thu, Jan 26, 2023 at 03:46:32PM +0100, Arnd Bergmann wrote:
> On Thu, Jan 12, 2023, at 15:51, Andy Shevchenko wrote:
> > GPIO library for OF is the only user for enum of_gpio_flags.
> > Move it there.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> I made the same patch independently, but you sent it first, so
> 
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Thank you!

Bart, I guess we have a consensus to proceed with this, the worries I have
can be addressed later on, i.e. as a followup patch.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user
  2023-01-27  8:49   ` Andy Shevchenko
@ 2023-01-27  9:16     ` Bartosz Golaszewski
  0 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2023-01-27  9:16 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Bartosz Golaszewski, Dmitry Torokhov,
	open list:GPIO SUBSYSTEM, linux-kernel, devicetree,
	Linus Walleij, Rob Herring, Frank Rowand

On Fri, Jan 27, 2023 at 9:49 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Jan 26, 2023 at 03:46:32PM +0100, Arnd Bergmann wrote:
> > On Thu, Jan 12, 2023, at 15:51, Andy Shevchenko wrote:
> > > GPIO library for OF is the only user for enum of_gpio_flags.
> > > Move it there.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > I made the same patch independently, but you sent it first, so
> >
> > Reviewed-by: Arnd Bergmann <arnd@arndb.de>
>
> Thank you!
>
> Bart, I guess we have a consensus to proceed with this, the worries I have
> can be addressed later on, i.e. as a followup patch.
>

Sounds good, applied!

Bart

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

end of thread, other threads:[~2023-01-27  9:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12 14:51 [PATCH v1 1/1] gpiolib: of: Move enum of_gpio_flags to its only user Andy Shevchenko
2023-01-12 16:22 ` Andy Shevchenko
2023-01-13 20:23   ` Rob Herring
2023-01-13 21:19     ` Andy Shevchenko
2023-01-13 20:28 ` Rob Herring
2023-01-26 14:46 ` Arnd Bergmann
2023-01-27  8:49   ` Andy Shevchenko
2023-01-27  9:16     ` Bartosz Golaszewski

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.