2021-07-28 09:33:25

by Kyle Tso

[permalink] [raw]
Subject: [PATCH v3 0/2] TCPM non-pd mode

The reason for this patch is to let the device/system policy decide
whether PD is going to be supported using devicetree properties.

A new dt property "pd-unsupported" is introduced and TCPM uses this
property as a flag to decide whether PD is supported. If the flag is
false (the dt property is not present), the RX functionality of the
low-level driver will not be enabled. The power negotiation related
states will be skipped as well. If the flag is true, everything is as
what it was before.

If "pd-unsupported" is present, and the port is SRC or DRP, another
existing dt property "typec-power-opmode" needs to be specified to
indicate which Rp value should be used when the port is SRC.

changes since v2:
- Negated the meaning and the name of the dt property. Now the name is
"pd-unsupported"
- Changed the control flow if the port is SNK or DRP. Return directly if
the flag is false (PD not supported). Read "self-powered" before that.

---
cover-letter in v2:
---
The reason for this patch is to let the device/system policy decide
whether PD is going to be supported using devicetree properties.

A new dt property "pd-supported" is introduced and TCPM uses this
property as a flag to decide whether PD is supported. If the flag is
false, the RX functionality of the low-level driver will not be enabled.
The power negotiation related states will be skipped as well. If the
flag is true, everything is as what it was before.

If "pd-supported" is not present, and the port is SRC or DRP, another
existing dt property "typec-power-opmode" needs to be specified to
indicate which Rp value should be used when the port is SRC.

changes since v1:
- revise the patch to use dt properties

Kyle Tso (2):
dt-bindings: connector: Add pd-supported property
usb: typec: tcpm: Support non-PD mode

.../bindings/connector/usb-connector.yaml | 4 +
drivers/usb/typec/tcpm/tcpm.c | 88 +++++++++++++++----
2 files changed, 74 insertions(+), 18 deletions(-)

--
2.32.0.432.gabb21c7263-goog



2021-07-28 09:33:44

by Kyle Tso

[permalink] [raw]
Subject: [PATCH v3 1/2] dt-bindings: connector: Add pd-supported property

Set "pd-unsupported" property if the Type-C connector has no power
delivery support.

Signed-off-by: Kyle Tso <[email protected]>
---
changes since v2:
- Negated the meaning and the name of the dt property. Now the name is
"pd-unsupported".

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

diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml
index 92b49bc37939..21ec470117a6 100644
--- a/Documentation/devicetree/bindings/connector/usb-connector.yaml
+++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml
@@ -111,6 +111,10 @@ properties:
- 1.5A
- 3.0A

+ pd-unsupported:
+ description: Set this property if the Type-C connector has no power delivery support.
+ type: boolean
+
# The following are optional properties for "usb-c-connector" with power
# delivery support.
source-pdos:
--
2.32.0.432.gabb21c7263-goog


2021-07-28 14:06:00

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] dt-bindings: connector: Add pd-supported property

On 7/28/21 2:29 AM, Kyle Tso wrote:
> Set "pd-unsupported" property if the Type-C connector has no power
> delivery support.
>

$subject still says "pd-supported"

> Signed-off-by: Kyle Tso <[email protected]>
> ---
> changes since v2:
> - Negated the meaning and the name of the dt property. Now the name is
> "pd-unsupported".
>
> .../devicetree/bindings/connector/usb-connector.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml
> index 92b49bc37939..21ec470117a6 100644
> --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml
> +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml
> @@ -111,6 +111,10 @@ properties:
> - 1.5A
> - 3.0A
>
> + pd-unsupported:
> + description: Set this property if the Type-C connector has no power delivery support.
> + type: boolean
> +
> # The following are optional properties for "usb-c-connector" with power
> # delivery support.
> source-pdos:
>