[4/8] dt-bindings: usb: document hub and host-controller properties

Message ID 20171109170723.10960-5-johan@kernel.org
State Accepted
Headers show
Series
  • USB: add device-tree support for interfaces
Related show

Commit Message

Johan Hovold Nov. 9, 2017, 5:07 p.m.
Hub nodes and host-controller nodes with child nodes must specify values
for #address-cells (1) and #size-cells (0).

Also make the definition of the related reg property a bit more
stringent, and add comments to the example source.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 Documentation/devicetree/bindings/usb/usb-device.txt | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Comments

Rob Herring Nov. 15, 2017, 3:46 p.m. | #1
On Thu, Nov 09, 2017 at 06:07:19PM +0100, Johan Hovold wrote:
> Hub nodes and host-controller nodes with child nodes must specify values
> for #address-cells (1) and #size-cells (0).
> 
> Also make the definition of the related reg property a bit more
> stringent, and add comments to the example source.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  Documentation/devicetree/bindings/usb/usb-device.txt | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)

I'm happy to apply patches 1-4 for 4.15 if you want.

Rob
--
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
Johan Hovold Nov. 16, 2017, 8:45 a.m. | #2
On Wed, Nov 15, 2017 at 09:46:55AM -0600, Rob Herring wrote:
> On Thu, Nov 09, 2017 at 06:07:19PM +0100, Johan Hovold wrote:
> > Hub nodes and host-controller nodes with child nodes must specify values
> > for #address-cells (1) and #size-cells (0).
> > 
> > Also make the definition of the related reg property a bit more
> > stringent, and add comments to the example source.
> > 
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/usb/usb-device.txt | 20 ++++++++++++++++----
> >  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> I'm happy to apply patches 1-4 for 4.15 if you want.

Sure, that would be great. Greg will probably base usb-next on 4.15-rc2,
and otherwise the rest of the binding updates can just go through your
tree instead.

Thanks,
Johan
--
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 Nov. 16, 2017, 2:32 p.m. | #3
On Thu, Nov 16, 2017 at 09:45:40AM +0100, Johan Hovold wrote:
> On Wed, Nov 15, 2017 at 09:46:55AM -0600, Rob Herring wrote:
> > On Thu, Nov 09, 2017 at 06:07:19PM +0100, Johan Hovold wrote:
> > > Hub nodes and host-controller nodes with child nodes must specify values
> > > for #address-cells (1) and #size-cells (0).
> > > 
> > > Also make the definition of the related reg property a bit more
> > > stringent, and add comments to the example source.
> > > 
> > > Signed-off-by: Johan Hovold <johan@kernel.org>
> > > ---
> > >  Documentation/devicetree/bindings/usb/usb-device.txt | 20 ++++++++++++++++----
> > >  1 file changed, 16 insertions(+), 4 deletions(-)
> > 
> > I'm happy to apply patches 1-4 for 4.15 if you want.
> 
> Sure, that would be great. Greg will probably base usb-next on 4.15-rc2,
> and otherwise the rest of the binding updates can just go through your
> tree instead.

1-4 applied.

Rob
--
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

Patch

diff --git a/Documentation/devicetree/bindings/usb/usb-device.txt b/Documentation/devicetree/bindings/usb/usb-device.txt
index e0b562e35a0c..1b27cebb47f4 100644
--- a/Documentation/devicetree/bindings/usb/usb-device.txt
+++ b/Documentation/devicetree/bindings/usb/usb-device.txt
@@ -4,22 +4,34 @@  Usually, we only use device tree for hard wired USB device.
 The reference binding doc is from:
 http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
 
+
 Required properties:
 - compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
   The textual representation of VID and PID shall be in lower case hexadecimal
   with leading zeroes suppressed. The other compatible strings from the above
   standard binding could also be used, but a device adhering to this binding
   may leave out all except for "usbVID,PID".
-- reg: the port number which this device is connecting to, the range
-  is 1-255.
+- reg: the number of the USB hub port or the USB host-controller port to which
+  this device is attached. The range is 1-255.
+
+
+Required properties for hub nodes with device nodes:
+- #address-cells: shall be 1
+- #size-cells: shall be 0
+
+
+Required properties for host-controller nodes with device nodes:
+- #address-cells: shall be 1
+- #size-cells: shall be 0
+
 
 Example:
 
-&usb1 {
+&usb1 {	/* host controller */
 	#address-cells = <1>;
 	#size-cells = <0>;
 
-	hub@1 {
+	hub@1 {	/* hub connected to port 1 */
 		compatible = "usb5e3,608";
 		reg = <1>;
 	};