* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-03-28 16:06 Jun Li
0 siblings, 0 replies; 7+ messages in thread
From: Jun Li @ 2018-03-28 16:06 UTC (permalink / raw)
To: robh+dt, gregkh, heikki.krogerus, linux
Cc: a.hajda, shufan_lee, peter.chen, devicetree, linux-usb, linux-imx,
jun.li, devel
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>
---
.../bindings/connector/usb-connector.txt | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt
index e1463f1..922f22b 100644
--- a/Documentation/devicetree/bindings/connector/usb-connector.txt
+++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
@@ -15,6 +15,29 @@ 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.
+- 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 +96,19 @@ 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>;
+ op-sink-microwatt-hours = <9000000>;
+ };
+};
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-03-29 19:54 Mats Karrman
0 siblings, 0 replies; 7+ messages in thread
From: Mats Karrman @ 2018-03-29 19:54 UTC (permalink / raw)
To: Li Jun, robh+dt, gregkh, heikki.krogerus, linux
Cc: a.hajda, shufan_lee, peter.chen, devicetree, linux-usb, linux-imx,
devel
Hi Li,
On 03/28/2018 06:06 PM, 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>
> ---
> .../bindings/connector/usb-connector.txt | 39 ++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt
> index e1463f1..922f22b 100644
> --- a/Documentation/devicetree/bindings/connector/usb-connector.txt
> +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
> @@ -15,6 +15,29 @@ 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.
> +- 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.
This doesn't make sense. The unit of power is watt (W), watt-hour on the other hand
is a measurement of energy. I think "op-sink-microwatt" is what we want here.
// Mats
> +
> 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 +96,19 @@ 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>;
> + op-sink-microwatt-hours = <9000000>;
> + };
> +};
>
---
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 http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-03-31 3:34 Jun Li
0 siblings, 0 replies; 7+ messages in thread
From: Jun Li @ 2018-03-31 3:34 UTC (permalink / raw)
To: Mats Karrman, robh+dt@kernel.org, gregkh@linuxfoundation.org,
heikki.krogerus@linux.intel.com, linux@roeck-us.net
Cc: a.hajda@samsung.com, shufan_lee@richtek.com, Peter Chen,
devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
dl-linux-imx, devel@driverdev.osuosl.org
SGkNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogTWF0cyBLYXJybWFuIFtt
YWlsdG86bWF0cy5kZXYubGlzdEBnbWFpbC5jb21dDQo+IFNlbnQ6IDIwMTjlubQz5pyIMzDml6Ug
Mzo1NA0KPiBUbzogSnVuIExpIDxqdW4ubGlAbnhwLmNvbT47IHJvYmgrZHRAa2VybmVsLm9yZzsg
Z3JlZ2toQGxpbnV4Zm91bmRhdGlvbi5vcmc7DQo+IGhlaWtraS5rcm9nZXJ1c0BsaW51eC5pbnRl
bC5jb207IGxpbnV4QHJvZWNrLXVzLm5ldA0KPiBDYzogYS5oYWpkYUBzYW1zdW5nLmNvbTsgc2h1
ZmFuX2xlZUByaWNodGVrLmNvbTsgUGV0ZXIgQ2hlbg0KPiA8cGV0ZXIuY2hlbkBueHAuY29tPjsg
ZGV2aWNldHJlZUB2Z2VyLmtlcm5lbC5vcmc7DQo+IGxpbnV4LXVzYkB2Z2VyLmtlcm5lbC5vcmc7
IGRsLWxpbnV4LWlteCA8bGludXgtaW14QG54cC5jb20+Ow0KPiBkZXZlbEBkcml2ZXJkZXYub3N1
b3NsLm9yZw0KPiBTdWJqZWN0OiBSZTogW1BBVENIIHY0IDAxLzEzXSBkdC1iaW5kaW5nczogY29u
bmVjdG9yOiBhZGQgcHJvcGVydGllcyBmb3IgdHlwZWMNCj4gDQo+IEhpIExpLA0KPiANCj4gT24g
MDMvMjgvMjAxOCAwNjowNiBQTSwgTGkgSnVuIHdyb3RlOg0KPiANCj4gPiBBZGQgYmluZ2Rpbmdz
IHN1cHBvcnRlZCBieSBjdXJyZW50IHR5cGVjIGRyaXZlciwgc28gdXNlciBjYW4gcGFzcyBhbGwN
Cj4gPiB0aG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dlci10eXBlID0gImR1YWwiOw0KPiA+ICsJCXRyeS1wb3dlci1y
b2xlID0gInNpbmsiOw0KPiA+ICsJCXNvdXJjZS1wZG9zID0gPDB4MzgwMTkwYzg+Ow0KPiA+ICsJ
CXNpbmstcGRvcyA9IDwweDM4MDE5MGM4IDB4MzgwMmQwYzg+Ow0KPiA+ICsJCW9wLXNpbmstbWlj
cm93YXR0LWhvdXJzID0gPDkwMDAwMDA+Ow0KPiA+ICsJfTsNCj4gPiArfTsNCj4gPg0K
---
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 http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-04-03 8:29 Andrzej Hajda
0 siblings, 0 replies; 7+ messages in thread
From: Andrzej Hajda @ 2018-04-03 8:29 UTC (permalink / raw)
To: Li Jun, robh+dt, gregkh, heikki.krogerus, linux
Cc: shufan_lee, peter.chen, devicetree, linux-usb, linux-imx, devel
On 28.03.2018 18:06, 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>
> ---
> .../bindings/connector/usb-connector.txt | 39 ++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt
> index e1463f1..922f22b 100644
> --- a/Documentation/devicetree/bindings/connector/usb-connector.txt
> +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
> @@ -15,6 +15,29 @@ 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.
> +- 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.
I have lurked into specs and I am not sure what is the relation of this
field with PD protocol, there is Minimum Operating Power, Maximum
Operating Power and Operating Power present in different RDOs, there are
also similar fields in sink PDOs.
I guess it can be one of them, which one? why other ones are not
provided? What if this or any other property can be calculated only in
runtime?
I am not sure if any of them should be marked "required".
> +
> 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 +96,19 @@ 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>;
I understand from DT specification point of view cryptic numbers are OK,
but for sake of readability I strongly suggest use/define macros similar
to the ones present already in kernel:
source-pdos = < PDO_FIXED(5000, 400, PDO_FIXED_FLAGS) >;
It much less error prone, and makes review process much more easier.
Regards
Andrzej
> + sink-pdos = <0x380190c8 0x3802d0c8>;
> + op-sink-microwatt-hours = <9000000>;
> + };
> +};
---
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 http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-04-13 11:51 Jun Li
0 siblings, 0 replies; 7+ messages in thread
From: Jun Li @ 2018-04-13 11:51 UTC (permalink / raw)
To: Andrzej Hajda
Cc: Li Jun, robh+dt, gregkh, heikki.krogerus, linux, shufan_lee,
peter.chen, devicetree, linux-usb, linux-imx, devel
2018-04-03 16:29 GMT+08:00 Andrzej Hajda <a.hajda@samsung.com>:
>
> On 28.03.2018 18:06, 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>
> > ---
> > .../bindings/connector/usb-connector.txt | 39 ++++++++++++++++++++++
> > 1 file changed, 39 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt
> > index e1463f1..922f22b 100644
> > --- a/Documentation/devicetree/bindings/connector/usb-connector.txt
> > +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt
> > @@ -15,6 +15,29 @@ 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.
> > +- 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.
>
> I have lurked into specs and I am not sure what is the relation of this
> field with PD protocol, there is Minimum Operating Power, Maximum
> Operating Power and Operating Power present in different RDOs, there are
> also similar fields in sink PDOs.
> I guess it can be one of them, which one?
Per current usage of op-sink-microwatt(operating_snk_mw in tcpm),
this property is actually for max operating power, which is only used to
judge capability mismatch, i.e. the required max current/power is larger
than the selected source PDO can provide.
After checking the PD spec about this, basically I think this property also
can be removed, we can judge the capability mismatch by compare the
selected source pdo and sink pdo, considering there are existing users
of this field(operating_snk_mw in tcpm), I will check how this can be done.
I am removing the other 3 max_snk_*, see [1]
[1] https://www.spinics.net/lists/linux-usb/msg167262.html
> why other ones are not
> provided? What if this or any other property can be calculated only in
> runtime?
> I am not sure if any of them should be marked "required".
>
> > +
> > 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 +96,19 @@ 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>;
>
> I understand from DT specification point of view cryptic numbers are OK,
> but for sake of readability I strongly suggest use/define macros similar
> to the ones present already in kernel:
> source-pdos = < PDO_FIXED(5000, 400, PDO_FIXED_FLAGS) >;
I agree it's easier to read, so with the proposed way, we need maintain
a copy of those macros for dts(e.g. under dt-binding/usb/pd.h), right?
thanks
Jun
>
> It much less error prone, and makes review process much more easier.
>
> Regards
> Andrzej
>
> > + sink-pdos = <0x380190c8 0x3802d0c8>;
> > + op-sink-microwatt-hours = <9000000>;
> > + };
> > +};
>
>
> --
> 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 http://vger.kernel.org/majordomo-info.html
---
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 http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-04-30 11:23 Heikki Krogerus
0 siblings, 0 replies; 7+ messages in thread
From: Heikki Krogerus @ 2018-04-30 11:23 UTC (permalink / raw)
To: Li Jun
Cc: robh+dt, gregkh, linux, a.hajda, shufan_lee, peter.chen,
devicetree, linux-usb, linux-imx, devel
Hi,
On Thu, Mar 29, 2018 at 12:06:06AM +0800, Li Jun wrote:
> +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.
Please use "power-role" and "data-role".
Thanks,
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v4,01/13] dt-bindings: connector: add properties for typec
@ 2018-05-01 7:57 Jun Li
0 siblings, 0 replies; 7+ messages in thread
From: Jun Li @ 2018-05-01 7:57 UTC (permalink / raw)
To: Heikki Krogerus
Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org,
linux@roeck-us.net, a.hajda@samsung.com, shufan_lee@richtek.com,
Peter Chen, devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
dl-linux-imx, devel@driverdev.osuosl.org
Hi
> -----Original Message-----
> From: Heikki Krogerus [mailto:heikki.krogerus@linux.intel.com]
> Sent: 2018年4月30日 19:24
> To: Jun Li <jun.li@nxp.com>
> Cc: robh+dt@kernel.org; gregkh@linuxfoundation.org; linux@roeck-us.net;
> a.hajda@samsung.com; shufan_lee@richtek.com; Peter Chen
> <peter.chen@nxp.com>; devicetree@vger.kernel.org;
> linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> devel@driverdev.osuosl.org
> Subject: Re: [PATCH v4 01/13] dt-bindings: connector: add properties for typec
>
> Hi,
>
> On Thu, Mar 29, 2018 at 12:06:06AM +0800, Li Jun wrote:
> > +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.
>
> Please use "power-role" and "data-role".
OK. I will update these 2 property names as you suggested.
Li Jun
>
>
> Thanks,
>
> --
> heikki
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-05-01 7:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-30 11:23 [v4,01/13] dt-bindings: connector: add properties for typec Heikki Krogerus
-- strict thread matches above, loose matches on Subject: below --
2018-05-01 7:57 Jun Li
2018-04-13 11:51 Jun Li
2018-04-03 8:29 Andrzej Hajda
2018-03-31 3:34 Jun Li
2018-03-29 19:54 Mats Karrman
2018-03-28 16:06 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).