devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Introduce usb-hub.yaml binding and add support for Parade PS5511
@ 2025-04-22  8:28 Pin-yen Lin
  2025-04-22  8:28 ` [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml Pin-yen Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-22  8:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Kaehlcke
  Cc: devicetree, linux-kernel, Pin-yen Lin, Stephen Boyd, linux-usb


This series introduces usb-hub.yaml for on-board USB hubs, and use it for
the newly-added Parade PS5511 binding and the existing Realtek RTS5411
hub controller.

Also add support for Parade PS5511 in onboard_usb_dev.c

Patch 1 introduces usb-hub.yaml as the bindings for on-board USB hubs
Patch 2 adds the binding for Parade PS5511
Patch 3 modifies realtek,rts5411.yaml to adapt usb-hub.yaml
Patch 4 adds the support for Parade PS5511 in onboard_usb_dev.c

Link to v1: https://lore.kernel.org/all/20250328082950.1473406-1-treapking@chromium.org/
Link to v2: https://lore.kernel.org/all/20250415094227.3629916-1-treapking@chromium.org/


Changes in v3:
- Remove redundant schemas
- Update schemas for downstream ports and devices for ps5511 and rts5411

Changes in v2:
- Introduce usb-hub.yaml
- Modify parade,ps5511 and realtek,rts5411 to use usb-hub.yaml
- Minor fixes on parade,ps5511.yaml

Pin-yen Lin (4):
  dt-bindings: usb: Introduce usb-hub.yaml
  dt-bindings: usb: Add binding for PS5511 hub controller
  dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  usb: misc: onboard_usb_dev: Add Parade PS5511 hub support

 .../bindings/usb/parade,ps5511.yaml           | 108 ++++++++++++++++++
 .../bindings/usb/realtek,rts5411.yaml         |  52 +++------
 .../devicetree/bindings/usb/usb-hub.yaml      |  84 ++++++++++++++
 drivers/usb/misc/onboard_usb_dev.c            |   3 +
 drivers/usb/misc/onboard_usb_dev.h            |   9 ++
 5 files changed, 217 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/parade,ps5511.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/usb-hub.yaml

-- 
2.49.0.805.g082f7c87e0-goog


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

* [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml
  2025-04-22  8:28 [PATCH v3 0/4] Introduce usb-hub.yaml binding and add support for Parade PS5511 Pin-yen Lin
@ 2025-04-22  8:28 ` Pin-yen Lin
  2025-04-25 20:04   ` Rob Herring (Arm)
  2025-04-28 23:47   ` Stephen Boyd
  2025-04-22  8:28 ` [PATCH v3 2/4] dt-bindings: usb: Add binding for PS5511 hub controller Pin-yen Lin
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-22  8:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Kaehlcke
  Cc: devicetree, linux-kernel, Pin-yen Lin, Stephen Boyd, linux-usb

Introduce a general USB hub binding that describes downstream ports
and hard wired USB devices for on-board USB hubs.

Signed-off-by: Pin-yen Lin <treapking@chromium.org>

---

Changes in v3:
- Remove redundant schemas

Changes in v2:
- New in v2

 .../devicetree/bindings/usb/usb-hub.yaml      | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/usb-hub.yaml

diff --git a/Documentation/devicetree/bindings/usb/usb-hub.yaml b/Documentation/devicetree/bindings/usb/usb-hub.yaml
new file mode 100644
index 00000000000000..5238ab10576308
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/usb-hub.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/usb-hub.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic USB Hub
+
+maintainers:
+  - Pin-yen Lin <treapking@chromium.org>
+
+allOf:
+  - $ref: usb-device.yaml#
+
+properties:
+  '#address-cells':
+    const: 1
+
+  peer-hub:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to the peer hub on the controller.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+    description:
+      The downstream facing USB ports
+
+    patternProperties:
+      "^port@[1-9a-f][0-9a-f]*$":
+        $ref: /schemas/graph.yaml#/properties/port
+
+patternProperties:
+  '^.*@[1-9a-f][0-9a-f]*$':
+    description: The hard wired USB devices
+    type: object
+    $ref: /schemas/usb/usb-device.yaml
+    additionalProperties: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+
+examples:
+  - |
+    usb {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* 2.0 hub on port 1 */
+        hub_2_0: hub@1 {
+            compatible = "usb123,4567";
+            reg = <1>;
+            peer-hub = <&hub_3_0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+            /* USB 2.0 device on port 5 */
+            device@5 {
+                reg = <5>;
+                compatible = "usb765,4321";
+            };
+        };
+
+        /* 3.0 hub on port 2 */
+        hub_3_0: hub@2 {
+            compatible = "usb123,abcd";
+            reg = <2>;
+            peer-hub = <&hub_2_0>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                /* Type-A connector on port 3 */
+                port@3 {
+                    reg = <3>;
+                    endpoint {
+                        remote-endpoint = <&usb_a0_ss>;
+                    };
+                };
+            };
+        };
+    };
-- 
2.49.0.805.g082f7c87e0-goog


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

* [PATCH v3 2/4] dt-bindings: usb: Add binding for PS5511 hub controller
  2025-04-22  8:28 [PATCH v3 0/4] Introduce usb-hub.yaml binding and add support for Parade PS5511 Pin-yen Lin
  2025-04-22  8:28 ` [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml Pin-yen Lin
@ 2025-04-22  8:28 ` Pin-yen Lin
  2025-04-25 20:05   ` Rob Herring (Arm)
  2025-04-22  8:28 ` [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml Pin-yen Lin
  2025-04-22  8:28 ` [PATCH v3 4/4] usb: misc: onboard_usb_dev: Add Parade PS5511 hub support Pin-yen Lin
  3 siblings, 1 reply; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-22  8:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Kaehlcke
  Cc: devicetree, linux-kernel, Pin-yen Lin, Stephen Boyd, linux-usb

Parade PS5511 is USB hub with 4 USB 3.2 compliant 5Gbps downstream(DS)
ports, and 1 extra USB 2.0 downstream port. The hub has one reset pin
control and two power supplies (3V3 and 1V1).

Signed-off-by: Pin-yen Lin <treapking@chromium.org>

---

Changes in v3:
- Remove redundant schemas
- Update the schema for downstream ports and devices

Changes in v2:
- Inherit usb-hub.yaml
- Fix bindings to reject port@5/device@5 for 3.0 hub correctly
- Minor string fixes

 .../bindings/usb/parade,ps5511.yaml           | 108 ++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/parade,ps5511.yaml

diff --git a/Documentation/devicetree/bindings/usb/parade,ps5511.yaml b/Documentation/devicetree/bindings/usb/parade,ps5511.yaml
new file mode 100644
index 00000000000000..10d002f09db8af
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/parade,ps5511.yaml
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/parade,ps5511.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Parade PS5511 4+1 Port USB 3.2 Gen 1 Hub Controller
+
+maintainers:
+  - Pin-yen Lin <treapking@chromium.org>
+
+properties:
+  compatible:
+    enum:
+      - usb1da0,5511
+      - usb1da0,55a1
+
+  reset-gpios:
+    items:
+      - description: GPIO specifier for RESETB pin.
+
+  vddd11-supply:
+    description:
+      1V1 power supply to the hub
+
+  vdd33-supply:
+    description:
+      3V3 power supply to the hub
+
+  peer-hub: true
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    patternProperties:
+      '^port@':
+        $ref: /schemas/graph.yaml#/properties/port
+
+        properties:
+          reg:
+            minimum: 1
+            maximum: 5
+
+additionalProperties:
+  properties:
+    reg:
+      minimum: 1
+      maximum: 5
+
+required:
+  - peer-hub
+
+allOf:
+  - $ref: usb-hub.yaml#
+  - if:
+      not:
+        properties:
+          compatible:
+            enum:
+              - usb1da0,55a1
+    then:
+      properties:
+        ports:
+          properties:
+            port@5: false
+
+      patternProperties:
+        '^.*@5$': false
+
+examples:
+  - |
+    usb {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* 2.0 hub on port 1 */
+        hub_2_0: hub@1 {
+            compatible = "usb1da0,55a1";
+            reg = <1>;
+            peer-hub = <&hub_3_0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+            /* USB 2.0 device on port 5 */
+            device@5 {
+                reg = <5>;
+                compatible = "usb123,4567";
+            };
+        };
+
+        /* 3.0 hub on port 2 */
+        hub_3_0: hub@2 {
+            compatible = "usb1da0,5511";
+            reg = <2>;
+            peer-hub = <&hub_2_0>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                /* Type-A connector on port 3 */
+                port@3 {
+                    reg = <3>;
+                    endpoint {
+                        remote-endpoint = <&usb_a0_ss>;
+                    };
+                };
+            };
+        };
+    };
-- 
2.49.0.805.g082f7c87e0-goog


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

