diff mbox series

[v2,1/4] dt-bindings: connector: Add typec orientation switch properties

Message ID 20220823195429.1243516-2-xu.yang_2@nxp.com (mailing list archive)
State New, archived
Headers show
Series typec orientation switch support via mux controller | expand

Commit Message

Xu Yang Aug. 23, 2022, 7:54 p.m. UTC
Typec orientation switch can be implemented as a consumer of mux
controller. So we can use mux controller to control simple gpio switch
or other types of switch. This will cover the following typec switch
use case: High Speed, Super Speed and Sideband switch.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
Changes since v1:
- No changes.

 .../bindings/connector/usb-connector.yaml      | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Rob Herring (Arm) Aug. 30, 2022, 6:19 p.m. UTC | #1
On Wed, Aug 24, 2022 at 03:54:26AM +0800, Xu Yang wrote:
> Typec orientation switch can be implemented as a consumer of mux
> controller. So we can use mux controller to control simple gpio switch
> or other types of switch. This will cover the following typec switch
> use case: High Speed, Super Speed and Sideband switch.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Please see and participate in the recent discussions around USB-C 
connectors:

https://lore.kernel.org/all/20220810204750.3672362-2-bjorn.andersson@linaro.org/
https://lore.kernel.org/all/20220622173605.1168416-1-pmalani@chromium.org/

As mentioned there, I want to see block diagrams of the h/w for these 
bindings.

The mux binding may be a good solution here, but different muxing 
scenarios need to be considered.


> ---
> Changes since v1:
> - No changes.
> 
>  .../bindings/connector/usb-connector.yaml      | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml
> index ae515651fc6b..47f53cdbf31a 100644
> --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml
> +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml
> @@ -221,6 +221,24 @@ properties:
>        SNK_READY for non-pd link.
>      type: boolean
>  
> +  # The following are optional properties for "usb-c-connector".
> +  mux-controls:
> +    description: Mux controller node to use for orientation switch selection. This mux controller
> +      could handle High Speed, Super Speed and Sideband switch use case one time. In orde to do so,
> +      besides mux settings need to be properly configured for each switch under mux-controller node,
> +      correct states should also be assigned to typec-switch-states parameter.

Wrap lines at 80 char.

> +    maxItems: 1
> +
> +  typec-switch-states:
> +    description: An ordered u32 array describing the mux state value for each typec orientations.
> +      Three states correspond to NONE(high impedance), NORMAL, REVERSE respectively. If there is
> +      no HW mux state for NONE, use value of NORMAL or REVERSE for it. If this mux controller
> +      handle more than 1 switch, correct states value need to be caculated according to the mux
> +      settings.
> +    minItems: 3
> +    maxItems: 3
> +    $ref: /schemas/types.yaml#/definitions/uint32-array

I think that 'mux-states' is what you want to use here.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml
index ae515651fc6b..47f53cdbf31a 100644
--- a/Documentation/devicetree/bindings/connector/usb-connector.yaml
+++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml
@@ -221,6 +221,24 @@  properties:
       SNK_READY for non-pd link.
     type: boolean
 
+  # The following are optional properties for "usb-c-connector".
+  mux-controls:
+    description: Mux controller node to use for orientation switch selection. This mux controller
+      could handle High Speed, Super Speed and Sideband switch use case one time. In orde to do so,
+      besides mux settings need to be properly configured for each switch under mux-controller node,
+      correct states should also be assigned to typec-switch-states parameter.
+    maxItems: 1
+
+  typec-switch-states:
+    description: An ordered u32 array describing the mux state value for each typec orientations.
+      Three states correspond to NONE(high impedance), NORMAL, REVERSE respectively. If there is
+      no HW mux state for NONE, use value of NORMAL or REVERSE for it. If this mux controller
+      handle more than 1 switch, correct states value need to be caculated according to the mux
+      settings.
+    minItems: 3
+    maxItems: 3
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+
 dependencies:
   sink-vdos-v1: [ 'sink-vdos' ]
   sink-vdos: [ 'sink-vdos-v1' ]