diff mbox series

[resend,02/12] usb: typec: add basic typec properties

Message ID 1506398723-19359-3-git-send-email-jun.li@nxp.com
State Changes Requested, archived
Headers show
Series staging: typec: tcpci: move out of staging | expand

Commit Message

Jun Li Sept. 26, 2017, 4:05 a.m. UTC
port-type is required for any typec port; default-role is only required
for drp; power source capable needs src-pdos; power sink capable needs
snk-pdos, max-snk-mv, max-snk-ma, op-snk-mw.

Signed-off-by: Li Jun <jun.li@nxp.com>
---
 Documentation/devicetree/bindings/usb/typec.txt | 46 +++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

Comments

Rob Herring (Arm) Oct. 5, 2017, 8:44 p.m. UTC | #1
On Tue, Sep 26, 2017 at 12:05:13PM +0800, Li Jun wrote:
> port-type is required for any typec port; default-role is only required
> for drp; power source capable needs src-pdos; power sink capable needs
> snk-pdos, max-snk-mv, max-snk-ma, op-snk-mw.

"dt-bindings: usb: ..." for the subject prefix.

> 
> Signed-off-by: Li Jun <jun.li@nxp.com>
> ---
>  Documentation/devicetree/bindings/usb/typec.txt | 46 +++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/typec.txt b/Documentation/devicetree/bindings/usb/typec.txt
> new file mode 100644
> index 0000000..36d4467
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/typec.txt
> @@ -0,0 +1,46 @@
> +Generic typec and power delivery properties
> +-------------------------------------------

What node do these apply to? A type C connector node? The PD 
microcontroller?

I'm reluctant to accept just a random list of properties without a more 
complete Type-C binding which I'd expect to have a connector node, OF 
graph ports to connect to video outputs, connection to USB controller, 
and connection to the PD controller.

> +
> +Required properties:
> +- port-type:    should be one of "source", "sink" or "dual".
> +- default-role: preferred power role if drp, should be "sink" or "source".
> +- src-pdos:     An array of u32 with each entry providing supported power
> +                source data object(PDO), the detailed bit definitions of
> +                PDO can be found in "Universal Serial Bus Power Delivery
> +                Specification" chapter 6.4.1.2 Source_Capabilities Message,
> +                the order of each entry(PDO) should follow the PD spec chapter
> +                6.4.1. Required only for power source and power dual role with
> +                power delivery support.
> +- snk-pdos:     An array of u32 with each entry providing supported power
> +                sink data object(PDO), the detailed bit definitions of PDO
> +                can be found in "Universal Serial Bus Power Delivery
> +                Specification" chapter 6.4.1.3 Sink Capabilities Message,
> +                the order of each entry(PDO) should follow the PD spec chapter
> +                6.4.1. Required only for power sink and power dual role with
> +                power delivery support.

> +- max-snk-mv:   The max voltage the sink can support in millivoltage, required
> +                only for power sink and power dual role with power delivery
> +                support.
> +- max-snk-ma:   The max current the sink can support in milliampere, required
> +                only for power sink and power dual role with power delivery
> +                support.
> +- op-snk-mw:    Sink required operating power in milliwatts, if source offered
> +                power is less then it, Capability Mismatch is set, required
> +                only for power sink and power dual role with power delivery
> +                support.

Use the standard unit suffixes as defined in property-units.txt

> +
> +Example:
> +
> +ptn5110@50 {
> +	compatible = "usb,tcpci";
> +	reg = <0x50>;
> +	interrupt-parent = <&gpio3>;
> +	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
> +	port-type = "dual";
> +	default-role = "sink";
> +	src-pdos = <0x380190c8>;
> +	snk-pdos = <0x380190c8 0x3802d0c8>;
> +	max-snk-mv = <9000>;
> +	max-snk-ma = <1000>;
> +	op-snk-mw = <9000>;
> +};
> -- 
> 2.6.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jun Li Oct. 9, 2017, 11:21 a.m. UTC | #2
Hi Rob,

