public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: renesas: rzg2l: Always call rzg2l_gpio_request() for interrupt pins
@ 2024-10-03 13:16 Prabhakar
  2024-10-03 13:46 ` Geert Uytterhoeven
  2024-10-09  8:11 ` claudiu beznea
  0 siblings, 2 replies; 7+ messages in thread
From: Prabhakar @ 2024-10-03 13:16 UTC (permalink / raw)
  To: Linus Walleij, Geert Uytterhoeven
  Cc: linux-gpio, linux-kernel, linux-renesas-soc, Prabhakar, Biju Das,
	Fabrizio Castro, Lad Prabhakar

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Ensure that rzg2l_gpio_request() is called for GPIO pins configured as
interrupts, regardless of whether they are muxed in u-boot. This
guarantees that the pinctrl core is aware of the GPIO pin usage via
pinctrl_gpio_request(), which is invoked through rzg2l_gpio_request().

Fixes: 2fd4fe19d0150 ("pinctrl: renesas: rzg2l: Configure interrupt input mode")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
Output before this patch on G2L/SMARC:
root@smarc-rzg2l:~# cat /sys/kernel/debug/pinctrl/11030000.pinctrl-pinctrl-rzg2l/pinmux-pins | grep P2_1
pin 17 (P2_1): UNCLAIMED

Output after this patch G2L/SMARC:
root@smarc-rzg2l:~# cat /sys/kernel/debug/pinctrl/11030000.pinctrl-pinctrl-rzg2l/pinmux-pins | grep P2_1
pin 17 (P2_1): GPIO 11030000.pinctrl:529
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 60ef20ca3ccf..1dceaf8290ea 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -2368,20 +2368,11 @@ static const struct irq_chip rzg2l_gpio_irqchip = {
 
 static int rzg2l_gpio_interrupt_input_mode(struct gpio_chip *chip, unsigned int offset)
 {
-	struct rzg2l_pinctrl *pctrl = gpiochip_get_data(chip);
-	const struct pinctrl_pin_desc *pin_desc = &pctrl->desc.pins[offset];
-	u64 *pin_data = pin_desc->drv_data;
-	u32 off = RZG2L_PIN_CFG_TO_PORT_OFFSET(*pin_data);
-	u8 bit = RZG2L_PIN_ID_TO_PIN(offset);
-	u8 reg8;
 	int ret;
 
-	reg8 = readb(pctrl->base + PMC(off));
-	if (reg8 & BIT(bit)) {
-		ret = rzg2l_gpio_request(chip, offset);
-		if (ret)
-			return ret;
-	}
+	ret = rzg2l_gpio_request(chip, offset);
+	if (ret)
+		return ret;
 
 	return rzg2l_gpio_direction_input(chip, offset);
 }
-- 
2.43.0


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

end of thread, other threads:[~2024-10-10 19:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03 13:16 [PATCH] pinctrl: renesas: rzg2l: Always call rzg2l_gpio_request() for interrupt pins Prabhakar
2024-10-03 13:46 ` Geert Uytterhoeven
2024-10-03 15:32   ` Lad, Prabhakar
2024-10-09  8:11 ` claudiu beznea
2024-10-09  8:27   ` Lad, Prabhakar
2024-10-10 19:47     ` Linus Walleij
2024-10-10 19:52       ` Lad, Prabhakar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox