linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: renesas: rza1: mark GPIOs as used
@ 2024-09-26 10:06 Wolfram Sang
  2024-09-30 15:30 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2024-09-26 10:06 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Jacopo Mondi, Wolfram Sang, Geert Uytterhoeven, Linus Walleij,
	linux-gpio

GPIOs showed up as unclaimed, so they could be muxed to something else
even though they were in use. Mark GPIOs as claimed to avoid that.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/pinctrl/renesas/pinctrl-rza1.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c
index 6527872813dc..797367ce5641 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
@@ -19,6 +19,7 @@
 #include <linux/ioport.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
@@ -750,6 +751,11 @@ static int rza1_pin_mux_single(struct rza1_pinctrl *rza1_pctl,
 static int rza1_gpio_request(struct gpio_chip *chip, unsigned int gpio)
 {
 	struct rza1_port *port = gpiochip_get_data(chip);
+	int ret;
+
+	ret = pinctrl_gpio_request(chip, gpio);
+	if (ret)
+		return ret;
 
 	rza1_pin_reset(port, gpio);
 
-- 
2.45.2


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

* Re: [PATCH] pinctrl: renesas: rza1: mark GPIOs as used
  2024-09-26 10:06 [PATCH] pinctrl: renesas: rza1: mark GPIOs as used Wolfram Sang
@ 2024-09-30 15:30 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2024-09-30 15:30 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Jacopo Mondi, Geert Uytterhoeven,
	Linus Walleij, linux-gpio

Hi Wolfram,

On Thu, Sep 26, 2024 at 12:07 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> GPIOs showed up as unclaimed, so they could be muxed to something else
> even though they were in use. Mark GPIOs as claimed to avoid that.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks for your patch, which reminds me to fix the same issue on RZ/A2 ;-)

> --- a/drivers/pinctrl/renesas/pinctrl-rza1.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
> @@ -19,6 +19,7 @@
>  #include <linux/ioport.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> +#include <linux/pinctrl/consumer.h>
>  #include <linux/pinctrl/pinconf-generic.h>
>  #include <linux/pinctrl/pinctrl.h>
>  #include <linux/pinctrl/pinmux.h>
> @@ -750,6 +751,11 @@ static int rza1_pin_mux_single(struct rza1_pinctrl *rza1_pctl,
>  static int rza1_gpio_request(struct gpio_chip *chip, unsigned int gpio)
>  {
>         struct rza1_port *port = gpiochip_get_data(chip);
> +       int ret;
> +
> +       ret = pinctrl_gpio_request(chip, gpio);
> +       if (ret)
> +               return ret;
>
>         rza1_pin_reset(port, gpio);

rza1_gpio_free() needs a balancing call to pinctrl_gpio_free().

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2024-09-30 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 10:06 [PATCH] pinctrl: renesas: rza1: mark GPIOs as used Wolfram Sang
2024-09-30 15:30 ` Geert Uytterhoeven

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