* [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  2025-04-22  8:28 [PATCH v3 0/4] Introduce usb-hub.yaml binding and add support for Parade PS5511 Pin-yen Lin
  2025-04-22  8:28 ` [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml Pin-yen Lin
  2025-04-22  8:28 ` [PATCH v3 2/4] dt-bindings: usb: Add binding for PS5511 hub controller Pin-yen Lin
@ 2025-04-22  8:28 ` Pin-yen Lin
  2025-04-25 20:05   ` Rob Herring (Arm)
  2025-04-28 23:45   ` Stephen Boyd
  2025-04-22  8:28 ` [PATCH v3 4/4] usb: misc: onboard_usb_dev: Add Parade PS5511 hub support Pin-yen Lin
  3 siblings, 2 replies; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-22  8:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Kaehlcke
  Cc: devicetree, linux-kernel, Pin-yen Lin, Stephen Boyd, linux-usb

Inherit usb-hub.yaml and remove duplicated schemas.

Signed-off-by: Pin-yen Lin <treapking@chromium.org>

---

Changes in v3:
- Remove redundant schemas
- Update the schema for downstream ports and devices

Changes in v2:
- New in v2

 .../bindings/usb/realtek,rts5411.yaml         | 52 +++++--------------
 1 file changed, 13 insertions(+), 39 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
index 6577a61cc07531..a020afaf2d6e7a 100644
--- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
+++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
@@ -10,7 +10,7 @@ maintainers:
   - Matthias Kaehlcke <mka@chromium.org>
 
 allOf:
-  - $ref: usb-device.yaml#
+  - $ref: usb-hub.yaml#
 
 properties:
   compatible:
@@ -19,61 +19,35 @@ properties:
           - usbbda,5411
           - usbbda,411
 
-  reg: true
-
-  '#address-cells':
-    const: 1
-
-  '#size-cells':
-    const: 0
-
   vdd-supply:
     description:
       phandle to the regulator that provides power to the hub.
 
-  peer-hub:
-    $ref: /schemas/types.yaml#/definitions/phandle
-    description:
-      phandle to the peer hub on the controller.
+  peer-hub: true
 
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
 
-    properties:
-      port@1:
-        $ref: /schemas/graph.yaml#/properties/port
-        description:
-          1st downstream facing USB port
-
-      port@2:
+    patternProperties:
+      '^port@':
         $ref: /schemas/graph.yaml#/properties/port
-        description:
-          2nd downstream facing USB port
 
-      port@3:
-        $ref: /schemas/graph.yaml#/properties/port
-        description:
-          3rd downstream facing USB port
+        properties:
+          reg:
+            minimum: 1
+            maximum: 4
 
-      port@4:
-        $ref: /schemas/graph.yaml#/properties/port
-        description:
-          4th downstream facing USB port
-
-patternProperties:
-  '^.*@[1-4]$':
-    description: The hard wired USB devices
-    type: object
-    $ref: /schemas/usb/usb-device.yaml
-    additionalProperties: true
+additionalProperties:
+  properties:
+    reg:
+      minimum: 1
+      maximum: 4
 
 required:
   - peer-hub
   - compatible
   - reg
 
-additionalProperties: false
-
 examples:
   - |
     usb {
-- 
2.49.0.805.g082f7c87e0-goog


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

* [PATCH v3 4/4] usb: misc: onboard_usb_dev: Add Parade PS5511 hub support
  2025-04-22  8:28 [PATCH v3 0/4] Introduce usb-hub.yaml binding and add support for Parade PS5511 Pin-yen Lin
                   ` (2 preceding siblings ...)
  2025-04-22  8:28 ` [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml Pin-yen Lin
@ 2025-04-22  8:28 ` Pin-yen Lin
  2025-04-28 23:36   ` Stephen Boyd
  3 siblings, 1 reply; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-22  8:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Kaehlcke
  Cc: devicetree, linux-kernel, Pin-yen Lin, Stephen Boyd, linux-usb

Parade PS5511 is 4+1 port USB 3.2 gen 1 hub with a reset pin and two power
supplies (3V3 and 1V1).

Add the support for this hub for the reset pin control and power supply.

Signed-off-by: Pin-yen Lin <treapking@chromium.org>

---

(no changes since v1)

 drivers/usb/misc/onboard_usb_dev.c | 3 +++
 drivers/usb/misc/onboard_usb_dev.h | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c
index 75ac3c6aa92d0d..91b49e58664d6b 100644
--- a/drivers/usb/misc/onboard_usb_dev.c
+++ b/drivers/usb/misc/onboard_usb_dev.c
@@ -490,6 +490,7 @@ static struct platform_driver onboard_dev_driver = {
 #define VENDOR_ID_CYPRESS	0x04b4
 #define VENDOR_ID_GENESYS	0x05e3
 #define VENDOR_ID_MICROCHIP	0x0424
+#define VENDOR_ID_PARADE	0x1da0
 #define VENDOR_ID_REALTEK	0x0bda
 #define VENDOR_ID_TI		0x0451
 #define VENDOR_ID_VIA		0x2109
@@ -580,6 +581,8 @@ static const struct usb_device_id onboard_dev_id_table[] = {
 	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2517) }, /* USB2517 USB 2.0 HUB */
 	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2744) }, /* USB5744 USB 2.0 HUB */
 	{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x5744) }, /* USB5744 USB 3.0 HUB */
