The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] gpio: realtek-otto: add pinctrl support
@ 2026-08-19 15:51 misha.zavertkin
  2026-08-19 15:51 ` [PATCH v2 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges misha.zavertkin
  2026-08-19 15:51 ` [PATCH v2 2/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
  0 siblings, 2 replies; 3+ messages in thread
From: misha.zavertkin @ 2026-08-19 15:51 UTC (permalink / raw)
  To: linux-gpio
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, devicetree, linux-kernel, Michael Zavertkin

This series adds pinctrl support for RTL9607C and marks it as required
in documentation.
---
Changes in v2:
- Add 'required' property to dt-bindings
- Dropped the ellipsis and added Reviewed-by
- Link to v1: https://patch.msgid.link/amRpvtNAwIQak_9y@gamepc
---
Michael Zavertkin (2):
  dt-bindings: gpio: otto-gpio: Add gpio-ranges
  gpio: realtek-otto: add pinctrl support

 .../bindings/gpio/realtek,otto-gpio.yaml           | 14 ++++++++++++++
 drivers/gpio/gpio-realtek-otto.c                   | 10 +++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

-- 
2.54.0


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

* [PATCH v2 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges
  2026-08-19 15:51 [PATCH v2 0/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
@ 2026-08-19 15:51 ` misha.zavertkin
  2026-08-19 15:51 ` [PATCH v2 2/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
  1 sibling, 0 replies; 3+ messages in thread
From: misha.zavertkin @ 2026-08-19 15:51 UTC (permalink / raw)
  To: linux-gpio
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, devicetree, linux-kernel, Michael Zavertkin

Pinctrl is required for RTL9607C GPIOs to work, otherwise controller
won't be routed to SoC pins. Add corresponding requirement to
Documentation for realtek,rtl9607-gpio.

Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>
---
 .../bindings/gpio/realtek,otto-gpio.yaml           | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
index b18f8f0ca0ae..96396f968e78 100644
--- a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
@@ -40,6 +40,8 @@ properties:
 
   gpio-controller: true
 
+  gpio-ranges: false
+
   ngpios:
     minimum: 1
     maximum: 32
@@ -75,6 +77,18 @@ required:
   - "#gpio-cells"
   - gpio-controller
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: realtek,rtl9607-gpio
+    then:
+      properties:
+        gpio-ranges: true
+      required:
+        - gpio-ranges
+
 additionalProperties: false
 
 dependencies:
-- 
2.54.0


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

* [PATCH v2 2/2] gpio: realtek-otto: add pinctrl support
  2026-08-19 15:51 [PATCH v2 0/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
  2026-08-19 15:51 ` [PATCH v2 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges misha.zavertkin
@ 2026-08-19 15:51 ` misha.zavertkin
  1 sibling, 0 replies; 3+ messages in thread
From: misha.zavertkin @ 2026-08-19 15:51 UTC (permalink / raw)
  To: linux-gpio
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, devicetree, linux-kernel, Michael Zavertkin

RTL9607C relies on pinctrl to mux SoC pins. Use pinctrl to request pins
for GPIO

Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>
Reviewed-by: Linus Walleij <linusw@kernel.org>
---
 drivers/gpio/gpio-realtek-otto.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
index 4a606bad5848..86948da8adec 100644
--- a/drivers/gpio/gpio-realtek-otto.c
+++ b/drivers/gpio/gpio-realtek-otto.c
@@ -97,6 +97,11 @@ enum realtek_gpio_flags {
 	 * range, where the per-cpu enable masks are located.
 	 */
 	GPIO_INTERRUPTS_PER_CPU = BIT(2),
+	/*
+	 * Request GPIOs from pinctrl using gpiochip_generic_request()
+	 * and gpiochip_generic_free().
+	 */
+	GPIO_PINCTRL = BIT(3),
 };
 
 static struct realtek_gpio_ctrl *irq_data_to_ctrl(struct irq_data *data)
@@ -354,7 +359,7 @@ static const struct of_device_id realtek_gpio_of_match[] = {
 	},
 	{
 		.compatible = "realtek,rtl9607-gpio",
-		.data = (void *)GPIO_PORTS_REVERSED,
+		.data = (void *)(GPIO_PORTS_REVERSED | GPIO_PINCTRL),
 	},
 	{}
 };
@@ -405,6 +410,9 @@ static int realtek_gpio_probe(struct platform_device *pdev)
 		ctrl->line_imr_pos = realtek_gpio_line_imr_pos_swapped;
 	}
 
+	if (dev_flags & GPIO_PINCTRL)
+		gen_gc_flags |= GPIO_GENERIC_PINCTRL_BACKEND;
+
 	config = (struct gpio_generic_chip_config) {
 		.dev = dev,
 		.sz = 4,
-- 
2.54.0


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

end of thread, other threads:[~2026-08-19 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 15:51 [PATCH v2 0/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
2026-08-19 15:51 ` [PATCH v2 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges misha.zavertkin
2026-08-19 15:51 ` [PATCH v2 2/2] gpio: realtek-otto: add pinctrl support misha.zavertkin

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