[PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX

AngeloGioacchino Del Regno posted 2 patches 8 months ago
There is a newer version of this series
[PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX
Posted by AngeloGioacchino Del Regno 8 months ago
Introduce a binding for the ITE IT5205 Alternate Mode Passive MUX,
used for connecting, disconnecting and switching orientation and
control the SBU signals for alternate modes on USB Type-C ports.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../devicetree/bindings/usb/ite,it5205.yaml   | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ite,it5205.yaml

diff --git a/Documentation/devicetree/bindings/usb/ite,it5205.yaml b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
new file mode 100644
index 000000000000..36ec4251b5f2
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ite,it5205.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ITE IT5202 Type-C USB Alternate Mode Passive MUX
+
+maintainers:
+  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+  - Tianping Fang <tianping.fang@mediatek.com>
+
+properties:
+  compatible:
+    const: ite,it5205
+
+  reg:
+    maxItems: 1
+
+  vcc-supply:
+    description: Power supply for VCC pin (3.3V)
+
+  mode-switch:
+    description: Flag the port as possible handle of altmode switching
+    type: boolean
+
+  orientation-switch:
+    description: Flag the port as possible handler of orientation switching
+    type: boolean
+
+  ite,ovp-enable:
+    description: Enable Over Voltage Protection functionality
+    type: boolean
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      A port node to link the IT5205 to a TypeC controller for the purpose of
+      handling altmode muxing and orientation switching.
+
+required:
+  - compatible
+  - reg
+  - orientation-switch
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c2 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        typec-mux@48 {
+          compatible = "ite,it5205";
+          reg = <0x48>;
+
+          mode-switch;
+          orientation-switch;
+
+          vcc-supply = <&mt6359_vibr_ldo_reg>;
+
+          port {
+            it5205_usbss_sbu: endpoint {
+              remote-endpoint = <&typec_controller>;
+            };
+          };
+        };
+    };
+...
-- 
2.43.0
Re: [PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX
Posted by Krzysztof Kozlowski 8 months ago
On 19/01/2024 13:58, AngeloGioacchino Del Regno wrote:
> Introduce a binding for the ITE IT5205 Alternate Mode Passive MUX,
> used for connecting, disconnecting and switching orientation and
> control the SBU signals for alternate modes on USB Type-C ports.
> 

...

> +  mode-switch:
> +    description: Flag the port as possible handle of altmode switching
> +    type: boolean
> +
> +  orientation-switch:
> +    description: Flag the port as possible handler of orientation switching
> +    type: boolean

Just FYI, I will be sending v2 of:
https://lore.kernel.org/all/20240115092923.105275-1-krzysztof.kozlowski@linaro.org/

which could be used here. If your patch gets first, I will adjust mine.

...

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c2 {

i2c {



Best regards,
Krzysztof
Re: [PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX
Posted by Conor Dooley 8 months ago
On Fri, Jan 19, 2024 at 01:58:11PM +0100, AngeloGioacchino Del Regno wrote:
> Introduce a binding for the ITE IT5205 Alternate Mode Passive MUX,
> used for connecting, disconnecting and switching orientation and
> control the SBU signals for alternate modes on USB Type-C ports.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../devicetree/bindings/usb/ite,it5205.yaml   | 72 +++++++++++++++++++
>  1 file changed, 72 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/ite,it5205.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/ite,it5205.yaml b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
> new file mode 100644
> index 000000000000..36ec4251b5f2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/ite,it5205.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ITE IT5202 Type-C USB Alternate Mode Passive MUX
> +
> +maintainers:
> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> +  - Tianping Fang <tianping.fang@mediatek.com>
> +
> +properties:
> +  compatible:
> +    const: ite,it5205
> +
> +  reg:
> +    maxItems: 1
> +
> +  vcc-supply:
> +    description: Power supply for VCC pin (3.3V)
> +
> +  mode-switch:
> +    description: Flag the port as possible handle of altmode switching
> +    type: boolean
> +
> +  orientation-switch:
> +    description: Flag the port as possible handler of orientation switching
> +    type: boolean
> +
> +  ite,ovp-enable:
> +    description: Enable Over Voltage Protection functionality
> +    type: boolean

Bitta devil's advocacy perhaps, but why is this DT property? Is it not
known whether or not this is supported based on the compatible, and
whether or not to enable it is a decision for the operating system to
make?
Re: [PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX
Posted by AngeloGioacchino Del Regno 8 months ago
Il 19/01/24 17:18, Conor Dooley ha scritto:
> On Fri, Jan 19, 2024 at 01:58:11PM +0100, AngeloGioacchino Del Regno wrote:
>> Introduce a binding for the ITE IT5205 Alternate Mode Passive MUX,
>> used for connecting, disconnecting and switching orientation and
>> control the SBU signals for alternate modes on USB Type-C ports.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   .../devicetree/bindings/usb/ite,it5205.yaml   | 72 +++++++++++++++++++
>>   1 file changed, 72 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/usb/ite,it5205.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/usb/ite,it5205.yaml b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
>> new file mode 100644
>> index 000000000000..36ec4251b5f2
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
>> @@ -0,0 +1,72 @@
>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/usb/ite,it5205.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: ITE IT5202 Type-C USB Alternate Mode Passive MUX
>> +
>> +maintainers:
>> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> +  - Tianping Fang <tianping.fang@mediatek.com>
>> +
>> +properties:
>> +  compatible:
>> +    const: ite,it5205
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  vcc-supply:
>> +    description: Power supply for VCC pin (3.3V)
>> +
>> +  mode-switch:
>> +    description: Flag the port as possible handle of altmode switching
>> +    type: boolean
>> +
>> +  orientation-switch:
>> +    description: Flag the port as possible handler of orientation switching
>> +    type: boolean
>> +
>> +  ite,ovp-enable:
>> +    description: Enable Over Voltage Protection functionality
>> +    type: boolean
> 
> Bitta devil's advocacy perhaps, but why is this DT property? Is it not
> known whether or not this is supported based on the compatible, and
> whether or not to enable it is a decision for the operating system to
> make?
> 
> 

AFAIK, not all board designs can use the OVP. On some, this may be unstable - the
use case where this can be safely enabled is when there's nothing in between the
mux and the controller, and between the mux and the port.

Cheers,
Angelo
Re: [PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX
Posted by Conor Dooley 8 months ago
On Mon, Jan 22, 2024 at 11:27:11AM +0100, AngeloGioacchino Del Regno wrote:
> Il 19/01/24 17:18, Conor Dooley ha scritto:
> > On Fri, Jan 19, 2024 at 01:58:11PM +0100, AngeloGioacchino Del Regno wrote:
> > > Introduce a binding for the ITE IT5205 Alternate Mode Passive MUX,
> > > used for connecting, disconnecting and switching orientation and
> > > control the SBU signals for alternate modes on USB Type-C ports.
> > > 
> > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > > ---
> > >   .../devicetree/bindings/usb/ite,it5205.yaml   | 72 +++++++++++++++++++
> > >   1 file changed, 72 insertions(+)
> > >   create mode 100644 Documentation/devicetree/bindings/usb/ite,it5205.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/usb/ite,it5205.yaml b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
> > > new file mode 100644
> > > index 000000000000..36ec4251b5f2
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
> > > @@ -0,0 +1,72 @@
> > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/usb/ite,it5205.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: ITE IT5202 Type-C USB Alternate Mode Passive MUX
> > > +
> > > +maintainers:
> > > +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > > +  - Tianping Fang <tianping.fang@mediatek.com>
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: ite,it5205
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  vcc-supply:
> > > +    description: Power supply for VCC pin (3.3V)
> > > +
> > > +  mode-switch:
> > > +    description: Flag the port as possible handle of altmode switching
> > > +    type: boolean
> > > +
> > > +  orientation-switch:
> > > +    description: Flag the port as possible handler of orientation switching
> > > +    type: boolean
> > > +
> > > +  ite,ovp-enable:
> > > +    description: Enable Over Voltage Protection functionality
> > > +    type: boolean
> > 
> > Bitta devil's advocacy perhaps, but why is this DT property? Is it not
> > known whether or not this is supported based on the compatible, and
> > whether or not to enable it is a decision for the operating system to
> > make?
> > 
> > 
> 
> AFAIK, not all board designs can use the OVP. On some, this may be unstable - the
> use case where this can be safely enabled is when there's nothing in between the
> mux and the controller, and between the mux and the port.

Okay, if it varies based on the configuration that makes sense. Perhaps
in the future consider mentioning stuff like that in the commit message.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.
Re: [PATCH v2 1/2] dt-bindings: usb: Introduce ITE IT5205 Alt. Mode Passive MUX
Posted by AngeloGioacchino Del Regno 8 months ago
Il 22/01/24 19:06, Conor Dooley ha scritto:
> On Mon, Jan 22, 2024 at 11:27:11AM +0100, AngeloGioacchino Del Regno wrote:
>> Il 19/01/24 17:18, Conor Dooley ha scritto:
>>> On Fri, Jan 19, 2024 at 01:58:11PM +0100, AngeloGioacchino Del Regno wrote:
>>>> Introduce a binding for the ITE IT5205 Alternate Mode Passive MUX,
>>>> used for connecting, disconnecting and switching orientation and
>>>> control the SBU signals for alternate modes on USB Type-C ports.
>>>>
>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> ---
>>>>    .../devicetree/bindings/usb/ite,it5205.yaml   | 72 +++++++++++++++++++
>>>>    1 file changed, 72 insertions(+)
>>>>    create mode 100644 Documentation/devicetree/bindings/usb/ite,it5205.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/usb/ite,it5205.yaml b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
>>>> new file mode 100644
>>>> index 000000000000..36ec4251b5f2
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/usb/ite,it5205.yaml
>>>> @@ -0,0 +1,72 @@
>>>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/usb/ite,it5205.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: ITE IT5202 Type-C USB Alternate Mode Passive MUX
>>>> +
>>>> +maintainers:
>>>> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> +  - Tianping Fang <tianping.fang@mediatek.com>
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    const: ite,it5205
>>>> +
>>>> +  reg:
>>>> +    maxItems: 1
>>>> +
>>>> +  vcc-supply:
>>>> +    description: Power supply for VCC pin (3.3V)
>>>> +
>>>> +  mode-switch:
>>>> +    description: Flag the port as possible handle of altmode switching
>>>> +    type: boolean
>>>> +
>>>> +  orientation-switch:
>>>> +    description: Flag the port as possible handler of orientation switching
>>>> +    type: boolean
>>>> +
>>>> +  ite,ovp-enable:
>>>> +    description: Enable Over Voltage Protection functionality
>>>> +    type: boolean
>>>
>>> Bitta devil's advocacy perhaps, but why is this DT property? Is it not
>>> known whether or not this is supported based on the compatible, and
>>> whether or not to enable it is a decision for the operating system to
>>> make?
>>>
>>>
>>
>> AFAIK, not all board designs can use the OVP. On some, this may be unstable - the
>> use case where this can be safely enabled is when there's nothing in between the
>> mux and the controller, and between the mux and the port.
> 
> Okay, if it varies based on the configuration that makes sense. Perhaps
> in the future consider mentioning stuff like that in the commit message.
> 
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> 

You're right, it's totally sensible to write that in the commit message,
will do next time.

P.S.: I have been too much impatient and already sent a v3 because I had to
fix an issue with the code, could you please give your R-b to the v3 as well?
There's no change in the bindings commit.

https://lore.kernel.org/r/20240122110446.140226-2-angelogioacchino.delregno@collabora.com

Thanks again,
Angelo