+	{ USB_DEVICE(VENDOR_ID_PARADE, 0x5511) }, /* PS5511 USB 3.2 */
+	{ USB_DEVICE(VENDOR_ID_PARADE, 0x55a1) }, /* PS5511 USB 2.0 */
 	{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 HUB */
 	{ USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 HUB */
 	{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 HUB */
diff --git a/drivers/usb/misc/onboard_usb_dev.h b/drivers/usb/misc/onboard_usb_dev.h
index 933797a7e0841c..2963689958fc2a 100644
--- a/drivers/usb/misc/onboard_usb_dev.h
+++ b/drivers/usb/misc/onboard_usb_dev.h
@@ -38,6 +38,13 @@ static const struct onboard_dev_pdata microchip_usb5744_data = {
 	.is_hub = true,
 };
 
+static const struct onboard_dev_pdata parade_ps5511_data = {
+	.reset_us = 500,
+	.num_supplies = 2,
+	.supply_names = { "vddd11", "vdd33"},
+	.is_hub = true,
+};
+
 static const struct onboard_dev_pdata realtek_rts5411_data = {
 	.reset_us = 0,
 	.num_supplies = 1,
@@ -122,6 +129,8 @@ static const struct of_device_id onboard_dev_match[] = {
 	{ .compatible = "usbbda,5411", .data = &realtek_rts5411_data, },
 	{ .compatible = "usbbda,414", .data = &realtek_rts5411_data, },
 	{ .compatible = "usbbda,5414", .data = &realtek_rts5411_data, },
+	{ .compatible = "usb1da0,5511", .data = &parade_ps5511_data, },
+	{ .compatible = "usb1da0,55a1", .data = &parade_ps5511_data, },
 	{ .compatible = "usb2109,817", .data = &vialab_vl817_data, },
 	{ .compatible = "usb2109,2817", .data = &vialab_vl817_data, },
 	{ .compatible = "usb20b1,0013", .data = &xmos_xvf3500_data, },
-- 
2.49.0.805.g082f7c87e0-goog


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

* Re: [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml
  2025-04-22  8:28 ` [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml Pin-yen Lin
@ 2025-04-25 20:04   ` Rob Herring (Arm)
  2025-04-28 23:47   ` Stephen Boyd
  1 sibling, 0 replies; 15+ messages in thread
From: Rob Herring (Arm) @ 2025-04-25 20:04 UTC (permalink / raw)
  To: Pin-yen Lin
  Cc: linux-usb, Matthias Kaehlcke, devicetree, Krzysztof Kozlowski,
	Conor Dooley, linux-kernel, Stephen Boyd, Greg Kroah-Hartman


On Tue, 22 Apr 2025 16:28:27 +0800, Pin-yen Lin wrote:
> Introduce a general USB hub binding that describes downstream ports
> and hard wired USB devices for on-board USB hubs.
> 
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
> 
> ---
> 
> Changes in v3:
> - Remove redundant schemas
> 
> Changes in v2:
> - New in v2
> 
>  .../devicetree/bindings/usb/usb-hub.yaml      | 84 +++++++++++++++++++
>  1 file changed, 84 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/usb-hub.yaml
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH v3 2/4] dt-bindings: usb: Add binding for PS5511 hub controller
  2025-04-22  8:28 ` [PATCH v3 2/4] dt-bindings: usb: Add binding for PS5511 hub controller Pin-yen Lin
@ 2025-04-25 20:05   ` Rob Herring (Arm)
  0 siblings, 0 replies; 15+ messages in thread
From: Rob Herring (Arm) @ 2025-04-25 20:05 UTC (permalink / raw)
  To: Pin-yen Lin
  Cc: Matthias Kaehlcke, Krzysztof Kozlowski, Greg Kroah-Hartman,
	devicetree, Stephen Boyd, linux-kernel, linux-usb, Conor Dooley


On Tue, 22 Apr 2025 16:28:28 +0800, Pin-yen Lin wrote:
> Parade PS5511 is USB hub with 4 USB 3.2 compliant 5Gbps downstream(DS)
> ports, and 1 extra USB 2.0 downstream port. The hub has one reset pin
> control and two power supplies (3V3 and 1V1).
> 
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
> 
> ---
> 
> Changes in v3:
> - Remove redundant schemas
> - Update the schema for downstream ports and devices
> 
> Changes in v2:
> - Inherit usb-hub.yaml
> - Fix bindings to reject port@5/device@5 for 3.0 hub correctly
> - Minor string fixes
> 
>  .../bindings/usb/parade,ps5511.yaml           | 108 ++++++++++++++++++
>  1 file changed, 108 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/parade,ps5511.yaml
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  2025-04-22  8:28 ` [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml Pin-yen Lin
@ 2025-04-25 20:05   ` Rob Herring (Arm)
  2025-04-28 23:45   ` Stephen Boyd
  1 sibling, 0 replies; 15+ messages in thread
From: Rob Herring (Arm) @ 2025-04-25 20:05 UTC (permalink / raw)
  To: Pin-yen Lin
  Cc: linux-usb, linux-kernel, Greg Kroah-Hartman, Matthias Kaehlcke,
	Conor Dooley, Stephen Boyd, devicetree, Krzysztof Kozlowski


On Tue, 22 Apr 2025 16:28:29 +0800, Pin-yen Lin wrote:
> Inherit usb-hub.yaml and remove duplicated schemas.
> 
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
> 
> ---
> 
> Changes in v3:
> - Remove redundant schemas
> - Update the schema for downstream ports and devices
> 
> Changes in v2:
> - New in v2
> 
>  .../bindings/usb/realtek,rts5411.yaml         | 52 +++++--------------
>  1 file changed, 13 insertions(+), 39 deletions(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH v3 4/4] usb: misc: onboard_usb_dev: Add Parade PS5511 hub support
  2025-04-22  8:28 ` [PATCH v3 4/4] usb: misc: onboard_usb_dev: Add Parade PS5511 hub support Pin-yen Lin
@ 2025-04-28 23:36   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2025-04-28 23:36 UTC (permalink / raw)
  To: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Pin-yen Lin, Rob Herring
  Cc: devicetree, linux-kernel, linux-usb

Quoting Pin-yen Lin (2025-04-22 01:28:30)
> Parade PS5511 is 4+1 port USB 3.2 gen 1 hub with a reset pin and two power
> supplies (3V3 and 1V1).
>
> Add the support for this hub for the reset pin control and power supply.
>
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

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

* Re: [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  2025-04-22  8:28 ` [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml Pin-yen Lin
  2025-04-25 20:05   ` Rob Herring (Arm)
@ 2025-04-28 23:45   ` Stephen Boyd
  2025-04-29  4:57     ` Pin-yen Lin
  1 sibling, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2025-04-28 23:45 UTC (permalink / raw)
  To: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Pin-yen Lin, Rob Herring
  Cc: devicetree, linux-kernel, linux-usb

Quoting Pin-yen Lin (2025-04-22 01:28:29)
> diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> index 6577a61cc07531..a020afaf2d6e7a 100644
> --- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> @@ -10,7 +10,7 @@ maintainers:
>    - Matthias Kaehlcke <mka@chromium.org>
>
>  allOf:
> -  - $ref: usb-device.yaml#
> +  - $ref: usb-hub.yaml#
>
>  properties:
>    compatible:
> @@ -19,61 +19,35 @@ properties:
[...]
>
> -      port@4:
> -        $ref: /schemas/graph.yaml#/properties/port
> -        description:
> -          4th downstream facing USB port
> -
> -patternProperties:
> -  '^.*@[1-4]$':
> -    description: The hard wired USB devices
> -    type: object
> -    $ref: /schemas/usb/usb-device.yaml
> -    additionalProperties: true
> +additionalProperties:
> +  properties:
> +    reg:
> +      minimum: 1
> +      maximum: 4

Is this limiting the 'reg' property of the hub node and not the child
usb-device nodes?

>
>  required:
>    - peer-hub
>    - compatible
>    - reg

Can 'reg' be dropped because usb-hub.yaml requires it?

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

* Re: [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml
  2025-04-22  8:28 ` [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml Pin-yen Lin
  2025-04-25 20:04   ` Rob Herring (Arm)
@ 2025-04-28 23:47   ` Stephen Boyd
  2025-04-29  4:58     ` Pin-yen Lin
  1 sibling, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2025-04-28 23:47 UTC (permalink / raw)
  To: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Pin-yen Lin, Rob Herring
  Cc: devicetree, linux-kernel, linux-usb

Quoting Pin-yen Lin (2025-04-22 01:28:27)
> diff --git a/Documentation/devicetree/bindings/usb/usb-hub.yaml b/Documentation/devicetree/bindings/usb/usb-hub.yaml
> new file mode 100644
> index 00000000000000..5238ab10576308
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/usb-hub.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/usb-hub.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic USB Hub
> +
> +maintainers:
> +  - Pin-yen Lin <treapking@chromium.org>
> +
> +allOf:
> +  - $ref: usb-device.yaml#
> +
> +properties:
> +  '#address-cells':
> +    const: 1
> +
> +  peer-hub:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      phandle to the peer hub on the controller.
> +
> +  ports:
> +    $ref: /schemas/graph.yaml#/properties/ports
> +    description:
> +      The downstream facing USB ports
> +
> +    patternProperties:
> +      "^port@[1-9a-f][0-9a-f]*$":
> +        $ref: /schemas/graph.yaml#/properties/port
> +
> +patternProperties:
> +  '^.*@[1-9a-f][0-9a-f]*$':
> +    description: The hard wired USB devices
> +    type: object
> +    $ref: /schemas/usb/usb-device.yaml
> +    additionalProperties: true
> +
> +required:
> +  - compatible
> +  - reg

Can 'reg' be dropped because usb-device.yaml requires it?

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

* Re: [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  2025-04-28 23:45   ` Stephen Boyd
@ 2025-04-29  4:57     ` Pin-yen Lin
  2025-04-29 18:24       ` Stephen Boyd
  0 siblings, 1 reply; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-29  4:57 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Rob Herring, devicetree, linux-kernel,
	linux-usb

Hi Stephen,

On Tue, Apr 29, 2025 at 7:46 AM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Pin-yen Lin (2025-04-22 01:28:29)
> > diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > index 6577a61cc07531..a020afaf2d6e7a 100644
> > --- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > @@ -10,7 +10,7 @@ maintainers:
> >    - Matthias Kaehlcke <mka@chromium.org>
> >
> >  allOf:
> > -  - $ref: usb-device.yaml#
> > +  - $ref: usb-hub.yaml#
> >
> >  properties:
> >    compatible:
> > @@ -19,61 +19,35 @@ properties:
> [...]
> >
> > -      port@4:
> > -        $ref: /schemas/graph.yaml#/properties/port
> > -        description:
> > -          4th downstream facing USB port
> > -
> > -patternProperties:
> > -  '^.*@[1-4]$':
> > -    description: The hard wired USB devices
> > -    type: object
> > -    $ref: /schemas/usb/usb-device.yaml
> > -    additionalProperties: true
> > +additionalProperties:
> > +  properties:
> > +    reg:
> > +      minimum: 1
> > +      maximum: 4
>
> Is this limiting the 'reg' property of the hub node and not the child
> usb-device nodes?

Yes, but the regex pattern of patternProperties restricts the
downstream device nodes to '^.*@[1-4]$'. So the 'reg's of the child
usb-device nodes are also checked.
>
> >
> >  required:
> >    - peer-hub
> >    - compatible
> >    - reg
>
> Can 'reg' be dropped because usb-hub.yaml requires it?

I can drop 'reg' and 'compatible' in the next version, but I see other
schemas referencing usb-device.yaml still set 'reg' as required. Is
this some kind of convention, or people just didn't notice this?

Or maybe I shouldn't mark 'compatible' as requried in usb-hub.yaml to
make it more generic.

Regards,
Pin-yen

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

* Re: [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml
  2025-04-28 23:47   ` Stephen Boyd
@ 2025-04-29  4:58     ` Pin-yen Lin
  0 siblings, 0 replies; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-29  4:58 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Rob Herring, devicetree, linux-kernel,
	linux-usb

Hi Stephen,

On Tue, Apr 29, 2025 at 7:47 AM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Pin-yen Lin (2025-04-22 01:28:27)
> > diff --git a/Documentation/devicetree/bindings/usb/usb-hub.yaml b/Documentation/devicetree/bindings/usb/usb-hub.yaml
> > new file mode 100644
> > index 00000000000000..5238ab10576308
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/usb-hub.yaml
> > @@ -0,0 +1,84 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/usb/usb-hub.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Generic USB Hub
> > +
> > +maintainers:
> > +  - Pin-yen Lin <treapking@chromium.org>
> > +
> > +allOf:
> > +  - $ref: usb-device.yaml#
> > +
> > +properties:
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  peer-hub:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description:
> > +      phandle to the peer hub on the controller.
> > +
> > +  ports:
> > +    $ref: /schemas/graph.yaml#/properties/ports
> > +    description:
> > +      The downstream facing USB ports
> > +
> > +    patternProperties:
> > +      "^port@[1-9a-f][0-9a-f]*$":
> > +        $ref: /schemas/graph.yaml#/properties/port
> > +
> > +patternProperties:
> > +  '^.*@[1-9a-f][0-9a-f]*$':
> > +    description: The hard wired USB devices
> > +    type: object
> > +    $ref: /schemas/usb/usb-device.yaml
> > +    additionalProperties: true
> > +
> > +required:
> > +  - compatible
> > +  - reg
>
> Can 'reg' be dropped because usb-device.yaml requires it?

As I replied in patch 3/4, I see other schemas still re-define them as
required. I can send a new version to drop this if no one comes out
and say this is actually a convention.

Regards,
Pin-yen

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

* Re: [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  2025-04-29  4:57     ` Pin-yen Lin
@ 2025-04-29 18:24       ` Stephen Boyd
  2025-04-30 13:17         ` Pin-yen Lin
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Boyd @ 2025-04-29 18:24 UTC (permalink / raw)
  To: Pin-yen Lin
  Cc: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Rob Herring, devicetree, linux-kernel,
	linux-usb

Quoting Pin-yen Lin (2025-04-28 21:57:16)
> Hi Stephen,
>
> On Tue, Apr 29, 2025 at 7:46 AM Stephen Boyd <swboyd@chromium.org> wrote:
> >
> > Quoting Pin-yen Lin (2025-04-22 01:28:29)
> > > diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > index 6577a61cc07531..a020afaf2d6e7a 100644
> > > --- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > @@ -10,7 +10,7 @@ maintainers:
> > >    - Matthias Kaehlcke <mka@chromium.org>
> > >
> > >  allOf:
> > > -  - $ref: usb-device.yaml#
> > > +  - $ref: usb-hub.yaml#
> > >
> > >  properties:
> > >    compatible:
> > > @@ -19,61 +19,35 @@ properties:
> > [...]
> > >
> > > -      port@4:
> > > -        $ref: /schemas/graph.yaml#/properties/port
> > > -        description:
> > > -          4th downstream facing USB port
> > > -
> > > -patternProperties:
> > > -  '^.*@[1-4]$':
> > > -    description: The hard wired USB devices
> > > -    type: object
> > > -    $ref: /schemas/usb/usb-device.yaml
> > > -    additionalProperties: true
> > > +additionalProperties:
> > > +  properties:
> > > +    reg:
> > > +      minimum: 1
> > > +      maximum: 4
> >
> > Is this limiting the 'reg' property of the hub node and not the child
> > usb-device nodes?
>
> Yes, but the regex pattern of patternProperties restricts the
> downstream device nodes to '^.*@[1-4]$'. So the 'reg's of the child
> usb-device nodes are also checked.

I'm confused. The path looks like it is removing patternProperties here
and limiting the reg property of the hub itself so it can only be at
port 1, 2, 3 or 4. Why is the patternProperties being removed? Don't we
need to keep the patternProperties around, or somehow get at the
patternProperties for the hard wired USB devices in the usb-hub schema
so we can constrain the reg property to be between 1 and 4?

> >
> > >
> > >  required:
> > >    - peer-hub
> > >    - compatible
> > >    - reg
> >
> > Can 'reg' be dropped because usb-hub.yaml requires it?
>
> I can drop 'reg' and 'compatible' in the next version, but I see other
> schemas referencing usb-device.yaml still set 'reg' as required. Is
> this some kind of convention, or people just didn't notice this?

I assume nobody noticed.

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

* Re: [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
  2025-04-29 18:24       ` Stephen Boyd
@ 2025-04-30 13:17         ` Pin-yen Lin
  0 siblings, 0 replies; 15+ messages in thread
From: Pin-yen Lin @ 2025-04-30 13:17 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Conor Dooley, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Matthias Kaehlcke, Rob Herring, devicetree, linux-kernel,
	linux-usb

On Wed, Apr 30, 2025 at 2:24 AM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Pin-yen Lin (2025-04-28 21:57:16)
> > Hi Stephen,
> >
> > On Tue, Apr 29, 2025 at 7:46 AM Stephen Boyd <swboyd@chromium.org> wrote:
> > >
> > > Quoting Pin-yen Lin (2025-04-22 01:28:29)
> > > > diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > > index 6577a61cc07531..a020afaf2d6e7a 100644
> > > > --- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > > +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > > @@ -10,7 +10,7 @@ maintainers:
> > > >    - Matthias Kaehlcke <mka@chromium.org>
> > > >
> > > >  allOf:
> > > > -  - $ref: usb-device.yaml#
> > > > +  - $ref: usb-hub.yaml#
> > > >
> > > >  properties:
> > > >    compatible:
> > > > @@ -19,61 +19,35 @@ properties:
> > > [...]
> > > >
> > > > -      port@4:
> > > > -        $ref: /schemas/graph.yaml#/properties/port
> > > > -        description:
> > > > -          4th downstream facing USB port
> > > > -
> > > > -patternProperties:
> > > > -  '^.*@[1-4]$':
> > > > -    description: The hard wired USB devices
> > > > -    type: object
> > > > -    $ref: /schemas/usb/usb-device.yaml
> > > > -    additionalProperties: true
> > > > +additionalProperties:
> > > > +  properties:
> > > > +    reg:
> > > > +      minimum: 1
> > > > +      maximum: 4
> > >
> > > Is this limiting the 'reg' property of the hub node and not the child
> > > usb-device nodes?
> >
> > Yes, but the regex pattern of patternProperties restricts the
> > downstream device nodes to '^.*@[1-4]$'. So the 'reg's of the child
> > usb-device nodes are also checked.
>
> I'm confused. The path looks like it is removing patternProperties here
> and limiting the reg property of the hub itself so it can only be at
> port 1, 2, 3 or 4. Why is the patternProperties being removed? Don't we
> need to keep the patternProperties around, or somehow get at the
> patternProperties for the hard wired USB devices in the usb-hub schema
> so we can constrain the reg property to be between 1 and 4?

Sorry, I was confused by my own patch... Yes, the patternProperties is
removed in this patch so please ignore my previous mail.

However, it seems that the addtionalProperties here checks all the
properties that are not defined in this yaml file. I tried changing
the node in the example DT to device@5/reg=<5>, and make
dt_binding_check rejects the node as expected.
>
> > >
> > > >
> > > >  required:
> > > >    - peer-hub
> > > >    - compatible
> > > >    - reg
> > >
> > > Can 'reg' be dropped because usb-hub.yaml requires it?
> >
> > I can drop 'reg' and 'compatible' in the next version, but I see other
> > schemas referencing usb-device.yaml still set 'reg' as required. Is
> > this some kind of convention, or people just didn't notice this?
>
> I assume nobody noticed.

Okay, then I'll update this in the next version.

Pin-yen

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

end of thread, other threads:[~2025-04-30 13:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-22  8:28 [PATCH v3 0/4] Introduce usb-hub.yaml binding and add support for Parade PS5511 Pin-yen Lin
2025-04-22  8:28 ` [PATCH v3 1/4] dt-bindings: usb: Introduce usb-hub.yaml Pin-yen Lin
2025-04-25 20:04   ` Rob Herring (Arm)
2025-04-28 23:47   ` Stephen Boyd
2025-04-29  4:58     ` Pin-yen Lin
2025-04-22  8:28 ` [PATCH v3 2/4] dt-bindings: usb: Add binding for PS5511 hub controller Pin-yen Lin
2025-04-25 20:05   ` Rob Herring (Arm)
2025-04-22  8:28 ` [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml Pin-yen Lin
2025-04-25 20:05   ` Rob Herring (Arm)
2025-04-28 23:45   ` Stephen Boyd
2025-04-29  4:57     ` Pin-yen Lin
2025-04-29 18:24       ` Stephen Boyd
2025-04-30 13:17         ` Pin-yen Lin
2025-04-22  8:28 ` [PATCH v3 4/4] usb: misc: onboard_usb_dev: Add Parade PS5511 hub support Pin-yen Lin
2025-04-28 23:36   ` Stephen Boyd

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).