From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [RFC PATCH 1/4] dt-bindings: add bindings for USB physical connector Date: Wed, 18 Oct 2017 18:11:25 +0300 Message-ID: <3079487.ip075DyLUk@avalon> References: <20170928130730.8747-1-a.hajda@samsung.com> <20170928130730.8747-2-a.hajda@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <20170928130730.8747-2-a.hajda@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Andrzej Hajda Cc: Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chanwoo Choi , Rob Herring , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, Marek Szyprowski List-Id: linux-samsung-soc@vger.kernel.org SGkgQW5kcnplaiwKClRoYW5rIHlvdSBmb3IgdGhlIHBhdGNoLgoKT24gVGh1cnNkYXksIDI4IFNl cHRlbWJlciAyMDE3IDE2OjA3OjI3IEVFU1QgQW5kcnplaiBIYWpkYSB3cm90ZToKPiBUaGVzZSBi aW5kaW5ncyBhbGxvd3MgdG8gZGVzY3JpYmUgbW9zdCBrbm93biBzdGFuZGFyZCBVU0IgY29ubmVj dG9ycwo+IGFuZCBpdCBzaG91bGQgYmUgcG9zc2libGUgdG8gZXh0ZW5kIGl0IGlmIG5lY2Vzc2Fy eS4KPiBVU0IgY29ubmVjdG9ycywgYmVzaWRlIFVTQiBjYW4gYmUgdXNlZCB0byByb3V0ZSBvdGhl ciBwcm90b2NvbHMsCj4gZm9yIGV4YW1wbGUgVUFSVCwgQXVkaW8sIE1ITC4gSW4gc3VjaCBjYXNl IGV2ZXJ5IGRldmljZSBwY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mVudCBkZXZpY2Ugbm9kZXMuIFRo ZSBmaXJzdCBlbmRwb2ludCAocmVnID0gPDA+KSBzaG91bGQKPiArICBwb2ludCB0byBVU0IgSW50 ZXJmYWNlIENvbnRyb2xsZXIuCj4gKwo+ICtFeGFtcGxlCj4gKy0tLS0tLS0KPiArCj4gK211c2Jf Y29uOiBjb25uZWN0b3Igewo+ICsJY29tcGF0aWJsZSA9ICJzYW1zdW5nLHVzYi1jb25uZWN0b3It MTFwaW4iLCAidXNiLWNvbm5lY3RvciI7Cj4gKwlsYWJlbCA9ICJ1c2IiOwo+ICsJdHlwZSA9ICJi IjsKPiArCXNpemUgPSAibWljcm8iOwo+ICsJbWF4LW1vZGUgPSAiaHMiOwo+ICsKPiArCXBvcnQg ewo+ICsJCSNhZGRyZXNzLWNlbGxzID0gPDE+Owo+ICsJCSNzaXplLWNlbGxzID0gPDA+Owo+ICsK PiArCQltdXNiX2Nvbl91c2JfaW46IGVuZHBvaW50QDAgewo+ICsJCQlyZWcgPSA8MD47Cj4gKwkJ CXJlbW90ZS1lbmRwb2ludCA9IDwmbXVpY191c2Jfb3V0PjsKPiArCQl9Owo+ICsKPiArCQltdXNi X2Nvbl9taGxfaW46IGVuZHBvaW50QDEgewo+ICsJCQlyZWcgPSA8MT47Cj4gKwkJCXJlbW90ZS1l bmRwb2ludCA9IDwmbWhsX291dD47Cj4gKwkJfTsKPiArCX07Cj4gK307CgotLSAKUmVnYXJkcywK CkxhdXJlbnQgUGluY2hhcnQKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fCmRyaS1kZXZlbCBtYWlsaW5nIGxpc3QKZHJpLWRldmVsQGxpc3RzLmZyZWVkZXNr dG9wLm9yZwpodHRwczovL2xpc3RzLmZyZWVkZXNrdG9wLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2Ry aS1kZXZlbAo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: laurent.pinchart@ideasonboard.com (Laurent Pinchart) Date: Wed, 18 Oct 2017 18:11:25 +0300 Subject: [RFC PATCH 1/4] dt-bindings: add bindings for USB physical connector In-Reply-To: <20170928130730.8747-2-a.hajda@samsung.com> References: <20170928130730.8747-1-a.hajda@samsung.com> <20170928130730.8747-2-a.hajda@samsung.com> Message-ID: <3079487.ip075DyLUk@avalon> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Andrzej, Thank you for the patch. On Thursday, 28 September 2017 16:07:27 EEST Andrzej Hajda wrote: > These bindings allows to describe most known standard USB connectors > and it should be possible to extend it if necessary. > USB connectors, beside USB can be used to route other protocols, > for example UART, Audio, MHL. In such case every device passing data > through the connector should have appropriate graph bindings. > > Signed-off-by: Andrzej Hajda > --- > There are few things for discussion (IMO): > 1. vendor specific connectors, I have added them here, but maybe better is > to place them in separate files. It's useful to have one vendor-specific compatible string to be used in the example. We could split vendor-specific connectors to separate files later if needed, but for now I'm fine keeping them here. > 2. physical connector description - I have split it to three properties: > type(a,b,ab,c), max-mode(ls,fs,hs,ss,ss+), size(mini,micro,powered). > This tripled is able to describe all USB-standard connectors, but there > are also impossible combinations, for example(c, *, micro). Maybe better > would be to just enumerate all possible connectors in include file. I don't have a strong opinion on this. The three properties are nicely descriptive. You might want to list the valid combinations in the bindings though. > 3. Numbering of port/remote nodes, currently only 0 is assigned for > Interface Controller. Maybe other functions should be also assigned: > HS, SS, CC, SBU, ... whatever. Maybe functions should be described > as an additional property of remote node? Given that one of the main reasons this binding is needed is to describe MHL connection to a USB connector, I think we'll need to define additional functions, yes. I'm not sure yet how that should look like though. > --- > .../bindings/connector/usb-connector.txt | 49 +++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/connector/usb-connector.txt > > diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt > b/Documentation/devicetree/bindings/connector/usb-connector.txt new file > mode 100644 > index 000000000000..f3a4e85122d5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt > @@ -0,0 +1,49 @@ > +USB Connector > +============= > + > +Required properties: > +- compatible: "usb-connector" > + connectors with vendor specific extensions can add one of additional > + compatibles: > + "samsung,usb-connector-11pin": 11-pin Samsung micro-USB connector > +- type: the USB connector type: "a", "b", "ab", "c" > +- max-mode: max USB speed mode supported by the connector: > + "ls", "fs", "hs", "ss", "ss+" > + > +Optional properties: > +- label: a symbolic name for the connector > +- size: size of the connector, should be specified in case of > + non-standard USB connectors: "mini", "micro", "powered" "non-standard" sounds like "vendor-specific", while I assume you're talking about the size. The USB specification uses the term "standard" for this purpose, so it's hard to use another one that would convey the right meaning precisely. Maybe "non-standard ('large') USB connector sizes" ? > +Required nodes: > +- any data bus to the connector should be modeled using the > + OF graph bindings specified in bindings/graph.txt. > + There should be exactly one port with at least one endpoint to > + different device nodes. The first endpoint (reg = <0>) should > + point to USB Interface Controller. > + > +Example > +------- > + > +musb_con: connector { > + compatible = "samsung,usb-connector-11pin", "usb-connector"; > + label = "usb"; > + type = "b"; > + size = "micro"; > + max-mode = "hs"; > + > + port { > + #address-cells = <1>; > + #size-cells = <0>; > + > + musb_con_usb_in: endpoint at 0 { > + reg = <0>; > + remote-endpoint = <&muic_usb_out>; > + }; > + > + musb_con_mhl_in: endpoint at 1 { > + reg = <1>; > + remote-endpoint = <&mhl_out>; > + }; > + }; > +}; -- Regards, Laurent Pinchart From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751498AbdJRPLJ (ORCPT ); Wed, 18 Oct 2017 11:11:09 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:43034 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbdJRPLG (ORCPT ); Wed, 18 Oct 2017 11:11:06 -0400 From: Laurent Pinchart To: Andrzej Hajda Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, Inki Dae , Rob Herring , Mark Rutland , Krzysztof Kozlowski , Chanwoo Choi , Archit Taneja , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [RFC PATCH 1/4] dt-bindings: add bindings for USB physical connector Date: Wed, 18 Oct 2017 18:11:25 +0300 Message-ID: <3079487.ip075DyLUk@avalon> In-Reply-To: <20170928130730.8747-2-a.hajda@samsung.com> References: <20170928130730.8747-1-a.hajda@samsung.com> <20170928130730.8747-2-a.hajda@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrzej, Thank you for the patch. On Thursday, 28 September 2017 16:07:27 EEST Andrzej Hajda wrote: > These bindings allows to describe most known standard USB connectors > and it should be possible to extend it if necessary. > USB connectors, beside USB can be used to route other protocols, > for example UART, Audio, MHL. In such case every device passing data > through the connector should have appropriate graph bindings. > > Signed-off-by: Andrzej Hajda > --- > There are few things for discussion (IMO): > 1. vendor specific connectors, I have added them here, but maybe better is > to place them in separate files. It's useful to have one vendor-specific compatible string to be used in the example. We could split vendor-specific connectors to separate files later if needed, but for now I'm fine keeping them here. > 2. physical connector description - I have split it to three properties: > type(a,b,ab,c), max-mode(ls,fs,hs,ss,ss+), size(mini,micro,powered). > This tripled is able to describe all USB-standard connectors, but there > are also impossible combinations, for example(c, *, micro). Maybe better > would be to just enumerate all possible connectors in include file. I don't have a strong opinion on this. The three properties are nicely descriptive. You might want to list the valid combinations in the bindings though. > 3. Numbering of port/remote nodes, currently only 0 is assigned for > Interface Controller. Maybe other functions should be also assigned: > HS, SS, CC, SBU, ... whatever. Maybe functions should be described > as an additional property of remote node? Given that one of the main reasons this binding is needed is to describe MHL connection to a USB connector, I think we'll need to define additional functions, yes. I'm not sure yet how that should look like though. > --- > .../bindings/connector/usb-connector.txt | 49 +++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/connector/usb-connector.txt > > diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt > b/Documentation/devicetree/bindings/connector/usb-connector.txt new file > mode 100644 > index 000000000000..f3a4e85122d5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt > @@ -0,0 +1,49 @@ > +USB Connector > +============= > + > +Required properties: > +- compatible: "usb-connector" > + connectors with vendor specific extensions can add one of additional > + compatibles: > + "samsung,usb-connector-11pin": 11-pin Samsung micro-USB connector > +- type: the USB connector type: "a", "b", "ab", "c" > +- max-mode: max USB speed mode supported by the connector: > + "ls", "fs", "hs", "ss", "ss+" > + > +Optional properties: > +- label: a symbolic name for the connector > +- size: size of the connector, should be specified in case of > + non-standard USB connectors: "mini", "micro", "powered" "non-standard" sounds like "vendor-specific", while I assume you're talking about the size. The USB specification uses the term "standard" for this purpose, so it's hard to use another one that would convey the right meaning precisely. Maybe "non-standard ('large') USB connector sizes" ? > +Required nodes: > +- any data bus to the connector should be modeled using the > + OF graph bindings specified in bindings/graph.txt. > + There should be exactly one port with at least one endpoint to > + different device nodes. The first endpoint (reg = <0>) should > + point to USB Interface Controller. > + > +Example > +------- > + > +musb_con: connector { > + compatible = "samsung,usb-connector-11pin", "usb-connector"; > + label = "usb"; > + type = "b"; > + size = "micro"; > + max-mode = "hs"; > + > + port { > + #address-cells = <1>; > + #size-cells = <0>; > + > + musb_con_usb_in: endpoint@0 { > + reg = <0>; > + remote-endpoint = <&muic_usb_out>; > + }; > + > + musb_con_mhl_in: endpoint@1 { > + reg = <1>; > + remote-endpoint = <&mhl_out>; > + }; > + }; > +}; -- Regards, Laurent Pinchart