> -----Original Message-----
> From: Rob Herring [mailto:robh@kernel.org]
> Sent: Friday, October 06, 2017 4:44 AM
> To: Jun Li <jun.li@nxp.com>
> Cc: gregkh@linuxfoundation.org; linux@roeck-us.net; mark.rutland@arm.com;
> heikki.krogerus@linux.intel.com; yueyao@google.com; o_leveque@orange.fr;
> Peter Chen <peter.chen@nxp.com>; A.s. Dong <aisheng.dong@nxp.com>; linux-
> usb@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [PATCH resend 02/12] usb: typec: add basic typec properties
> 
> On Tue, Sep 26, 2017 at 12:05:13PM +0800, Li Jun wrote:
> > port-type is required for any typec port; default-role is only
> > required for drp; power source capable needs src-pdos; power sink
> > capable needs snk-pdos, max-snk-mv, max-snk-ma, op-snk-mw.
> 
> "dt-bindings: usb: ..." for the subject prefix.
> 

Will update in next version.

> >
> > Signed-off-by: Li Jun <jun.li@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/usb/typec.txt | 46
> > +++++++++++++++++++++++++
> >  1 file changed, 46 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/typec.txt
> > b/Documentation/devicetree/bindings/usb/typec.txt
> > new file mode 100644
> > index 0000000..36d4467
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/typec.txt
> > @@ -0,0 +1,46 @@
> > +Generic typec and power delivery properties
> > +-------------------------------------------
> 
> What node do these apply to? A type C connector node? The PD microcontroller?
> 

My initial thinking is those are general type-c properties, which can be applied to
type-C connector or used by PD microcontroller directly (my example),  I want
to get inputs on how this can be handled properly, so do you think a separated
node(e.g. type-c connector) is required to describe all the capability of the type-c
port has, then a type-c related driver get the phandle of it? 

> I'm reluctant to accept just a random list of properties without a more complete
> Type-C binding which I'd expect to have a connector node, OF graph ports to
> connect to video outputs, connection to USB controller, and connection to the
> PD controller.
> 

As type-C with PD has many properties to complete the description for diff usage,
so this is just a first step to have the basic power related bindings.

> > +
> > +Required properties:
> > +- port-type:    should be one of "source", "sink" or "dual".
> > +- default-role: preferred power role if drp, should be "sink" or "source".
> > +- src-pdos:     An array of u32 with each entry providing supported power
> > +                source data object(PDO), the detailed bit definitions of
> > +                PDO can be found in "Universal Serial Bus Power Delivery
> > +                Specification" chapter 6.4.1.2 Source_Capabilities Message,
> > +                the order of each entry(PDO) should follow the PD spec chapter
> > +                6.4.1. Required only for power source and power dual role with
> > +                power delivery support.
> > +- snk-pdos:     An array of u32 with each entry providing supported power
> > +                sink data object(PDO), the detailed bit definitions of PDO
> > +                can be found in "Universal Serial Bus Power Delivery
> > +                Specification" chapter 6.4.1.3 Sink Capabilities Message,
> > +                the order of each entry(PDO) should follow the PD spec chapter
> > +                6.4.1. Required only for power sink and power dual role with
> > +                power delivery support.
> 
> > +- max-snk-mv:   The max voltage the sink can support in millivoltage, required
> > +                only for power sink and power dual role with power delivery
> > +                support.
> > +- max-snk-ma:   The max current the sink can support in milliampere, required
> > +                only for power sink and power dual role with power delivery
> > +                support.
> > +- op-snk-mw:    Sink required operating power in milliwatts, if source offered
> > +                power is less then it, Capability Mismatch is set, required
> > +                only for power sink and power dual role with power delivery
> > +                support.
> 
> Use the standard unit suffixes as defined in property-units.txt
> 

Thanks, will update in next version.

