diff mbox series

pinctrl: renesas: rza2: Mark GPIOs as used

Message ID 2862093f7701dcaf29f37c0b2f9268234168338f.1727711124.git.geert+renesas@glider.be (mailing list archive)
State New
Delegated to: Geert Uytterhoeven
Headers show
Series pinctrl: renesas: rza2: Mark GPIOs as used | expand

Commit Message

Geert Uytterhoeven Sept. 30, 2024, 3:47 p.m. UTC
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(+)

Comments

Wolfram Sang Sept. 30, 2024, 7:16 p.m. UTC | #1
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>
Geert Uytterhoeven Oct. 1, 2024, 7:15 a.m. UTC | #2
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
diff mbox series

Patch

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,