2023-08-04 15:02:14

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation

On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a
GPIO line set by the PMIC.

Document this optional Type-C connector property, and take the
assumption an active level represents an inverted/flipped orientation.

Signed-off-by: Neil Armstrong <[email protected]>
---
.../devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
index bceb479f74c5..1b0a00b19a54 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
@@ -35,6 +35,11 @@ properties:
'#size-cells':
const: 0

+ orientation-gpios:
+ description: An input gpio for Type-C connector orientation, used to detect orientation
+ of the Type-C connector. GPIO active level means "CC2" or Reversed/Flipped orientation.
+ maxItems: 1
+
patternProperties:
'^connector@\d$':
$ref: /schemas/connector/usb-connector.yaml#
@@ -44,6 +49,19 @@ patternProperties:
required:
- compatible

+allOf:
+ - if:
+ not:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,sm8450-pmic-glink
+ - qcom,sm8550-pmic-glink
+ then:
+ properties:
+ orientation-gpios: false
+
additionalProperties: false

examples:

--
2.34.1



2023-08-04 16:38:21

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation

On Fri, Aug 04, 2023 at 03:50:07PM +0200, Neil Armstrong wrote:
> On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a
> GPIO line set by the PMIC.
>
> Document this optional Type-C connector property, and take the
> assumption an active level represents an inverted/flipped orientation.
>
> Signed-off-by: Neil Armstrong <[email protected]>
> ---
> .../devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
> index bceb479f74c5..1b0a00b19a54 100644
> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
> @@ -35,6 +35,11 @@ properties:
> '#size-cells':
> const: 0
>
> + orientation-gpios:
> + description: An input gpio for Type-C connector orientation, used to detect orientation
> + of the Type-C connector. GPIO active level means "CC2" or Reversed/Flipped orientation.

This is a per-connector/port property, as such be part of the connector
sub nodes rather than as a property of the shared pmic_glink entity.

Regards,
Bjorn

> + maxItems: 1
> +
> patternProperties:
> '^connector@\d$':
> $ref: /schemas/connector/usb-connector.yaml#
> @@ -44,6 +49,19 @@ patternProperties:
> required:
> - compatible
>
> +allOf:
> + - if:
> + not:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - qcom,sm8450-pmic-glink
> + - qcom,sm8550-pmic-glink
> + then:
> + properties:
> + orientation-gpios: false
> +
> additionalProperties: false
>
> examples:
>
> --
> 2.34.1
>

2023-08-14 09:36:41

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation

On 04/08/2023 18:03, Bjorn Andersson wrote:
> On Fri, Aug 04, 2023 at 03:50:07PM +0200, Neil Armstrong wrote:
>> On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a
>> GPIO line set by the PMIC.
>>
>> Document this optional Type-C connector property, and take the
>> assumption an active level represents an inverted/flipped orientation.
>>
>> Signed-off-by: Neil Armstrong <[email protected]>
>> ---
>> .../devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml | 18 ++++++++++++++++++
>> 1 file changed, 18 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
>> index bceb479f74c5..1b0a00b19a54 100644
>> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
>> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
>> @@ -35,6 +35,11 @@ properties:
>> '#size-cells':
>> const: 0
>>
>> + orientation-gpios:
>> + description: An input gpio for Type-C connector orientation, used to detect orientation
>> + of the Type-C connector. GPIO active level means "CC2" or Reversed/Flipped orientation.
>
> This is a per-connector/port property, as such be part of the connector
> sub nodes rather than as a property of the shared pmic_glink entity.

This has been rejected by Rob, Dmitry & Krzysztof in:
https://lore.kernel.org/all/[email protected]/
&
https://lore.kernel.org/all/[email protected]/

Indeed the "GPIO" is not part of the physical USB-C connector, but a property,
and it's not part of the PMIC GLINK firmware either, so ?

The PMIC function which generates this signal is handled by the PMIC GLINK
firmware, so this representation is the most accurate.

Neil

>
> Regards,
> Bjorn
>
>> + maxItems: 1
>> +
>> patternProperties:
>> '^connector@\d$':
>> $ref: /schemas/connector/usb-connector.yaml#
>> @@ -44,6 +49,19 @@ patternProperties:
>> required:
>> - compatible
>>
>> +allOf:
>> + - if:
>> + not:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - qcom,sm8450-pmic-glink
>> + - qcom,sm8550-pmic-glink
>> + then:
>> + properties:
>> + orientation-gpios: false
>> +
>> additionalProperties: false
>>
>> examples:
>>
>> --
>> 2.34.1
>>


2023-09-20 16:52:06

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation

