124 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2%YAML 1.23---4$id: http://devicetree.org/schemas/usb/usb-device.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Generic USB Device8 9maintainers:10 - Greg Kroah-Hartman <gregkh@linuxfoundation.org>11 12description: |13 Usually, we only use device tree for hard wired USB device.14 The reference binding doc is from:15 http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps16 17 Four types of device-tree nodes are defined: "host-controller nodes"18 representing USB host controllers, "device nodes" representing USB devices,19 "interface nodes" representing USB interfaces and "combined nodes"20 representing simple USB devices.21 22 A combined node shall be used instead of a device node and an interface node23 for devices of class 0 or 9 (hub) with a single configuration and a single24 interface.25 26 A "hub node" is a combined node or an interface node that represents a USB27 hub.28 29properties:30 compatible:31 pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$"32 description: Device nodes or combined nodes.33 "usbVID,PID", where VID is the vendor id and PID the product id.34 The textual representation of VID and PID shall be in lower case35 hexadecimal with leading zeroes suppressed. The other compatible36 strings from the above standard binding could also be used,37 but a device adhering to this binding may leave out all except38 for "usbVID,PID".39 40 reg:41 description: the number of the USB hub port or the USB host-controller42 port to which this device is attached. The range is 1-255.43 maxItems: 144 45 "#address-cells":46 description: should be 1 for hub nodes with device nodes,47 should be 2 for device nodes with interface nodes.48 enum: [1, 2]49 50 "#size-cells":51 const: 052 53patternProperties:54 "^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$":55 type: object56 description: USB interface nodes.57 The configuration component is not included in the textual58 representation of an interface-node unit address for configuration 1.59 60 properties:61 compatible:62 pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$"63 description: Interface nodes.64 "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is65 the product id, CN is the configuration value and IN is the interface66 number. The textual representation of VID, PID, CN and IN shall be67 in lower case hexadecimal with leading zeroes suppressed.68 The other compatible strings from the above standard binding could69 also be used, but a device adhering to this binding may leave out70 all except for "usbifVID,PID.configCN.IN".71 72 reg:73 description: should be 2 cells long, the first cell represents74 the interface number and the second cell represents the75 configuration value.76 maxItems: 177 78required:79 - reg80 81additionalProperties: true82 83examples:84 # hub connected to port 185 # device connected to port 286 # device connected to port 387 # interface 0 of configuration 188 # interface 0 of configuration 289 - |90 usb@11270000 {91 reg = <0x11270000 0x1000>;92 interrupts = <0x0 0x4e 0x0>;93 #address-cells = <1>;94 #size-cells = <0>;95 96 hub@1 {97 compatible = "usb5e3,608";98 reg = <1>;99 };100 101 device@2 {102 compatible = "usb123,4567";103 reg = <2>;104 };105 106 device@3 {107 compatible = "usb123,abcd";108 reg = <3>;109 110 #address-cells = <2>;111 #size-cells = <0>;112 113 interface@0 {114 compatible = "usbif123,abcd.config1.0";115 reg = <0 1>;116 };117 118 interface@0,2 {119 compatible = "usbif123,abcd.config2.0";120 reg = <0 2>;121 };122 };123 };124