diff mbox series

[v3,1/8] dt-bindings: connector: usb-connector: add a gpio used to determine the Type-C port plug orientation

Message ID 20230601-topic-sm8550-upstream-type-c-v3-1-22c9973012b6@linaro.org (mailing list archive)
State New, archived
Headers show
Series arm64: qcom: add Type-C Altmode support | expand

Commit Message

Neil Armstrong June 13, 2023, 7:55 a.m. UTC
On some platforms, the Type-C plug orientation is given on a GPIO line.

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

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 Documentation/devicetree/bindings/connector/usb-connector.yaml | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Krzysztof Kozlowski June 13, 2023, 8:13 a.m. UTC | #1
On 13/06/2023 09:55, Neil Armstrong wrote:
> On some platforms, the Type-C plug orientation is given on a GPIO line.
> 
> Document this optional Type-C connector property, and take the
> assumption an active level represents an inverted/flipped orientation.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Rob had here objections as these are bindings for the connector, not
PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
have such pin exposed. If you open the schematics, the GPIO is actually
coming out from PMIC and is nowhere around the connector. Please drop my
Ack.

This however could be a pin of the PMIC because it clearly is on the
schematics.



Best regards,
Krzysztof
Rob Herring (Arm) June 13, 2023, 8:18 a.m. UTC | #2
On Tue, 13 Jun 2023 09:55:54 +0200, Neil Armstrong wrote:
> On some platforms, the Type-C plug orientation is given on a GPIO line.
> 
> Document this optional Type-C connector property, and take the
> assumption an active level represents an inverted/flipped orientation.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  Documentation/devicetree/bindings/connector/usb-connector.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml: $defs:qcom-pmic-mpp-state:properties:qcom,paired: [{'description': 'Indicates that the pin should be operating in paired mode.'}] is not of type 'object', 'boolean'
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230601-topic-sm8550-upstream-type-c-v3-1-22c9973012b6@linaro.org

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Neil Armstrong June 13, 2023, 8:54 a.m. UTC | #3
On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
> On 13/06/2023 09:55, Neil Armstrong wrote:
>> On some platforms, the Type-C plug orientation is given on a GPIO line.
>>
>> Document this optional Type-C connector property, and take the
>> assumption an active level represents an inverted/flipped orientation.
>>
>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Rob had here objections as these are bindings for the connector, not
> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
> have such pin exposed. If you open the schematics, the GPIO is actually
> coming out from PMIC and is nowhere around the connector. Please drop my
> Ack.
> 
> This however could be a pin of the PMIC because it clearly is on the
> schematics.

Yes it comes from the PMIC, but this part of the PMIC is handled by
the PMIC_GLINK firmware service, so the logical place would be into
the pmic_glink node with a gpio array in order to handle multi-ports.

Thanks,
Neil

> 
> 
> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski June 13, 2023, 9:02 a.m. UTC | #4
On 13/06/2023 10:54, Neil Armstrong wrote:
> On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>> On some platforms, the Type-C plug orientation is given on a GPIO line.
>>>
>>> Document this optional Type-C connector property, and take the
>>> assumption an active level represents an inverted/flipped orientation.
>>>
>>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>> Rob had here objections as these are bindings for the connector, not
>> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
>> have such pin exposed. If you open the schematics, the GPIO is actually
>> coming out from PMIC and is nowhere around the connector. Please drop my
>> Ack.
>>
>> This however could be a pin of the PMIC because it clearly is on the
>> schematics.
> 
> Yes it comes from the PMIC, but this part of the PMIC is handled by
> the PMIC_GLINK firmware service, so the logical place would be into
> the pmic_glink node with a gpio array in order to handle multi-ports.

I think all PMICs have only one CC_OUT pin, so this would be now
maxItems: 1, but there will be no problem in growing this later.

Best regards,
Krzysztof
Neil Armstrong June 13, 2023, 9:24 a.m. UTC | #5
On 13/06/2023 11:02, Krzysztof Kozlowski wrote:
> On 13/06/2023 10:54, Neil Armstrong wrote:
>> On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
>>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>>> On some platforms, the Type-C plug orientation is given on a GPIO line.
>>>>
>>>> Document this optional Type-C connector property, and take the
>>>> assumption an active level represents an inverted/flipped orientation.
>>>>
>>>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>
>>> Rob had here objections as these are bindings for the connector, not
>>> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
>>> have such pin exposed. If you open the schematics, the GPIO is actually
>>> coming out from PMIC and is nowhere around the connector. Please drop my
>>> Ack.
>>>
>>> This however could be a pin of the PMIC because it clearly is on the
>>> schematics.
>>
>> Yes it comes from the PMIC, but this part of the PMIC is handled by
>> the PMIC_GLINK firmware service, so the logical place would be into
>> the pmic_glink node with a gpio array in order to handle multi-ports.
> 
> I think all PMICs have only one CC_OUT pin, so this would be now
> maxItems: 1, but there will be no problem in growing this later.

Yep, I'll only allow for sm8550-pmic-glink and set maxItems: 1 for now
since it's the first occurence.

Neil

> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski June 13, 2023, 11:51 a.m. UTC | #6
On 13/06/2023 11:24, neil.armstrong@linaro.org wrote:
> On 13/06/2023 11:02, Krzysztof Kozlowski wrote:
>> On 13/06/2023 10:54, Neil Armstrong wrote:
>>> On 13/06/2023 10:13, Krzysztof Kozlowski wrote:
>>>> On 13/06/2023 09:55, Neil Armstrong wrote:
>>>>> On some platforms, the Type-C plug orientation is given on a GPIO line.
>>>>>
>>>>> Document this optional Type-C connector property, and take the
>>>>> assumption an active level represents an inverted/flipped orientation.
>>>>>
>>>>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>
>>>> Rob had here objections as these are bindings for the connector, not
>>>> PMIC glink/altmode. I still doubt that Qualcomm USB Type-C connectors
>>>> have such pin exposed. If you open the schematics, the GPIO is actually
>>>> coming out from PMIC and is nowhere around the connector. Please drop my
>>>> Ack.
>>>>
>>>> This however could be a pin of the PMIC because it clearly is on the
>>>> schematics.
>>>
>>> Yes it comes from the PMIC, but this part of the PMIC is handled by
>>> the PMIC_GLINK firmware service, so the logical place would be into
>>> the pmic_glink node with a gpio array in order to handle multi-ports.
>>
>> I think all PMICs have only one CC_OUT pin, so this would be now
>> maxItems: 1, but there will be no problem in growing this later.
> 
> Yep, I'll only allow for sm8550-pmic-glink and set maxItems: 1 for now
> since it's the first occurence.

You can add to pm8350 as well - it's already used in HDK8450.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml
index ae515651fc6b..c3884eed6ba4 100644
--- a/Documentation/devicetree/bindings/connector/usb-connector.yaml
+++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml
@@ -114,6 +114,11 @@  properties:
     description: Set this property if the Type-C connector has no power delivery support.
     type: boolean
 
+  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
+
   # The following are optional properties for "usb-c-connector" with power
   # delivery support.
   source-pdos: