linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: renesas: rza2: Mark GPIOs as used
@ 2024-09-30 15:47 Geert Uytterhoeven
  2024-09-30 19:16 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2024-09-30 15:47 UTC (permalink / raw)
  To: Linus Walleij, Wolfram Sang, Chris Brandt
  Cc: linux-renesas-soc, linux-gpio, Geert Uytterhoeven

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

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be queued in renesas-pinctrl for v6.13.

On RZA2M-EVB,
/sys/kernel/debug/pinctrl/fcffe000.pinctrl-pinctrl-rza2/pinmux-pins
changes:

    @@ -48,7 +48,7 @@
     pin 45 (P5_5): device e822a000.mmc function sdhi1 group sdhi1
     pin 46 (P5_6): UNCLAIMED
     pin 47 (P5_7): UNCLAIMED
    -pin 48 (P6_0): UNCLAIMED
    +pin 48 (P6_0): GPIO pinctrl:560
     pin 49 (P6_1): UNCLAIMED
     pin 50 (P6_2): UNCLAIMED
     pin 51 (P6_3): UNCLAIMED
    @@ -97,7 +97,7 @@
     pin 94 (PB_6): UNCLAIMED
     pin 95 (PB_7): UNCLAIMED
     pin 96 (PC_0): UNCLAIMED
    -pin 97 (PC_1): UNCLAIMED
    +pin 97 (PC_1): GPIO pinctrl:609
     pin 98 (PC_2): UNCLAIMED
     pin 99 (PC_3): UNCLAIMED
     pin 100 (PC_4): UNCLAIMED
---
 drivers/pinctrl/renesas/pinctrl-rza2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c
index af689d7c117f3548..dd1f8c29d3e7557b 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza2.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza2.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/pinctrl/pinmux.h>
 #include <linux/platform_device.h>
 
@@ -229,6 +230,8 @@ static const char * const rza2_gpio_names[] = {
 static struct gpio_chip chip = {
 	.names = rza2_gpio_names,
 	.base = -1,
+	.request = pinctrl_gpio_request,
+	.free = pinctrl_gpio_free,
 	.get_direction = rza2_chip_get_direction,
 	.direction_input = rza2_chip_direction_input,
 	.direction_output = rza2_chip_direction_output,
-- 
2.34.1


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

* Re: [PATCH] pinctrl: renesas: rza2: Mark GPIOs as used
  2024-09-30 15:47 [PATCH] pinctrl: renesas: rza2: Mark GPIOs as used Geert Uytterhoeven
@ 2024-09-30 19:16 ` Wolfram Sang
  2024-10-01  7:15   ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2024-09-30 19:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Chris Brandt, linux-renesas-soc, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Mon, Sep 30, 2024 at 05:47:19PM +0200, Geert Uytterhoeven wrote:
> GPIOs showed up as unclaimed in debugfs, so they could be muxed to
> something else even though they were in use.  Mark GPIOs as claimed when
> in use to avoid that.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Maybe also?
Reported-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] pinctrl: renesas: rza2: Mark GPIOs as used
  2024-09-30 19:16 ` Wolfram Sang
@ 2024-10-01  7:15   ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2024-10-01  7:15 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Linus Walleij, Chris Brandt, linux-renesas-soc, linux-gpio

On Mon, Sep 30, 2024 at 9:16 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> On Mon, Sep 30, 2024 at 05:47:19PM +0200, Geert Uytterhoeven wrote:
> > GPIOs showed up as unclaimed in debugfs, so they could be muxed to
> > something else even though they were in use.  Mark GPIOs as claimed when
> > in use to avoid that.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> Maybe also?
> Reported-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Sure ;-)

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] 3+ messages in thread

end of thread, other threads:[~2024-10-01  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 15:47 [PATCH] pinctrl: renesas: rza2: Mark GPIOs as used Geert Uytterhoeven
2024-09-30 19:16 ` Wolfram Sang
2024-10-01  7:15   ` 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).