Message ID | 1621408490-23811-2-git-send-email-jun.li@nxp.com |
---|---|
State | New |
Headers | show |
Series | typec switch via mux controller | expand |
On Wed, May 19, 2021 at 03:14:47PM +0800, Li Jun wrote: > Typec orientation switch can be implementaed as a consumer of mux > controller, with this way, mux-control-name must be provided with > name "typec-orientation-switch", along with its 3 states value array > for none(high impedance), cc1, cc2. > > Signed-off-by: Li Jun <jun.li@nxp.com> > --- > .../bindings/connector/usb-connector.yaml | 21 +++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml > index 32509b98142e..567183e199a3 100644 > --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml > +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml > @@ -111,6 +111,24 @@ properties: > - 1.5A > - 3.0A > > + mux-controls: > + description: > + mux controller node to use for orientation switch selection. > + maxItems: 1 > + > + mux-control-name: > + items: > + - const: typec-orientation-switch Don't really need a name with only 1 entry. > + > + mux-control-switch-states: Not really part of the 'mux-control' binding, but part of the connector. So 'typec-orientation-switch-states' or something. > + description: | > + An ordered u32 array describing the mux state value for each typec > + orientations: NONE(high impedance), CC1, CC2, if there is no HW mux > + state for NONE, use value of CC1 or CC2 for it, > + minItems: 3 > + maxItems: 3 > + $ref: /schemas/types.yaml#/definitions/uint32-array > + > # The following are optional properties for "usb-c-connector" with power > # delivery support. > source-pdos: > @@ -301,6 +319,9 @@ examples: > sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) > PDO_VAR(5000, 12000, 2000)>; > op-sink-microwatt = <10000000>; > + mux-controls = <&mux>; > + mux-control-names = "typec-orientation-switch"; > + mux-control-switch-states = <2>, <0>, <1>; > }; > }; > > -- > 2.25.1 >
Hi > -----Original Message----- > From: Rob Herring <robh@kernel.org> > Sent: Friday, May 21, 2021 9:31 AM > To: Jun Li <jun.li@nxp.com> > Cc: heikki.krogerus@linux.intel.com; shawnguo@kernel.org; > gregkh@linuxfoundation.org; linux@roeck-us.net; > linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org > Subject: Re: [PATCH 1/4] dt-bindings: connector: Add typec orientation > switch properties > > On Wed, May 19, 2021 at 03:14:47PM +0800, Li Jun wrote: > > Typec orientation switch can be implementaed as a consumer of mux > > controller, with this way, mux-control-name must be provided with name > > "typec-orientation-switch", along with its 3 states value array for > > none(high impedance), cc1, cc2. > > > > Signed-off-by: Li Jun <jun.li@nxp.com> > > --- > > .../bindings/connector/usb-connector.yaml | 21 +++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git > > a/Documentation/devicetree/bindings/connector/usb-connector.yaml > > b/Documentation/devicetree/bindings/connector/usb-connector.yaml > > index 32509b98142e..567183e199a3 100644 > > --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml > > +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml > > @@ -111,6 +111,24 @@ properties: > > - 1.5A > > - 3.0A > > > > + mux-controls: > > + description: > > + mux controller node to use for orientation switch selection. > > + maxItems: 1 > > + > > + mux-control-name: > > + items: > > + - const: typec-orientation-switch > > Don't really need a name with only 1 entry. Okay, will remove it. > > > + > > + mux-control-switch-states: > > Not really part of the 'mux-control' binding, but part of the connector. Yes, agree. > So 'typec-orientation-switch-states' or something. will use typec-orientation-switch-states. Thanks Li Jun > > > + description: | > > + An ordered u32 array describing the mux state value for each typec > > + orientations: NONE(high impedance), CC1, CC2, if there is no HW mux > > + state for NONE, use value of CC1 or CC2 for it, > > + minItems: 3 > > + maxItems: 3 > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + > > # The following are optional properties for "usb-c-connector" with power > > # delivery support. > > source-pdos: > > @@ -301,6 +319,9 @@ examples: > > sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) > > PDO_VAR(5000, 12000, 2000)>; > > op-sink-microwatt = <10000000>; > > + mux-controls = <&mux>; > > + mux-control-names = "typec-orientation-switch"; > > + mux-control-switch-states = <2>, <0>, <1>; > > }; > > }; > > > > -- > > 2.25.1 > >
diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml index 32509b98142e..567183e199a3 100644 --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml @@ -111,6 +111,24 @@ properties: - 1.5A - 3.0A + mux-controls: + description: + mux controller node to use for orientation switch selection. + maxItems: 1 + + mux-control-name: + items: + - const: typec-orientation-switch + + mux-control-switch-states: + description: | + An ordered u32 array describing the mux state value for each typec + orientations: NONE(high impedance), CC1, CC2, if there is no HW mux + state for NONE, use value of CC1 or CC2 for it, + minItems: 3 + maxItems: 3 + $ref: /schemas/types.yaml#/definitions/uint32-array + # The following are optional properties for "usb-c-connector" with power # delivery support. source-pdos: @@ -301,6 +319,9 @@ examples: sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) PDO_VAR(5000, 12000, 2000)>; op-sink-microwatt = <10000000>; + mux-controls = <&mux>; + mux-control-names = "typec-orientation-switch"; + mux-control-switch-states = <2>, <0>, <1>; }; };
Typec orientation switch can be implementaed as a consumer of mux controller, with this way, mux-control-name must be provided with name "typec-orientation-switch", along with its 3 states value array for none(high impedance), cc1, cc2. Signed-off-by: Li Jun <jun.li@nxp.com> --- .../bindings/connector/usb-connector.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)