linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v3,01/12] dt-bindings: connector: add properties for typec
@ 2018-03-13  9:34 Jun Li
  0 siblings, 0 replies; 3+ messages in thread
From: Jun Li @ 2018-03-13  9:34 UTC (permalink / raw)
  To: robh+dt, mark.rutland, gregkh, heikki.krogerus
  Cc: a.hajda, jun.li, linux, yueyao, shufan_lee, o_leveque, linux-usb,
	linux-imx

Add bingdings supported by current typec driver, so user can pass
all those properties via dt.

Signed-off-by: Li Jun <jun.li@nxp.com>
---
Change for v3:
- port-type change to be power-type which only for power.
- add data-type for data capability.
- preferred-role change to try-power-role(bool property need 2, and user
  may add both at the same time, so still use one property but rename
  it to be try-power-role).
- Separate basic typec and power delivery properties.
- keep the max-sink-mv/ma/mw, and op-mw, because the counterpart driver
  code is to be back[1], to be discussed if we need those 4 setting for long
  term.

[1] https://www.spinics.net/lists/linux-usb/msg166366.html
 
 .../bindings/connector/usb-connector.txt           | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt
index e1463f1..9c7fc83 100644
--- a/Documentation/devicetree/bindings/connector/usb-connector.txt
+++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
@@ -15,6 +15,35 @@ Optional properties:
 - type: size of the connector, should be specified in case of USB-A, USB-B
   non-fullsize connectors: "mini", "micro".
 
+Optional properties for usb-c-connector:
+- power-type: should be one of "source", "sink" or "dual"(DRP) if typec
+  connector has power support.
+- try-power-role: preferred power role if "dual"(DRP) can support Try.SNK
+  or Try.SRC, should be "sink" for Try.SNK or "source" for Try.SRC.
+- data-type: should be one of "host", "device", "dual"(DRD) if typec
+  connector supports USB data.
+
+Required properties for usb-c-connector with power delivery support:
+- source-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 for power source and power dual role.
+- sink-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 for power sink and power dual role.
+- max-sink-microvolt: The max voltage the sink can support in micro volts,
+  required for power sink and power dual role.
+- max-sink-microamp: The max current the sink can support in micro amps,
+  required for power sink and power dual role.
+- max-sink-microwatt-hours: The max power the sink can support in micro
+  watt-hours, required for power sink and power dual role.
+- op-sink-microwatt-hours: Sink required operating power in micro
+  watt-hours, if source offered power is less then it, Capability Mismatch
+  is set, required for power sink and power dual role.
+
 Required nodes:
 - any data bus to the connector should be modeled using the OF graph bindings
   specified in bindings/graph.txt, unless the bus is between parent node and
@@ -73,3 +102,22 @@ ccic: s2mm005@33 {
 		};
 	};
 };
+
+3. USB-C connector attached to a typec port controller(ptn5110), which has
+power delivery support and enables drp.
+
+typec: ptn5110@50 {
+	...
+	usb_con: connector {
+		compatible = "usb-c-connector";
+		label = "USB-C";
+		power-type = "dual";
+		try-power-role = "sink";
+		source-pdos = <0x380190c8>;
+		sink-pdos = <0x380190c8 0x3802d0c8>;
+		max-sink-microvolt = <9000>;
+		max-sink-microamp = <2000>;
+		max-sink-microwatt-hours = <18000>;
+		op-sink-microwatt-hours = <9000>;
+	};
+};

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [v3,01/12] dt-bindings: connector: add properties for typec
@ 2018-03-14  9:40 Heikki Krogerus
  0 siblings, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2018-03-14  9:40 UTC (permalink / raw)
  To: Li Jun
  Cc: robh+dt, mark.rutland, gregkh, a.hajda, linux, yueyao, shufan_lee,
	o_leveque, linux-usb, linux-imx

On Tue, Mar 13, 2018 at 05:34:27PM +0800, Li Jun wrote:
> Add bingdings supported by current typec driver, so user can pass
> all those properties via dt.
> 
> Signed-off-by: Li Jun <jun.li@nxp.com>
> ---
> Change for v3:
> - port-type change to be power-type which only for power.
> - add data-type for data capability.
> - preferred-role change to try-power-role(bool property need 2, and user
>   may add both at the same time, so still use one property but rename
>   it to be try-power-role).
> - Separate basic typec and power delivery properties.
> - keep the max-sink-mv/ma/mw, and op-mw, because the counterpart driver
>   code is to be back[1], to be discussed if we need those 4 setting for long
>   term.
> 
> [1] https://www.spinics.net/lists/linux-usb/msg166366.html
>  
>  .../bindings/connector/usb-connector.txt           | 48 ++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt
> index e1463f1..9c7fc83 100644
> --- a/Documentation/devicetree/bindings/connector/usb-connector.txt
> +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
> @@ -15,6 +15,35 @@ Optional properties:
>  - type: size of the connector, should be specified in case of USB-A, USB-B
>    non-fullsize connectors: "mini", "micro".
>  
> +Optional properties for usb-c-connector:
> +- power-type: should be one of "source", "sink" or "dual"(DRP) if typec
> +  connector has power support.
> +- try-power-role: preferred power role if "dual"(DRP) can support Try.SNK
> +  or Try.SRC, should be "sink" for Try.SNK or "source" for Try.SRC.
> +- data-type: should be one of "host", "device", "dual"(DRD) if typec
> +  connector supports USB data.