On Mon, Aug 14, 2023 at 10:09:41AM +0200, Neil Armstrong wrote:
> On 04/08/2023 18:03, Bjorn Andersson wrote:
> > On Fri, Aug 04, 2023 at 03:50:07PM +0200, Neil Armstrong wrote:
> > > On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a
> > > GPIO line set by the PMIC.
> > >
> > > Document this optional Type-C connector property, and take the
> > > assumption an active level represents an inverted/flipped orientation.
> > >
> > > Signed-off-by: Neil Armstrong <[email protected]>
> > > ---
> > > .../devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml | 18 ++++++++++++++++++
> > > 1 file changed, 18 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
> > > index bceb479f74c5..1b0a00b19a54 100644
> > > --- a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
> > > +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
> > > @@ -35,6 +35,11 @@ properties:
> > > '#size-cells':
> > > const: 0
> > > + orientation-gpios:
> > > + description: An input gpio for Type-C connector orientation, used to detect orientation
> > > + of the Type-C connector. GPIO active level means "CC2" or Reversed/Flipped orientation.
> >
> > This is a per-connector/port property, as such be part of the connector
> > sub nodes rather than as a property of the shared pmic_glink entity.
>
> This has been rejected by Rob, Dmitry & Krzysztof in:
> https://lore.kernel.org/all/[email protected]/
> &
> https://lore.kernel.org/all/[email protected]/
>
> Indeed the "GPIO" is not part of the physical USB-C connector, but a property,
> and it's not part of the PMIC GLINK firmware either, so ?
>
> The PMIC function which generates this signal is handled by the PMIC GLINK
> firmware, so this representation is the most accurate.
>

I don't think we reached a conclusion on the discussion that followed.
If this indeed is the path forward, please document clearly how the next
person should proceed when the need for handling multiple ports with
this scheme arise.

Thanks,
Bjorn

> Neil
>
> >
> > Regards,
> > Bjorn
> >
> > > + maxItems: 1
> > > +
> > > patternProperties:
> > > '^connector@\d$':
> > > $ref: /schemas/connector/usb-connector.yaml#
> > > @@ -44,6 +49,19 @@ patternProperties:
> > > required:
> > > - compatible
> > > +allOf:
> > > + - if:
> > > + not:
> > > + properties:
> > > + compatible:
> > > + contains:
> > > + enum:
> > > + - qcom,sm8450-pmic-glink
> > > + - qcom,sm8550-pmic-glink
> > > + then:
> > > + properties:
> > > + orientation-gpios: false
> > > +
> > > additionalProperties: false
> > > examples:
> > >
> > > --
> > > 2.34.1
> > >
>

2023-09-20 19:41:09

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation

On 20/09/2023 18:50, Bjorn Andersson wrote:
> On Mon, Aug 14, 2023 at 10:09:41AM +0200, Neil Armstrong wrote:
>> On 04/08/2023 18:03, Bjorn Andersson wrote:
>>> On Fri, Aug 04, 2023 at 03:50:07PM +0200, Neil Armstrong wrote:
>>>> On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a
>>>> GPIO line set by the PMIC.
>>>>
>>>> Document this optional Type-C connector property, and take the
>>>> assumption an active level represents an inverted/flipped orientation.
>>>>
>>>> Signed-off-by: Neil Armstrong <[email protected]>
>>>> ---
>>>> .../devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml | 18 ++++++++++++++++++
>>>> 1 file changed, 18 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
>>>> index bceb479f74c5..1b0a00b19a54 100644
>>>> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
>>>> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml
>>>> @@ -35,6 +35,11 @@ properties:
>>>> '#size-cells':
>>>> const: 0
>>>> + orientation-gpios:
>>>> + description: An input gpio for Type-C connector orientation, used to detect orientation
>>>> + of the Type-C connector. GPIO active level means "CC2" or Reversed/Flipped orientation.
>>>
>>> This is a per-connector/port property, as such be part of the connector
>>> sub nodes rather than as a property of the shared pmic_glink entity.
>>
>> This has been rejected by Rob, Dmitry & Krzysztof in:
>> https://lore.kernel.org/all/[email protected]/
>> &
>> https://lore.kernel.org/all/[email protected]/
>>
>> Indeed the "GPIO" is not part of the physical USB-C connector, but a property,
>> and it's not part of the PMIC GLINK firmware either, so ?
>>
>> The PMIC function which generates this signal is handled by the PMIC GLINK
>> firmware, so this representation is the most accurate.
>>
>
> I don't think we reached a conclusion on the discussion that followed.
> If this indeed is the path forward, please document clearly how the next
> person should proceed when the need for handling multiple ports with
> this scheme arise.

Sure, I'll explicit this is an array of gpios, one for each port, I thought I wrote
it but seems I forgot to add it to the description.

Neil

>
> Thanks,
> Bjorn
>
>> Neil
>>
>>>
>>> Regards,
>>> Bjorn
>>>
>>>> + maxItems: 1
>>>> +
>>>> patternProperties:
>>>> '^connector@\d$':
>>>> $ref: /schemas/connector/usb-connector.yaml#
>>>> @@ -44,6 +49,19 @@ patternProperties:
>>>> required:
>>>> - compatible
>>>> +allOf:
>>>> + - if:
>>>> + not:
>>>> + properties:
>>>> + compatible:
>>>> + contains:
>>>> + enum:
>>>> + - qcom,sm8450-pmic-glink
>>>> + - qcom,sm8550-pmic-glink
>>>> + then:
>>>> + properties:
>>>> + orientation-gpios: false
>>>> +
>>>> additionalProperties: false
>>>> examples:
>>>>
>>>> --
>>>> 2.34.1
>>>>
>>