Li Jun
> > +
> > +Example:
> > +
> > +ptn5110@50 {
> > +	compatible = "usb,tcpci";
> > +	reg = <0x50>;
> > +	interrupt-parent = <&gpio3>;
> > +	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
> > +	port-type = "dual";
> > +	default-role = "sink";
> > +	src-pdos = <0x380190c8>;
> > +	snk-pdos = <0x380190c8 0x3802d0c8>;
> > +	max-snk-mv = <9000>;
> > +	max-snk-ma = <1000>;
> > +	op-snk-mw = <9000>;
> > +};
> > --
> > 2.6.6
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe devicetree"
> > in the body of a message to majordomo@vger.kernel.org More majordomo
> > info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring (Arm) Oct. 9, 2017, 1:12 p.m. UTC | #3
On Mon, Oct 9, 2017 at 6:21 AM, Jun Li <jun.li@nxp.com> wrote:
> Hi Rob,
>
>> -----Original Message-----
>> From: Rob Herring [mailto:robh@kernel.org]
>> Sent: Friday, October 06, 2017 4:44 AM
>> To: Jun Li <jun.li@nxp.com>
>> Cc: gregkh@linuxfoundation.org; linux@roeck-us.net; mark.rutland@arm.com;
>> heikki.krogerus@linux.intel.com; yueyao@google.com; o_leveque@orange.fr;
>> Peter Chen <peter.chen@nxp.com>; A.s. Dong <aisheng.dong@nxp.com>; linux-
>> usb@vger.kernel.org; devicetree@vger.kernel.org
>> Subject: Re: [PATCH resend 02/12] usb: typec: add basic typec properties
>>
>> On Tue, Sep 26, 2017 at 12:05:13PM +0800, Li Jun wrote:
>> > port-type is required for any typec port; default-role is only
>> > required for drp; power source capable needs src-pdos; power sink
>> > capable needs snk-pdos, max-snk-mv, max-snk-ma, op-snk-mw.
>>
>> "dt-bindings: usb: ..." for the subject prefix.
>>
>
> Will update in next version.
>
>> >
>> > Signed-off-by: Li Jun <jun.li@nxp.com>
>> > ---
>> >  Documentation/devicetree/bindings/usb/typec.txt | 46
>> > +++++++++++++++++++++++++
>> >  1 file changed, 46 insertions(+)
>> >
>> > diff --git a/Documentation/devicetree/bindings/usb/typec.txt
>> > b/Documentation/devicetree/bindings/usb/typec.txt
>> > new file mode 100644
>> > index 0000000..36d4467
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/usb/typec.txt
>> > @@ -0,0 +1,46 @@
>> > +Generic typec and power delivery properties
>> > +-------------------------------------------
>>
>> What node do these apply to? A type C connector node? The PD microcontroller?
>>
>
> My initial thinking is those are general type-c properties, which can be applied to
> type-C connector or used by PD microcontroller directly (my example),  I want
> to get inputs on how this can be handled properly, so do you think a separated
> node(e.g. type-c connector) is required to describe all the capability of the type-c
> port has, then a type-c related driver get the phandle of it?
>
>> I'm reluctant to accept just a random list of properties without a more complete
>> Type-C binding which I'd expect to have a connector node, OF graph ports to
>> connect to video outputs, connection to USB controller, and connection to the
>> PD controller.
>>
>
> As type-C with PD has many properties to complete the description for diff usage,
> so this is just a first step to have the basic power related bindings.

We need something more complete, not something that just evolves. At
least the basic relationships between connectors, PD controller,
alternate modes, and USB controllers needs to be defined.

Andrzej started on defining USB connectors[1]. That's where we need to
start for Type-C bindings. Work together on this.

Rob

