mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support
@ 2026-08-27 14:29 Michael Zavertkin
  2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Michael Zavertkin @ 2026-08-27 14:29 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 referes it
in documentation.

Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>
---
Changes in v4:
- Fixed SoB mismatch
- Link to v3: https://patch.msgid.link/cover.1787209558.git.misha.zavertkin@mail.ru

Changes in v3:
- 'gpio-ranges' is optional in dt-bindings
- pinctrl supported for all SoCs (no-op if disabled in configuration)
- Dropped Reviewed-by (patch changed)
- Link to v2: https://patch.msgid.link/cover.1787130560.git.misha.zavertkin@mail.ru

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

 .../devicetree/bindings/gpio/realtek,otto-gpio.yaml          | 2 ++
 drivers/gpio/gpio-realtek-otto.c                             | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.54.0


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

* [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges
  2026-08-27 14:29 [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
@ 2026-08-27 14:29 ` Michael Zavertkin
  2026-09-01  7:50   ` Krzysztof Kozlowski
  2026-09-14  9:16   ` Linus Walleij
  2026-08-27 14:29 ` [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
  2026-09-14  8:38 ` [PATCH v4 0/2] " Bartosz Golaszewski
  2 siblings, 2 replies; 10+ messages in thread
From: Michael Zavertkin @ 2026-08-27 14:29 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

Add 'gpio-ranges' optional property to reflect driver changes.

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

diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
index b18f8f0ca0ae..33c25df7b815 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: true
+
   ngpios:
     minimum: 1
     maximum: 32
-- 
2.54.0


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

* [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support
  2026-08-27 14:29 [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
  2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
@ 2026-08-27 14:29 ` Michael Zavertkin
  2026-09-02  9:27   ` Bartosz Golaszewski
  2026-09-14  8:38 ` [PATCH v4 0/2] " Bartosz Golaszewski
  2 siblings, 1 reply; 10+ messages in thread
From: Michael Zavertkin @ 2026-08-27 14:29 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.
pinctrl driver for other SoCs might be implemented later.

Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>
---
 drivers/gpio/gpio-realtek-otto.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
index 4a606bad5848..01be8baa25c3 100644
--- a/drivers/gpio/gpio-realtek-otto.c
+++ b/drivers/gpio/gpio-realtek-otto.c
@@ -393,13 +393,14 @@ static int realtek_gpio_probe(struct platform_device *pdev)
 
 	raw_spin_lock_init(&ctrl->lock);
 
+	gen_gc_flags = GPIO_GENERIC_PINCTRL_BACKEND;
+
 	if (dev_flags & GPIO_PORTS_REVERSED) {
-		gen_gc_flags = 0;
 		ctrl->bank_read = realtek_gpio_bank_read;
 		ctrl->bank_write = realtek_gpio_bank_write;
 		ctrl->line_imr_pos = realtek_gpio_line_imr_pos;
 	} else {
-		gen_gc_flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
+		gen_gc_flags |= GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
 		ctrl->bank_read = realtek_gpio_bank_read_swapped;
 		ctrl->bank_write = realtek_gpio_bank_write_swapped;
 		ctrl->line_imr_pos = realtek_gpio_line_imr_pos_swapped;
-- 
2.54.0


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

* Re: [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges
  2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
@ 2026-09-01  7:50   ` Krzysztof Kozlowski
  2026-09-14  9:16   ` Linus Walleij
  1 sibling, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-01  7:50 UTC (permalink / raw)
  To: Michael Zavertkin
  Cc: linux-gpio, Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, devicetree, linux-kernel

On Thu, Aug 27, 2026 at 09:29:30PM +0700, Michael Zavertkin wrote:
> Add 'gpio-ranges' optional property to reflect driver changes.
> 
> Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>
> ---
>  Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


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

* Re: [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support
  2026-08-27 14:29 ` [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
@ 2026-09-02  9:27   ` Bartosz Golaszewski
  2026-09-02 13:02     ` Michael Zavertkin
  0 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-09-02  9:27 UTC (permalink / raw)
  To: Michael Zavertkin
  Cc: linux-gpio, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Sander Vanheule, Bert Vermeulen, devicetree,
	linux-kernel

On Thu, Aug 27, 2026 at 4:29 PM Michael Zavertkin
<misha.zavertkin@mail.ru> wrote:
>
> RTL9607C relies on pinctrl to mux SoC pins. Use pinctrl to request pins
> for GPIO.
> pinctrl driver for other SoCs might be implemented later.
>

So for now shouldn't you make it conditional on the compatible for
this one model?

Bart

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

* Re: [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support
  2026-09-02  9:27   ` Bartosz Golaszewski
@ 2026-09-02 13:02     ` Michael Zavertkin
  2026-09-10  9:11       ` Bartosz Golaszewski
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Zavertkin @ 2026-09-02 13:02 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, linux-gpio, devicetree, linux-kernel

On Wed, Sep 02, 2026 at 11:27:50AM +0200, Bartosz Golaszewski wrote:
> On Thu, Aug 27, 2026 at 4:29 PM Michael Zavertkin
> <misha.zavertkin@mail.ru> wrote:
> >
> > RTL9607C relies on pinctrl to mux SoC pins. Use pinctrl to request pins
> > for GPIO.
> > pinctrl driver for other SoCs might be implemented later.
> >
> 
> So for now shouldn't you make it conditional on the compatible for
> this one model?
> 
> Bart

It might, but enabling it for all will spare time if/when pin
controllers for other SoCs will be implemented. And it doesn't change
anything if pinctrl not enabled/provided for them.


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

* Re: [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support
  2026-09-02 13:02     ` Michael Zavertkin
@ 2026-09-10  9:11       ` Bartosz Golaszewski
  2026-09-10 21:29         ` Michael Zavertkin
  0 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-09-10  9:11 UTC (permalink / raw)
  To: Michael Zavertkin
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, linux-gpio, devicetree, linux-kernel

On Wed, 2 Sep 2026 15:02:01 +0200, Michael Zavertkin
<misha.zavertkin@mail.ru> said:
> On Wed, Sep 02, 2026 at 11:27:50AM +0200, Bartosz Golaszewski wrote:
>> On Thu, Aug 27, 2026 at 4:29 PM Michael Zavertkin
>> <misha.zavertkin@mail.ru> wrote:
>> >
>> > RTL9607C relies on pinctrl to mux SoC pins. Use pinctrl to request pins
>> > for GPIO.
>> > pinctrl driver for other SoCs might be implemented later.
>> >
>>
>> So for now shouldn't you make it conditional on the compatible for
>> this one model?
>>
>> Bart
>
> It might, but enabling it for all will spare time if/when pin
> controllers for other SoCs will be implemented. And it doesn't change
> anything if pinctrl not enabled/provided for them.
>
>

Sashiko claims otherwise[1] so I had a look and it seems to me that it's
correct saying we'll defer indefinitely for GPIO chips not backed by a pin
controller.

Bart

[1] https://sashiko.dev/#/patchset/cover.1787830440.git.misha.zavertkin%40mail.ru

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

* Re: [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support
  2026-09-10  9:11       ` Bartosz Golaszewski
@ 2026-09-10 21:29         ` Michael Zavertkin
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Zavertkin @ 2026-09-10 21:29 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, linux-gpio, devicetree, linux-kernel

On Thu, Sep 10, 2026 at 02:11:51AM -0700, Bartosz Golaszewski wrote:
> On Wed, 2 Sep 2026 15:02:01 +0200, Michael Zavertkin
> <misha.zavertkin@mail.ru> said:
> > On Wed, Sep 02, 2026 at 11:27:50AM +0200, Bartosz Golaszewski wrote:
> >> On Thu, Aug 27, 2026 at 4:29 PM Michael Zavertkin
> >> <misha.zavertkin@mail.ru> wrote:
> >> >
> >> > RTL9607C relies on pinctrl to mux SoC pins. Use pinctrl to request pins
> >> > for GPIO.
> >> > pinctrl driver for other SoCs might be implemented later.
> >> >
> >>
> >> So for now shouldn't you make it conditional on the compatible for
> >> this one model?
> >>
> >> Bart
> >
> > It might, but enabling it for all will spare time if/when pin
> > controllers for other SoCs will be implemented. And it doesn't change
> > anything if pinctrl not enabled/provided for them.
> >
> >
> 
> Sashiko claims otherwise[1] so I had a look and it seems to me that it's
> correct saying we'll defer indefinitely for GPIO chips not backed by a pin
> controller.
> 
> Bart
> 
> [1] https://sashiko.dev/#/patchset/cover.1787830440.git.misha.zavertkin%40mail.ru

Already addressed: https://patch.msgid.link/20260820-fix-gpio-mmio-pinctrl-v1-1-62c2d7dd4903@kernel.org

Tried it myself, without that patch infinite defers happens if no
pinctrl provided. After patch applied probe loop doesn't happen.


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

* Re: [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support
  2026-08-27 14:29 [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
  2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
  2026-08-27 14:29 ` [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
@ 2026-09-14  8:38 ` Bartosz Golaszewski
  2 siblings, 0 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-09-14  8:38 UTC (permalink / raw)
  To: linux-gpio, Michael Zavertkin
  Cc: Bartosz Golaszewski, Linus Walleij, Bartosz Golaszewski,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, devicetree, linux-kernel


On Thu, 27 Aug 2026 21:29:29 +0700, Michael Zavertkin wrote:
> This series adds pinctrl support for RTL9607C and referes it
> in documentation.
> 
> 

Applied, thanks!

[1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges
      https://git.kernel.org/brgl/c/3f860d25f7be981d78c1b85a8d4fafcd914d4df9
[2/2] gpio: realtek-otto: add pinctrl support
      https://git.kernel.org/brgl/c/7257c35db0fdb4fb02d857a8197a16afa84d92c0

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

* Re: [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges
  2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
  2026-09-01  7:50   ` Krzysztof Kozlowski
@ 2026-09-14  9:16   ` Linus Walleij
  1 sibling, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2026-09-14  9:16 UTC (permalink / raw)
  To: Michael Zavertkin
  Cc: linux-gpio, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sander Vanheule,
	Bert Vermeulen, devicetree, linux-kernel

On Thu, Aug 27, 2026 at 4:29 PM Michael Zavertkin
<misha.zavertkin@mail.ru> wrote:

> Add 'gpio-ranges' optional property to reflect driver changes.
>
> Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2026-09-14  9:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 14:29 [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
2026-09-01  7:50   ` Krzysztof Kozlowski
2026-09-14  9:16   ` Linus Walleij
2026-08-27 14:29 ` [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
2026-09-02  9:27   ` Bartosz Golaszewski
2026-09-02 13:02     ` Michael Zavertkin
2026-09-10  9:11       ` Bartosz Golaszewski
2026-09-10 21:29         ` Michael Zavertkin
2026-09-14  8:38 ` [PATCH v4 0/2] " Bartosz Golaszewski

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

all inboxes | Powered by JetHome®