[PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties

André Draszik posted 9 patches 1 year, 2 months ago
There is a newer version of this series
[PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties
Posted by André Draszik 1 year, 2 months ago
The USB PHY on gs101 needs to be configured based on the orientation of
the connector. For that the DTS needs a link between the phy's port and
a TCPCi, and we'll need to inform the phy driver that it should handle
the orientation (register a handler).

Update the schema to enforce that by requiring the orientation-switch
and port properties (on gs101 only).

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
index 6c17a44718aa..0659fc1ce13e 100644
--- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
@@ -142,6 +142,8 @@ allOf:
 
       required:
         - reg-names
+        - orientation-switch
+        - port
         - pll-supply
         - dvdd-usb20-supply
         - vddh-usb20-supply

-- 
2.47.0.338.g60cca15819-goog

Re: [PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties
Posted by Peter Griffin 1 year, 2 months ago
Hi André,

On Wed, 27 Nov 2024 at 10:58, André Draszik <andre.draszik@linaro.org> wrote:
>
> The USB PHY on gs101 needs to be configured based on the orientation of
> the connector. For that the DTS needs a link between the phy's port and
> a TCPCi, and we'll need to inform the phy driver that it should handle
> the orientation (register a handler).
>
> Update the schema to enforce that by requiring the orientation-switch
> and port properties (on gs101 only).
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>

regards,

Peter
Re: [PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties
Posted by Conor Dooley 1 year, 2 months ago
On Wed, Nov 27, 2024 at 10:58:13AM +0000, André Draszik wrote:
> The USB PHY on gs101 needs to be configured based on the orientation of
> the connector. For that the DTS needs a link between the phy's port and
> a TCPCi, and we'll need to inform the phy driver that it should handle
> the orientation (register a handler).
> 
> Update the schema to enforce that by requiring the orientation-switch
> and port properties (on gs101 only).
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>

What is your driver doing if these are not provided? New required
properties are an ABI break after all and I don't see a mention of how
you're handling it here.

> ---
>  Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
> index 6c17a44718aa..0659fc1ce13e 100644
> --- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml
> @@ -142,6 +142,8 @@ allOf:
>  
>        required:
>          - reg-names
> +        - orientation-switch
> +        - port
>          - pll-supply
>          - dvdd-usb20-supply
>          - vddh-usb20-supply
> 
> -- 
> 2.47.0.338.g60cca15819-goog
> 
Re: [PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties
Posted by André Draszik 1 year, 2 months ago
Hi Conor,

On Wed, 2024-11-27 at 16:00 +0000, Conor Dooley wrote:
> On Wed, Nov 27, 2024 at 10:58:13AM +0000, André Draszik wrote:
> > The USB PHY on gs101 needs to be configured based on the orientation of
> > the connector. For that the DTS needs a link between the phy's port and
> > a TCPCi, and we'll need to inform the phy driver that it should handle
> > the orientation (register a handler).
> > 
> > Update the schema to enforce that by requiring the orientation-switch
> > and port properties (on gs101 only).
> > 
> > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> 
> What is your driver doing if these are not provided? New required
> properties are an ABI break after all and I don't see a mention of how
> you're handling it here.

This is hooked-in in patch 8 of this series in
exynos5_usbdrd_setup_notifiers(). The new behaviour is gated off

    if (device_property_present(phy_drd->dev, "orientation-switch")) {
        ...

Without that property (i.e. old DTS or !gs101), the driver will behave as
before (meaning for gs101 it will work in SS mode in one orientation only).

Does that address your concern?

Cheers,
Andre'
Re: [PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties
Posted by Conor Dooley 1 year, 2 months ago
On Wed, Nov 27, 2024 at 04:24:08PM +0000, André Draszik wrote:
> Hi Conor,
> 
> On Wed, 2024-11-27 at 16:00 +0000, Conor Dooley wrote:
> > On Wed, Nov 27, 2024 at 10:58:13AM +0000, André Draszik wrote:
> > > The USB PHY on gs101 needs to be configured based on the orientation of
> > > the connector. For that the DTS needs a link between the phy's port and
> > > a TCPCi, and we'll need to inform the phy driver that it should handle
> > > the orientation (register a handler).
> > > 
> > > Update the schema to enforce that by requiring the orientation-switch
> > > and port properties (on gs101 only).
> > > 
> > > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > 
> > What is your driver doing if these are not provided? New required
> > properties are an ABI break after all and I don't see a mention of how
> > you're handling it here.
> 
> This is hooked-in in patch 8 of this series in
> exynos5_usbdrd_setup_notifiers(). The new behaviour is gated off
> 
>     if (device_property_present(phy_drd->dev, "orientation-switch")) {
>         ...
> 
> Without that property (i.e. old DTS or !gs101), the driver will behave as
> before (meaning for gs101 it will work in SS mode in one orientation only).
> 
> Does that address your concern?

Aye, but it'd be good to call that out in your commit message.