mbox series

[v4,0/2] TCPM non-PD mode

Message ID 20210730061832.1927936-1-kyletso@google.com
Headers show
Series TCPM non-PD mode | expand

Message

Kyle Tso July 30, 2021, 6:18 a.m. UTC
cover-letter is the same as that in v3

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 a
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 v3:

usb: typec: tcpm: Support non-PD mode
- commit msg updated
- removed unnecessary empty lines
- re-factored the code of reading device tree properties and the error
  handling
- removed unnecessay variable initialization
- modified the comments

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                 | 87 +++++++++++++++----
 2 files changed, 72 insertions(+), 19 deletions(-)

Comments

Guenter Roeck July 30, 2021, 6:29 a.m. UTC | #1
On 7/29/21 11:18 PM, Kyle Tso wrote:
> Set "pd-unsupported" property if the Type-C connector has no power
> delivery support.
> 

subject is still wrong (it says pd-supported).


> Signed-off-by: Kyle Tso <kyletso@google.com>
> ---
>   .../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:
>
Rob Herring Aug. 3, 2021, 7:33 p.m. UTC | #2
On Thu, Jul 29, 2021 at 11:29:06PM -0700, Guenter Roeck wrote:
> On 7/29/21 11:18 PM, Kyle Tso wrote:
> > Set "pd-unsupported" property if the Type-C connector has no power
> > delivery support.
> > 
> 
> subject is still wrong (it says pd-supported).

And the commit msg too.

> 
> 
> > Signed-off-by: Kyle Tso <kyletso@google.com>
> > ---
> >   .../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:
> > 
> 
>