All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip
@ 2021-12-23 10:38 Andy Shevchenko
  2021-12-23 10:38 ` [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andy Shevchenko @ 2021-12-23 10:38 UTC (permalink / raw)
  To: Andy Shevchenko, linux-gpio, linux-kernel, linux-acpi
  Cc: Hoan Tran, Serge Semin, Linus Walleij, Bartosz Golaszewski,
	Mika Westerberg

If the driver sets the fwnode in struct gpio_chip, let it take
precedence over the parent's fwnode.

This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make
fwnode take precedence in struct gpio_chip").

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index c7a0e56593e7..c0f6a25c3279 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -1339,6 +1339,9 @@ void acpi_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev)
 	/* Set default fwnode to parent's one if present */
 	if (gc->parent)
 		ACPI_COMPANION_SET(&gdev->dev, ACPI_COMPANION(gc->parent));
+
+	if (gc->fwnode)
+		device_set_node(&gdev->dev, gc->fwnode);
 }
 
 static int acpi_gpio_package_count(const union acpi_object *obj)
-- 
2.34.1


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

* [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node
  2021-12-23 10:38 [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Andy Shevchenko
@ 2021-12-23 10:38 ` Andy Shevchenko
  2021-12-24 13:47   ` Serge Semin
  2022-01-03 10:05   ` Bartosz Golaszewski
  2021-12-23 12:04 ` [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Mika Westerberg
  2022-01-03 10:06 ` Bartosz Golaszewski
  2 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2021-12-23 10:38 UTC (permalink / raw)
  To: Andy Shevchenko, linux-gpio, linux-kernel, linux-acpi
  Cc: Hoan Tran, Serge Semin, Linus Walleij, Bartosz Golaszewski,
	Mika Westerberg

GPIO library now accepts fwnode as a firmware node, so
switch the driver to use it and hence rectify the ACPI
case which uses software nodes.

Note, in this case it's rather logical fix that doesn't
affect functionality, thus no backporting required.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-dwapb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index ec0767d7800d..b0f3aca61974 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -15,7 +15,6 @@
 #include <linux/irq.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/reset.h>
@@ -515,9 +514,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
 		return err;
 	}
 
-#ifdef CONFIG_OF_GPIO
-	port->gc.of_node = to_of_node(pp->fwnode);
-#endif
+	port->gc.fwnode = pp->fwnode;
 	port->gc.ngpio = pp->ngpio;
 	port->gc.base = pp->gpio_base;
 
-- 
2.34.1


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

* Re: [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip
  2021-12-23 10:38 [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Andy Shevchenko
  2021-12-23 10:38 ` [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Andy Shevchenko
@ 2021-12-23 12:04 ` Mika Westerberg
  2022-01-03 10:06 ` Bartosz Golaszewski
  2 siblings, 0 replies; 6+ messages in thread
From: Mika Westerberg @ 2021-12-23 12:04 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-gpio, linux-kernel, linux-acpi, Hoan Tran, Serge Semin,
	Linus Walleij, Bartosz Golaszewski

On Thu, Dec 23, 2021 at 12:38:08PM +0200, Andy Shevchenko wrote:
> If the driver sets the fwnode in struct gpio_chip, let it take
> precedence over the parent's fwnode.
> 
> This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make
> fwnode take precedence in struct gpio_chip").
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node
  2021-12-23 10:38 ` [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Andy Shevchenko
@ 2021-12-24 13:47   ` Serge Semin
  2022-01-03 10:05   ` Bartosz Golaszewski
  1 sibling, 0 replies; 6+ messages in thread
From: Serge Semin @ 2021-12-24 13:47 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Serge Semin, linux-gpio, linux-kernel, linux-acpi, Hoan Tran,
	Linus Walleij, Bartosz Golaszewski, Mika Westerberg

On Thu, Dec 23, 2021 at 12:38:09PM +0200, Andy Shevchenko wrote:
> GPIO library now accepts fwnode as a firmware node, so
> switch the driver to use it and hence rectify the ACPI
> case which uses software nodes.
> 
> Note, in this case it's rather logical fix that doesn't
> affect functionality, thus no backporting required.

Thanks for the patch.
Acked-by: Serge Semin <fancer.lancer@gmail.com>

-Sergey

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-dwapb.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index ec0767d7800d..b0f3aca61974 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -15,7 +15,6 @@
>  #include <linux/irq.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/property.h>
>  #include <linux/reset.h>
> @@ -515,9 +514,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
>  		return err;
>  	}
>  
> -#ifdef CONFIG_OF_GPIO
> -	port->gc.of_node = to_of_node(pp->fwnode);
> -#endif
> +	port->gc.fwnode = pp->fwnode;
>  	port->gc.ngpio = pp->ngpio;
>  	port->gc.base = pp->gpio_base;
>  
> -- 
> 2.34.1
> 

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

* Re: [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node
  2021-12-23 10:38 ` [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Andy Shevchenko
  2021-12-24 13:47   ` Serge Semin
@ 2022-01-03 10:05   ` Bartosz Golaszewski
  1 sibling, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2022-01-03 10:05 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: open list:GPIO SUBSYSTEM, Linux Kernel Mailing List,
	ACPI Devel Maling List, Hoan Tran, Serge Semin, Linus Walleij,
	Mika Westerberg

On Thu, Dec 23, 2021 at 11:38 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library now accepts fwnode as a firmware node, so
> switch the driver to use it and hence rectify the ACPI
> case which uses software nodes.
>
> Note, in this case it's rather logical fix that doesn't
> affect functionality, thus no backporting required.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Applied, thanks!

Bart

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

* Re: [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip
  2021-12-23 10:38 [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Andy Shevchenko
  2021-12-23 10:38 ` [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Andy Shevchenko
  2021-12-23 12:04 ` [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Mika Westerberg
@ 2022-01-03 10:06 ` Bartosz Golaszewski
  2 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2022-01-03 10:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: open list:GPIO SUBSYSTEM, Linux Kernel Mailing List,
	ACPI Devel Maling List, Hoan Tran, Serge Semin, Linus Walleij,
	Mika Westerberg

On Thu, Dec 23, 2021 at 11:38 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> If the driver sets the fwnode in struct gpio_chip, let it take
> precedence over the parent's fwnode.
>
> This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make
> fwnode take precedence in struct gpio_chip").
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Applied, thanks!

Bart

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

end of thread, other threads:[~2022-01-03 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-23 10:38 [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Andy Shevchenko
2021-12-23 10:38 ` [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Andy Shevchenko
2021-12-24 13:47   ` Serge Semin
2022-01-03 10:05   ` Bartosz Golaszewski
2021-12-23 12:04 ` [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Mika Westerberg
2022-01-03 10:06 ` 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.