* [PATCH 0/2] usb: renesas_usbhs: Deprecate renesas,enable-gpio @ 2024-10-02 7:35 Geert Uytterhoeven 2024-10-02 7:35 ` [PATCH 1/2] dt-bindings: usb: renesas,usbhs: " Geert Uytterhoeven 2024-10-02 7:35 ` [PATCH 2/2] ARM: dts: renesas: rcar-gen2: Switch HS-USB to renesas,enable-gpios Geert Uytterhoeven 0 siblings, 2 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2024-10-02 7:35 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda Cc: linux-usb, devicetree, linux-renesas-soc, Geert Uytterhoeven Hi all, The "gpio" suffix for GPIO consumers was deprecated a while ago, in favor of the "gpios" suffix. However, there are still several users of the "renesas,enable-gpio" property, in DT bindings and DT source files. Hence this series deprecates the old property in the DT bindings, and converts all users in DTS files to the new property. No driver changes are needed, as devm_gpiod_get_optional() as called from usbhs_probe() tries all suffixes. The first patch is targeted for the DT or USB tree. The second patch is targeted for the Renesas DTS tree. Thanks for your comments! Geert Uytterhoeven (2): dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio ARM: dts: renesas: rcar-gen2: Switch HS-USB to renesas,enable-gpios Documentation/devicetree/bindings/usb/renesas,usbhs.yaml | 4 ++++ arch/arm/boot/dts/renesas/r8a7790-lager.dts | 2 +- arch/arm/boot/dts/renesas/r8a7791-koelsch.dts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) -- 2.34.1 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] 8+ messages in thread
* [PATCH 1/2] dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio 2024-10-02 7:35 [PATCH 0/2] usb: renesas_usbhs: Deprecate renesas,enable-gpio Geert Uytterhoeven @ 2024-10-02 7:35 ` Geert Uytterhoeven 2024-10-02 7:56 ` Wolfram Sang 2024-10-02 21:37 ` Rob Herring (Arm) 2024-10-02 7:35 ` [PATCH 2/2] ARM: dts: renesas: rcar-gen2: Switch HS-USB to renesas,enable-gpios Geert Uytterhoeven 1 sibling, 2 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2024-10-02 7:35 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda Cc: linux-usb, devicetree, linux-renesas-soc, Geert Uytterhoeven Commit 2071d0968e564b4b ("Documentation: gpio: guidelines for bindings") deprecated the "gpio" suffix for GPIO consumers in favor of the "gpios" suffix. Update the Renesas HS-USB DT bindings to reflect this. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- Documentation/devicetree/bindings/usb/renesas,usbhs.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml b/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml index c63db3ebd07bd493..b23ef29bf7949ff9 100644 --- a/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml +++ b/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml @@ -76,6 +76,10 @@ properties: Integer to use BUSWAIT register. renesas,enable-gpio: + deprecated: true + maxItems: 1 + + renesas,enable-gpios: maxItems: 1 description: | gpio specifier to check GPIO determining if USB function should be -- 2.34.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio 2024-10-02 7:35 ` [PATCH 1/2] dt-bindings: usb: renesas,usbhs: " Geert Uytterhoeven @ 2024-10-02 7:56 ` Wolfram Sang 2024-10-02 12:10 ` Geert Uytterhoeven 2024-10-02 21:37 ` Rob Herring (Arm) 1 sibling, 1 reply; 8+ messages in thread From: Wolfram Sang @ 2024-10-02 7:56 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc [-- Attachment #1: Type: text/plain, Size: 134 bytes --] > + renesas,enable-gpios: Isn't this a good occasion to drop the "renesas"-prefix? Binding docs are full of plain "enable-gpios". [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio 2024-10-02 7:56 ` Wolfram Sang @ 2024-10-02 12:10 ` Geert Uytterhoeven 2024-10-02 14:09 ` Linus Walleij 0 siblings, 1 reply; 8+ messages in thread From: Geert Uytterhoeven @ 2024-10-02 12:10 UTC (permalink / raw) To: Wolfram Sang Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc, Linus Walleij, Bartosz Golaszewski, open list:GPIO SUBSYSTEM Hi Wolfram, CC gpio On Wed, Oct 2, 2024 at 9:56 AM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > > + renesas,enable-gpios: > > Isn't this a good occasion to drop the "renesas"-prefix? Binding docs > are full of plain "enable-gpios". Well, that's of course another option (actually 3 ;-) Compared to simply switching from "renesas,enable-gpio" to "renesas,enable-gpios", dropping the vendor prefix requires changes to the HS-USB driver and/or to gpiolib. Worse, this would also become a hard dependency for updating the DTS files. Option A: Add a call to devm_gpiod_get_optional(dev, "enable", GPIOD_IN) as a fallback to usbhs_probe(). Option B: Switch usbhs_probe() from "renesas,enable" to "enable" and add quirks to of_find_gpio_rename(): #if IS_ENABLED(CONFIG_USB_RENESAS_USBHS) /* * The Renesas HS-USB DT bindings happened before enable-gpios * was established as a generic property */ { "enable", "renesas,enable-gpio", "renesas,rza1-usbhs" }, { "enable", "renesas,enable-gpio", "renesas,rza2-usbhs" }, { "enable", "renesas,enable-gpio", "renesas,rzg2l-usbhs" }, { "enable", "renesas,enable-gpio", "renesas,rcar-gen2-usbhs" }, { "enable", "renesas,enable-gpio", "renesas,rcar-gen3-usbhs" }, #endif Option C: Add a generic "strip vendor prefix" fallback to of_find_gpio(): const char *stripped; if (gpiod_not_found(desc) && con_id && (stripped = strchr(con_id, ',')) && *(++stripped)) { for_each_gpio_property_name(propname, stripped) { desc = of_get_named_gpiod_flags(np, propname, idx, &of_flags); if (!gpiod_not_found(desc)) break; } } Option B adds a bit too much to my liking. Option C may be useful for others (e.g. {ti,nxp,maxim},enable-gpio(s)), but might be considered too dangerous as a general fallback? Thoughts? Thanks! 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] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio 2024-10-02 12:10 ` Geert Uytterhoeven @ 2024-10-02 14:09 ` Linus Walleij 2024-10-02 21:36 ` Rob Herring 0 siblings, 1 reply; 8+ messages in thread From: Linus Walleij @ 2024-10-02 14:09 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Wolfram Sang, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc, Bartosz Golaszewski, open list:GPIO SUBSYSTEM On Wed, Oct 2, 2024 at 2:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > Option B: Switch usbhs_probe() from "renesas,enable" to "enable" > and add quirks to of_find_gpio_rename(): > > #if IS_ENABLED(CONFIG_USB_RENESAS_USBHS) > /* > * The Renesas HS-USB DT bindings happened before > enable-gpios > * was established as a generic property > */ > { "enable", "renesas,enable-gpio", > "renesas,rza1-usbhs" }, (...) I would actually prefer this. > Option C: Add a generic "strip vendor prefix" fallback to > of_find_gpio(): I understand the appeal, but the idea is for the quirks to be very specific (hence they are enabled only if specific drivers are compiled in) and not start to be helpful. Doing this would make any vendor,foo start to work and I don't like that at all: any such mechanism will invariably be abused. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio 2024-10-02 14:09 ` Linus Walleij @ 2024-10-02 21:36 ` Rob Herring 0 siblings, 0 replies; 8+ messages in thread From: Rob Herring @ 2024-10-02 21:36 UTC (permalink / raw) To: Linus Walleij Cc: Geert Uytterhoeven, Wolfram Sang, Greg Kroah-Hartman, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc, Bartosz Golaszewski, open list:GPIO SUBSYSTEM On Wed, Oct 02, 2024 at 04:09:28PM +0200, Linus Walleij wrote: > On Wed, Oct 2, 2024 at 2:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > Option B: Switch usbhs_probe() from "renesas,enable" to "enable" > > and add quirks to of_find_gpio_rename(): > > > > #if IS_ENABLED(CONFIG_USB_RENESAS_USBHS) > > /* > > * The Renesas HS-USB DT bindings happened before > > enable-gpios > > * was established as a generic property > > */ > > { "enable", "renesas,enable-gpio", > > "renesas,rza1-usbhs" }, > (...) > > I would actually prefer this. > > > Option C: Add a generic "strip vendor prefix" fallback to > > of_find_gpio(): > > I understand the appeal, but the idea is for the quirks to be > very specific (hence they are enabled only if specific > drivers are compiled in) and not start to be helpful. Doing > this would make any vendor,foo start to work and I don't like that > at all: any such mechanism will invariably be abused. +1 Unless there's a bunch more platforms coming, I'd just stick with this patch (or even do nothing). Rob ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: usb: renesas,usbhs: Deprecate renesas,enable-gpio 2024-10-02 7:35 ` [PATCH 1/2] dt-bindings: usb: renesas,usbhs: " Geert Uytterhoeven 2024-10-02 7:56 ` Wolfram Sang @ 2024-10-02 21:37 ` Rob Herring (Arm) 1 sibling, 0 replies; 8+ messages in thread From: Rob Herring (Arm) @ 2024-10-02 21:37 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Greg Kroah-Hartman, Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc, Magnus Damm, Conor Dooley, Krzysztof Kozlowski On Wed, 02 Oct 2024 09:35:12 +0200, Geert Uytterhoeven wrote: > Commit 2071d0968e564b4b ("Documentation: gpio: guidelines for bindings") > deprecated the "gpio" suffix for GPIO consumers in favor of the "gpios" > suffix. Update the Renesas HS-USB DT bindings to reflect this. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > Documentation/devicetree/bindings/usb/renesas,usbhs.yaml | 4 ++++ > 1 file changed, 4 insertions(+) > Reviewed-by: Rob Herring (Arm) <robh@kernel.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] ARM: dts: renesas: rcar-gen2: Switch HS-USB to renesas,enable-gpios 2024-10-02 7:35 [PATCH 0/2] usb: renesas_usbhs: Deprecate renesas,enable-gpio Geert Uytterhoeven 2024-10-02 7:35 ` [PATCH 1/2] dt-bindings: usb: renesas,usbhs: " Geert Uytterhoeven @ 2024-10-02 7:35 ` Geert Uytterhoeven 1 sibling, 0 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2024-10-02 7:35 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Yoshihiro Shimoda Cc: linux-usb, devicetree, linux-renesas-soc, Geert Uytterhoeven Commit 2071d0968e564b4b ("Documentation: gpio: guidelines for bindings") deprecated the "gpio" suffix for GPIO consumers in favor of the "gpios" suffix. Hence replace the "renesas,enable-gpio" property by "renesas,enable-gpios" in HS-USB device nodes. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- arch/arm/boot/dts/renesas/r8a7790-lager.dts | 2 +- arch/arm/boot/dts/renesas/r8a7791-koelsch.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/renesas/r8a7790-lager.dts b/arch/arm/boot/dts/renesas/r8a7790-lager.dts index 8590981245a62057..826a29064d27f663 100644 --- a/arch/arm/boot/dts/renesas/r8a7790-lager.dts +++ b/arch/arm/boot/dts/renesas/r8a7790-lager.dts @@ -890,7 +890,7 @@ &hsusb { status = "okay"; pinctrl-0 = <&hsusb_pins>; pinctrl-names = "default"; - renesas,enable-gpio = <&gpio5 18 GPIO_ACTIVE_HIGH>; + renesas,enable-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>; }; &usbphy { diff --git a/arch/arm/boot/dts/renesas/r8a7791-koelsch.dts b/arch/arm/boot/dts/renesas/r8a7791-koelsch.dts index 0efd9f98c75aced0..0a8eac57135f2e81 100644 --- a/arch/arm/boot/dts/renesas/r8a7791-koelsch.dts +++ b/arch/arm/boot/dts/renesas/r8a7791-koelsch.dts @@ -859,7 +859,7 @@ &hsusb { status = "okay"; pinctrl-0 = <&usb0_pins>; pinctrl-names = "default"; - renesas,enable-gpio = <&gpio5 31 GPIO_ACTIVE_HIGH>; + renesas,enable-gpios = <&gpio5 31 GPIO_ACTIVE_HIGH>; }; &usbphy { -- 2.34.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-10-02 21:37 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-02 7:35 [PATCH 0/2] usb: renesas_usbhs: Deprecate renesas,enable-gpio Geert Uytterhoeven 2024-10-02 7:35 ` [PATCH 1/2] dt-bindings: usb: renesas,usbhs: " Geert Uytterhoeven 2024-10-02 7:56 ` Wolfram Sang 2024-10-02 12:10 ` Geert Uytterhoeven 2024-10-02 14:09 ` Linus Walleij 2024-10-02 21:36 ` Rob Herring 2024-10-02 21:37 ` Rob Herring (Arm) 2024-10-02 7:35 ` [PATCH 2/2] ARM: dts: renesas: rcar-gen2: Switch HS-USB to renesas,enable-gpios 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).