xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/usb/usb-device.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunGeneric USB Device Properties
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunUsually, we only use device tree for hard wired USB device.
4*4882a593SmuzhiyunThe reference binding doc is from:
5*4882a593Smuzhiyunhttp://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunFour types of device-tree nodes are defined: "host-controller nodes"
8*4882a593Smuzhiyunrepresenting USB host controllers, "device nodes" representing USB devices,
9*4882a593Smuzhiyun"interface nodes" representing USB interfaces and "combined nodes"
10*4882a593Smuzhiyunrepresenting simple USB devices.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunA combined node shall be used instead of a device node and an interface node
13*4882a593Smuzhiyunfor devices of class 0 or 9 (hub) with a single configuration and a single
14*4882a593Smuzhiyuninterface.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunA "hub node" is a combined node or an interface node that represents a USB
17*4882a593Smuzhiyunhub.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunRequired properties for device nodes:
21*4882a593Smuzhiyun- compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
22*4882a593Smuzhiyun  The textual representation of VID and PID shall be in lower case hexadecimal
23*4882a593Smuzhiyun  with leading zeroes suppressed. The other compatible strings from the above
24*4882a593Smuzhiyun  standard binding could also be used, but a device adhering to this binding
25*4882a593Smuzhiyun  may leave out all except for "usbVID,PID".
26*4882a593Smuzhiyun- reg: the number of the USB hub port or the USB host-controller port to which
27*4882a593Smuzhiyun  this device is attached. The range is 1-255.
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunRequired properties for device nodes with interface nodes:
31*4882a593Smuzhiyun- #address-cells: shall be 2
32*4882a593Smuzhiyun- #size-cells: shall be 0
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunRequired properties for interface nodes:
36*4882a593Smuzhiyun- compatible: "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
37*4882a593Smuzhiyun  the product id, CN is the configuration value and IN is the interface
38*4882a593Smuzhiyun  number. The textual representation of VID, PID, CN and IN shall be in lower
39*4882a593Smuzhiyun  case hexadecimal with leading zeroes suppressed. The other compatible
40*4882a593Smuzhiyun  strings from the above standard binding could also be used, but a device
41*4882a593Smuzhiyun  adhering to this binding may leave out all except for
42*4882a593Smuzhiyun  "usbifVID,PID.configCN.IN".
43*4882a593Smuzhiyun- reg: the interface number and configuration value
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunThe configuration component is not included in the textual representation of
46*4882a593Smuzhiyunan interface-node unit address for configuration 1.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunRequired properties for combined nodes:
50*4882a593Smuzhiyun- compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
51*4882a593Smuzhiyun  The textual representation of VID and PID shall be in lower case hexadecimal
52*4882a593Smuzhiyun  with leading zeroes suppressed. The other compatible strings from the above
53*4882a593Smuzhiyun  standard binding could also be used, but a device adhering to this binding
54*4882a593Smuzhiyun  may leave out all except for "usbVID,PID".
55*4882a593Smuzhiyun- reg: the number of the USB hub port or the USB host-controller port to which
56*4882a593Smuzhiyun  this device is attached. The range is 1-255.
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun
59*4882a593SmuzhiyunRequired properties for hub nodes with device nodes:
60*4882a593Smuzhiyun- #address-cells: shall be 1
61*4882a593Smuzhiyun- #size-cells: shall be 0
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun
64*4882a593SmuzhiyunRequired properties for host-controller nodes with device nodes:
65*4882a593Smuzhiyun- #address-cells: shall be 1
66*4882a593Smuzhiyun- #size-cells: shall be 0
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunExample:
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun&usb1 {	/* host controller */
72*4882a593Smuzhiyun	#address-cells = <1>;
73*4882a593Smuzhiyun	#size-cells = <0>;
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun	hub@1 {		/* hub connected to port 1 */
76*4882a593Smuzhiyun		compatible = "usb5e3,608";
77*4882a593Smuzhiyun		reg = <1>;
78*4882a593Smuzhiyun	};
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun	device@2 {	/* device connected to port 2 */
81*4882a593Smuzhiyun		compatible = "usb123,4567";
82*4882a593Smuzhiyun		reg = <2>;
83*4882a593Smuzhiyun	};
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun	device@3 { 	/* device connected to port 3 */
86*4882a593Smuzhiyun		compatible = "usb123,abcd";
87*4882a593Smuzhiyun		reg = <3>;
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun		#address-cells = <2>;
90*4882a593Smuzhiyun		#size-cells = <0>;
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun		interface@0 {	/* interface 0 of configuration 1 */
93*4882a593Smuzhiyun			compatible = "usbif123,abcd.config1.0";
94*4882a593Smuzhiyun			reg = <0 1>;
95*4882a593Smuzhiyun		};
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun		interface@0,2 {	/* interface 0 of configuration 2 */
98*4882a593Smuzhiyun			compatible = "usbif123,abcd.config2.0";
99*4882a593Smuzhiyun			reg = <0 2>;
100*4882a593Smuzhiyun		};
101*4882a593Smuzhiyun	};
102*4882a593Smuzhiyun};
103