]> git.baikalelectronics.ru Git - kernel.git/commit
USB: add device-tree support for interfaces
authorJohan Hovold <johan@kernel.org>
Thu, 9 Nov 2017 17:07:21 +0000 (18:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 14:12:38 +0000 (15:12 +0100)
commit8d24d52c2185c6be8f9d5cce7db555977a132235
tree71cf2ea665a76fdd6c9e87dbf5c6581be21e952e
parentecf87da3359627e0e77117a038d6a386d3fbc32f
USB: add device-tree support for interfaces

Add OF device-tree support for USB interfaces.

USB "interface nodes" are children of USB "device nodes" and are
identified by an interface number and a configuration value:

&usb1 { /* host controller */
dev1: device@1 { /* device at port 1 */
compatible = "usb1234,5678";
reg = <1>;

#address-cells = <2>;
#size-cells = <0>;

interface@0,2 { /* interface 0 of configuration 2 */
compatible = "usbif1234,5678.config2.0";
reg = <0 2>;
};
};
};

The configuration component is not included in the textual
representation of an interface-node unit address for configuration 1:

&dev1 {
interface@0 { /* interface 0 of configuration 1 */
compatible = "usbif1234,5678.config1.0";
reg = <0 1>;
};
};

When a USB device of class 0 or 9 (hub) has only a single configuration
with a single interface, a special case "combined node" is used instead
of a device node with an interface node:

&usb1 {
device@2 {
compatible = "usb1234,abcd";
reg = <2>;
};
};

Combined nodes are shared by the two device structures representing the
USB device and its interface in the kernel's device model.

Note that, as for device nodes, the compatible strings for interface
nodes are currently not used.

For more details see "Open Firmware Recommended Practice: Universal
Serial Bus Version 1" and the binding documentation.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/message.c
drivers/usb/core/of.c
include/linux/usb/of.h