diff mbox series

[1/3] dt-bindings: extcon: ptn5150: Describe the USB connector

Message ID 20231212112729.700987-1-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] dt-bindings: extcon: ptn5150: Describe the USB connector | expand

Commit Message

Fabio Estevam Dec. 12, 2023, 11:27 a.m. UTC
From: Fabio Estevam <festevam@denx.de>

PTN5150 supports USB Type-C connector, so improve the bindings by
allowing to describe the connector like it is done on nxp,ptn5110.yaml.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Conor Dooley Dec. 12, 2023, 5:33 p.m. UTC | #1
On Tue, Dec 12, 2023 at 08:27:27AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> PTN5150 supports USB Type-C connector, so improve the bindings by
> allowing to describe the connector like it is done on nxp,ptn5110.yaml.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>  Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
> index d5cfa32ea52d..3837da7416e9 100644
> --- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
> +++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
> @@ -37,6 +37,11 @@ properties:
>        GPIO pin (output) used to control VBUS. If skipped, no such control
>        takes place.
>  
> +  connector:
> +    type: object
> +    $ref: /schemas/connector/usb-connector.yaml#
> +    unevaluatedProperties: false

FWIW, neither the type nor the uneval properties should be needed here,
the referenced schema has additionalProperties: False.

Otherwise,
Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> +
>  required:
>    - compatible
>    - interrupts
> -- 
> 2.34.1
>
Marek Vasut Jan. 13, 2024, 10:06 p.m. UTC | #2
On 12/12/23 12:27, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> PTN5150 supports USB Type-C connector, so improve the bindings by
> allowing to describe the connector like it is done on nxp,ptn5110.yaml.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>   Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
> index d5cfa32ea52d..3837da7416e9 100644
> --- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
> +++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
> @@ -37,6 +37,11 @@ properties:
>         GPIO pin (output) used to control VBUS. If skipped, no such control
>         takes place.
>   
> +  connector:
> +    type: object
> +    $ref: /schemas/connector/usb-connector.yaml#
> +    unevaluatedProperties: false
> +

If I read drivers/usb/roles/class.c usb_role_switch_get() implementation 
right, that function is doing an OF graph look up and expects a port {} 
subnode for that purpose. The drivers/extcon/extcon-ptn5150.c 
ptn5150_i2c_probe() calls usb_role_switch_get(), so I would expect the 
ptn5150 DT node should contain a port {} subnode, not a connector subnode.

I think that's what should be done here -- update this PTN5150 binding 
document and describe the port {} subnode. The two DT patches are not 
needed and are in fact wrong ; at least the PDK3 one breaks PDK3 USB-C 
operation as the usb_role_switch_get() look up fails in the PTN5150 
driver with that DT patch applied.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
index d5cfa32ea52d..3837da7416e9 100644
--- a/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
+++ b/Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
@@ -37,6 +37,11 @@  properties:
       GPIO pin (output) used to control VBUS. If skipped, no such control
       takes place.
 
+  connector:
+    type: object
+    $ref: /schemas/connector/usb-connector.yaml#
+    unevaluatedProperties: false
+
 required:
   - compatible
   - interrupts