Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/usb/usb-device.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: The device tree bindings for the Generic USB Device
0008 
0009 maintainers:
0010   - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0011 
0012 description: |
0013   Usually, we only use device tree for hard wired USB device.
0014   The reference binding doc is from:
0015   http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
0016 
0017   Four types of device-tree nodes are defined: "host-controller nodes"
0018   representing USB host controllers, "device nodes" representing USB devices,
0019   "interface nodes" representing USB interfaces and "combined nodes"
0020   representing simple USB devices.
0021 
0022   A combined node shall be used instead of a device node and an interface node
0023   for devices of class 0 or 9 (hub) with a single configuration and a single
0024   interface.
0025 
0026   A "hub node" is a combined node or an interface node that represents a USB
0027   hub.
0028 
0029 properties:
0030   compatible:
0031     pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$"
0032     description: Device nodes or combined nodes.
0033       "usbVID,PID", where VID is the vendor id and PID the product id.
0034       The textual representation of VID and PID shall be in lower case
0035       hexadecimal with leading zeroes suppressed. The other compatible
0036       strings from the above standard binding could also be used,
0037       but a device adhering to this binding may leave out all except
0038       for "usbVID,PID".
0039 
0040   reg:
0041     description: the number of the USB hub port or the USB host-controller
0042       port to which this device is attached. The range is 1-255.
0043     maxItems: 1
0044 
0045   "#address-cells":
0046     description: should be 1 for hub nodes with device nodes,
0047       should be 2 for device nodes with interface nodes.
0048     enum: [1, 2]
0049 
0050   "#size-cells":
0051     const: 0
0052 
0053 patternProperties:
0054   "^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$":
0055     type: object
0056     description: USB interface nodes.
0057       The configuration component is not included in the textual
0058       representation of an interface-node unit address for configuration 1.
0059 
0060     properties:
0061       compatible:
0062         pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$"
0063         description: Interface nodes.
0064           "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
0065           the product id, CN is the configuration value and IN is the interface
0066           number. The textual representation of VID, PID, CN and IN shall be
0067           in lower case hexadecimal with leading zeroes suppressed.
0068           The other compatible strings from the above standard binding could
0069           also be used, but a device adhering to this binding may leave out
0070           all except for "usbifVID,PID.configCN.IN".
0071 
0072       reg:
0073         description: should be 2 cells long, the first cell represents
0074           the interface number and the second cell represents the
0075           configuration value.
0076         maxItems: 1
0077 
0078 required:
0079   - compatible
0080   - reg
0081 
0082 additionalProperties: true
0083 
0084 examples:
0085   # hub connected to port 1
0086   # device connected to port 2
0087   # device connected to port 3
0088   #    interface 0 of configuration 1
0089   #    interface 0 of configuration 2
0090   - |
0091     usb@11270000 {
0092         reg = <0x11270000 0x1000>;
0093         interrupts = <0x0 0x4e 0x0>;
0094         #address-cells = <1>;
0095         #size-cells = <0>;
0096 
0097         hub@1 {
0098             compatible = "usb5e3,608";
0099             reg = <1>;
0100         };
0101 
0102         device@2 {
0103             compatible = "usb123,4567";
0104             reg = <2>;
0105         };
0106 
0107         device@3 {
0108             compatible = "usb123,abcd";
0109             reg = <3>;
0110 
0111             #address-cells = <2>;
0112             #size-cells = <0>;
0113 
0114             interface@0 {
0115                 compatible = "usbif123,abcd.config1.0";
0116                 reg = <0 1>;
0117             };
0118 
0119             interface@0,2 {
0120                 compatible = "usbif123,abcd.config2.0";
0121                 reg = <0 2>;
0122             };
0123         };
0124     };