Why not "power-role" and "data-role" instead of "power-type" and
"data-type"?


Thanks,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [v3,01/12] dt-bindings: connector: add properties for typec
@ 2018-03-14  9:49 Jun Li
  0 siblings, 0 replies; 3+ messages in thread
From: Jun Li @ 2018-03-14  9:49 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: robh+dt@kernel.org, mark.rutland@arm.com,
	gregkh@linuxfoundation.org, a.hajda@samsung.com,
	linux@roeck-us.net, yueyao@google.com, shufan_lee@richtek.com,
	o_leveque@orange.fr, linux-usb@vger.kernel.org, dl-linux-imx

> -----Original Message-----
> From: linux-usb-owner@vger.kernel.org
> [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Heikki Krogerus
> Sent: 2018年3月14日 17:40
> To: Jun Li <jun.li@nxp.com>
> Cc: robh+dt@kernel.org; mark.rutland@arm.com;
> gregkh@linuxfoundation.org; a.hajda@samsung.com; linux@roeck-us.net;
> yueyao@google.com; shufan_lee@richtek.com; o_leveque@orange.fr;
> linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH v3 01/12] dt-bindings: connector: add properties for typec
> 
> On Tue, Mar 13, 2018 at 05:34:27PM +0800, Li Jun wrote:
> > Add bingdings supported by current typec driver, so user can pass all
> > those properties via dt.
> >
> > Signed-off-by: Li Jun <jun.li@nxp.com>
> > ---
> > Change for v3:
> > - port-type change to be power-type which only for power.
> > - add data-type for data capability.
> > - preferred-role change to try-power-role(bool property need 2, and user
> >   may add both at the same time, so still use one property but rename
> >   it to be try-power-role).
> > - Separate basic typec and power delivery properties.
> > - keep the max-sink-mv/ma/mw, and op-mw, because the counterpart driver
> >   code is to be back[1], to be discussed if we need those 4 setting for long
> >   term.
> >
> > [1]
> >
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
> > .spinics.net%2Flists%2Flinux-usb%2Fmsg166366.html&data=02%7C01%7Cju
> n.l
> >
> i%40nxp.com%7C1dd1571bd9ea4743ec6d08d5898f9d63%7C686ea1d3bc2b4
> c6fa92cd
> >
> 99c5c301635%7C0%7C1%7C636566172296570893&sdata=expnxYX8F5wbW
> VZoZgl91JV
> > shsCTVwq98OpMslMV3XE%3D&reserved=0
> >
> >  .../bindings/connector/usb-connector.txt           | 48
> ++++++++++++++++++++++
> >  1 file changed, 48 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/connector/usb-connector.txt
> > b/Documentation/devicetree/bindings/connector/usb-connector.txt
> > index e1463f1..9c7fc83 100644
> > --- a/Documentation/devicetree/bindings/connector/usb-connector.txt
> > +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
> > @@ -15,6 +15,35 @@ Optional properties:
> >  - type: size of the connector, should be specified in case of USB-A, USB-B
> >    non-fullsize connectors: "mini", "micro".
> >
> > +Optional properties for usb-c-connector:
> > +- power-type: should be one of "source", "sink" or "dual"(DRP) if
> > +typec
> > +  connector has power support.
> > +- try-power-role: preferred power role if "dual"(DRP) can support
> > +Try.SNK
> > +  or Try.SRC, should be "sink" for Try.SNK or "source" for Try.SRC.
> > +- data-type: should be one of "host", "device", "dual"(DRD) if typec
> > +  connector supports USB data.
> 
> Why not "power-role" and "data-role" instead of "power-type" and
> "data-type"?

Intention is to reflect the port capability(not state), we already have
power role and data role in sys ABI for current role, I have no strong
preference, if you think power-role and data-role is easy to understand
and proper here, I am ok to follow it. 

Jun
> 
> 
> Thanks,
> 
> --
> heikki
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body
> of a message to majordomo@vger.kernel.org More majordomo info at
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.k
> ernel.org%2Fmajordomo-info.html&data=02%7C01%7Cjun.li%40nxp.com%7C
> 1dd1571bd9ea4743ec6d08d5898f9d63%7C686ea1d3bc2b4c6fa92cd99c5c30
> 1635%7C0%7C1%7C636566172296570893&sdata=iIpoPotQYRA3tCTzTGlqfXx
> BFBA267L%2B4gaXINiB7Iw%3D&reserved=0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-14  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-13  9:34 [v3,01/12] dt-bindings: connector: add properties for typec Jun Li
  -- strict thread matches above, loose matches on Subject: below --
2018-03-14  9:40 Heikki Krogerus
2018-03-14  9:49 Jun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).