>> > +Required properties:
>> > +- port-type:    should be one of "source", "sink" or "dual".
>> > +- default-role: preferred power role if drp, should be "sink" or "source".
>> > +- src-pdos:     An array of u32 with each entry providing supported power
>> > +                source data object(PDO), the detailed bit definitions of
>> > +                PDO can be found in "Universal Serial Bus Power Delivery
>> > +                Specification" chapter 6.4.1.2 Source_Capabilities Message,
>> > +                the order of each entry(PDO) should follow the PD spec chapter
>> > +                6.4.1. Required only for power source and power dual role with
>> > +                power delivery support.
>> > +- snk-pdos:     An array of u32 with each entry providing supported power
>> > +                sink data object(PDO), the detailed bit definitions of PDO
>> > +                can be found in "Universal Serial Bus Power Delivery
>> > +                Specification" chapter 6.4.1.3 Sink Capabilities Message,
>> > +                the order of each entry(PDO) should follow the PD spec chapter
>> > +                6.4.1. Required only for power sink and power dual role with
>> > +                power delivery support.
>>
>> > +- max-snk-mv:   The max voltage the sink can support in millivoltage, required
>> > +                only for power sink and power dual role with power delivery
>> > +                support.
>> > +- max-snk-ma:   The max current the sink can support in milliampere, required
>> > +                only for power sink and power dual role with power delivery
>> > +                support.
>> > +- op-snk-mw:    Sink required operating power in milliwatts, if source offered
>> > +                power is less then it, Capability Mismatch is set, required
>> > +                only for power sink and power dual role with power delivery
>> > +                support.
>>
>> Use the standard unit suffixes as defined in property-units.txt
>>
>
> Thanks, will update in next version.
>
> Li Jun
>> > +
>> > +Example:
>> > +
>> > +ptn5110@50 {
>> > +   compatible = "usb,tcpci";
>> > +   reg = <0x50>;
>> > +   interrupt-parent = <&gpio3>;
>> > +   interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
>> > +   port-type = "dual";
>> > +   default-role = "sink";
>> > +   src-pdos = <0x380190c8>;
>> > +   snk-pdos = <0x380190c8 0x3802d0c8>;
>> > +   max-snk-mv = <9000>;
>> > +   max-snk-ma = <1000>;
>> > +   op-snk-mw = <9000>;
>> > +};

[1] http://www.spinics.net/lists/devicetree/msg197601.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/typec.txt b/Documentation/devicetree/bindings/usb/typec.txt
new file mode 100644
index 0000000..36d4467
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/typec.txt
@@ -0,0 +1,46 @@ 
+Generic typec and power delivery properties
+-------------------------------------------
+
+Required properties:
+- port-type:    should be one of "source", "sink" or "dual".
+- default-role: preferred power role if drp, should be "sink" or "source".
+- src-pdos:     An array of u32 with each entry providing supported power
+                source data object(PDO), the detailed bit definitions of
+                PDO can be found in "Universal Serial Bus Power Delivery
+                Specification" chapter 6.4.1.2 Source_Capabilities Message,
+                the order of each entry(PDO) should follow the PD spec chapter
+                6.4.1. Required only for power source and power dual role with
+                power delivery support.
+- snk-pdos:     An array of u32 with each entry providing supported power
+                sink data object(PDO), the detailed bit definitions of PDO
+                can be found in "Universal Serial Bus Power Delivery
+                Specification" chapter 6.4.1.3 Sink Capabilities Message,
+                the order of each entry(PDO) should follow the PD spec chapter
+                6.4.1. Required only for power sink and power dual role with
+                power delivery support.
+- max-snk-mv:   The max voltage the sink can support in millivoltage, required
+                only for power sink and power dual role with power delivery
+                support.
+- max-snk-ma:   The max current the sink can support in milliampere, required
+                only for power sink and power dual role with power delivery
+                support.
+- op-snk-mw:    Sink required operating power in milliwatts, if source offered
+                power is less then it, Capability Mismatch is set, required
+                only for power sink and power dual role with power delivery
+                support.
+
+Example:
+
+ptn5110@50 {
+	compatible = "usb,tcpci";
+	reg = <0x50>;
+	interrupt-parent = <&gpio3>;
+	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+	port-type = "dual";
+	default-role = "sink";
+	src-pdos = <0x380190c8>;
+	snk-pdos = <0x380190c8 0x3802d0c8>;
+	max-snk-mv = <9000>;
+	max-snk-ma = <1000>;
+	op-snk-mw = <9000>;
+};