linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node
@ 2022-09-05 18:00 Andy Shevchenko
  2022-09-06  9:07 ` Neil Armstrong
  2022-09-08  8:35 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-09-05 18:00 UTC (permalink / raw)
  To: Andy Shevchenko, linux-gpio, linux-arm-kernel, linux-amlogic,
	linux-kernel
  Cc: Linus Walleij, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl

GPIO library now accepts fwnode as a firmware node, so
switch the driver to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/meson/pinctrl-meson.c | 7 +++----
 drivers/pinctrl/meson/pinctrl-meson.h | 4 +++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index cc2cd73ff8f9..530f3f934e19 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -608,6 +608,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
 
 	pc->chip.label = pc->data->name;
 	pc->chip.parent = pc->dev;
+	pc->chip.fwnode = pc->fwnode;
 	pc->chip.request = gpiochip_generic_request;
 	pc->chip.free = gpiochip_generic_free;
 	pc->chip.set_config = gpiochip_generic_config;
@@ -619,8 +620,6 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
 	pc->chip.base = -1;
 	pc->chip.ngpio = pc->data->num_pins;
 	pc->chip.can_sleep = false;
-	pc->chip.of_node = pc->of_node;
-	pc->chip.of_gpio_n_cells = 2;
 
 	ret = gpiochip_add_data(&pc->chip, pc);
 	if (ret) {
@@ -678,8 +677,8 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc)
 		return -EINVAL;
 	}
 
-	gpio_np = to_of_node(gpiochip_node_get_first(pc->dev));
-	pc->of_node = gpio_np;
+	pc->fwnode = gpiochip_node_get_first(pc->dev);
+	gpio_np = to_of_node(pc->fwnode);
 
 	pc->reg_mux = meson_map_resource(pc, gpio_np, "mux");
 	if (IS_ERR_OR_NULL(pc->reg_mux)) {
diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
index b197827027bd..34fc4e8612e4 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.h
+++ b/drivers/pinctrl/meson/pinctrl-meson.h
@@ -12,6 +12,8 @@
 #include <linux/types.h>
 #include <linux/module.h>
 
+struct fwnode_handle;
+
 struct meson_pinctrl;
 
 /**
@@ -131,7 +133,7 @@ struct meson_pinctrl {
 	struct regmap *reg_gpio;
 	struct regmap *reg_ds;
 	struct gpio_chip chip;
-	struct device_node *of_node;
+	struct fwnode_handle *fwnode;
 };
 
 #define FUNCTION(fn)							\
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node
  2022-09-05 18:00 [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node Andy Shevchenko
@ 2022-09-06  9:07 ` Neil Armstrong
  2022-09-06 11:52   ` Andy Shevchenko
  2022-09-08  8:35 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Neil Armstrong @ 2022-09-06  9:07 UTC (permalink / raw)
  To: Andy Shevchenko, linux-gpio, linux-arm-kernel, linux-amlogic,
	linux-kernel
  Cc: Linus Walleij, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl

On 05/09/2022 20:00, Andy Shevchenko wrote:
> GPIO library now accepts fwnode as a firmware node, so
> switch the driver to use it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/pinctrl/meson/pinctrl-meson.c | 7 +++----
>   drivers/pinctrl/meson/pinctrl-meson.h | 4 +++-
>   2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
> index cc2cd73ff8f9..530f3f934e19 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
> @@ -608,6 +608,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
>   
>   	pc->chip.label = pc->data->name;
>   	pc->chip.parent = pc->dev;
> +	pc->chip.fwnode = pc->fwnode;
>   	pc->chip.request = gpiochip_generic_request;
>   	pc->chip.free = gpiochip_generic_free;
>   	pc->chip.set_config = gpiochip_generic_config;
> @@ -619,8 +620,6 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
>   	pc->chip.base = -1;
>   	pc->chip.ngpio = pc->data->num_pins;
>   	pc->chip.can_sleep = false;
> -	pc->chip.of_node = pc->of_node;
> -	pc->chip.of_gpio_n_cells = 2;
>   
>   	ret = gpiochip_add_data(&pc->chip, pc);
>   	if (ret) {
> @@ -678,8 +677,8 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc)
>   		return -EINVAL;
>   	}
>   
> -	gpio_np = to_of_node(gpiochip_node_get_first(pc->dev));
> -	pc->of_node = gpio_np;
> +	pc->fwnode = gpiochip_node_get_first(pc->dev);
> +	gpio_np = to_of_node(pc->fwnode);
>   
>   	pc->reg_mux = meson_map_resource(pc, gpio_np, "mux");
>   	if (IS_ERR_OR_NULL(pc->reg_mux)) {
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
> index b197827027bd..34fc4e8612e4 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.h
> +++ b/drivers/pinctrl/meson/pinctrl-meson.h
> @@ -12,6 +12,8 @@
>   #include <linux/types.h>
>   #include <linux/module.h>
>   
> +struct fwnode_handle;
> +
>   struct meson_pinctrl;
>   
>   /**
> @@ -131,7 +133,7 @@ struct meson_pinctrl {
>   	struct regmap *reg_gpio;
>   	struct regmap *reg_ds;
>   	struct gpio_chip chip;
> -	struct device_node *of_node;
> +	struct fwnode_handle *fwnode;
>   };
>   
>   #define FUNCTION(fn)							\

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node
  2022-09-06  9:07 ` Neil Armstrong
@ 2022-09-06 11:52   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-09-06 11:52 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linux-gpio, linux-arm-kernel, linux-amlogic, linux-kernel,
	Linus Walleij, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl

On Tue, Sep 06, 2022 at 11:07:07AM +0200, Neil Armstrong wrote:
> On 05/09/2022 20:00, Andy Shevchenko wrote:
> > GPIO library now accepts fwnode as a firmware node, so
> > switch the driver to use it.

...

> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

Thanks!

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node
  2022-09-05 18:00 [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node Andy Shevchenko
  2022-09-06  9:07 ` Neil Armstrong
@ 2022-09-08  8:35 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2022-09-08  8:35 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-gpio, linux-arm-kernel, linux-amlogic, linux-kernel,
	Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl

On Mon, Sep 5, 2022 at 8:00 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> GPIO library now accepts fwnode as a firmware node, so
> switch the driver to use it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-09-08  8:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 18:00 [PATCH v1 1/1] pinctrl: meson: Switch to use fwnode instead of of_node Andy Shevchenko
2022-09-06  9:07 ` Neil Armstrong
2022-09-06 11:52   ` Andy Shevchenko
2022-09-08  8:35 ` Linus Walleij

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