162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 262306a36Sopenharmony_ci%YAML 1.2 362306a36Sopenharmony_ci--- 462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/usb/usb-device.yaml# 562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml# 662306a36Sopenharmony_ci 762306a36Sopenharmony_cititle: Generic USB Device 862306a36Sopenharmony_ci 962306a36Sopenharmony_cimaintainers: 1062306a36Sopenharmony_ci - Greg Kroah-Hartman <gregkh@linuxfoundation.org> 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_cidescription: | 1362306a36Sopenharmony_ci Usually, we only use device tree for hard wired USB device. 1462306a36Sopenharmony_ci The reference binding doc is from: 1562306a36Sopenharmony_ci http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci Four types of device-tree nodes are defined: "host-controller nodes" 1862306a36Sopenharmony_ci representing USB host controllers, "device nodes" representing USB devices, 1962306a36Sopenharmony_ci "interface nodes" representing USB interfaces and "combined nodes" 2062306a36Sopenharmony_ci representing simple USB devices. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci A combined node shall be used instead of a device node and an interface node 2362306a36Sopenharmony_ci for devices of class 0 or 9 (hub) with a single configuration and a single 2462306a36Sopenharmony_ci interface. 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci A "hub node" is a combined node or an interface node that represents a USB 2762306a36Sopenharmony_ci hub. 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ciproperties: 3062306a36Sopenharmony_ci compatible: 3162306a36Sopenharmony_ci pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$" 3262306a36Sopenharmony_ci description: Device nodes or combined nodes. 3362306a36Sopenharmony_ci "usbVID,PID", where VID is the vendor id and PID the product id. 3462306a36Sopenharmony_ci The textual representation of VID and PID shall be in lower case 3562306a36Sopenharmony_ci hexadecimal with leading zeroes suppressed. The other compatible 3662306a36Sopenharmony_ci strings from the above standard binding could also be used, 3762306a36Sopenharmony_ci but a device adhering to this binding may leave out all except 3862306a36Sopenharmony_ci for "usbVID,PID". 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci reg: 4162306a36Sopenharmony_ci description: the number of the USB hub port or the USB host-controller 4262306a36Sopenharmony_ci port to which this device is attached. The range is 1-255. 4362306a36Sopenharmony_ci maxItems: 1 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci "#address-cells": 4662306a36Sopenharmony_ci description: should be 1 for hub nodes with device nodes, 4762306a36Sopenharmony_ci should be 2 for device nodes with interface nodes. 4862306a36Sopenharmony_ci enum: [1, 2] 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci "#size-cells": 5162306a36Sopenharmony_ci const: 0 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_cipatternProperties: 5462306a36Sopenharmony_ci "^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$": 5562306a36Sopenharmony_ci type: object 5662306a36Sopenharmony_ci description: USB interface nodes. 5762306a36Sopenharmony_ci The configuration component is not included in the textual 5862306a36Sopenharmony_ci representation of an interface-node unit address for configuration 1. 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci properties: 6162306a36Sopenharmony_ci compatible: 6262306a36Sopenharmony_ci pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$" 6362306a36Sopenharmony_ci description: Interface nodes. 6462306a36Sopenharmony_ci "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is 6562306a36Sopenharmony_ci the product id, CN is the configuration value and IN is the interface 6662306a36Sopenharmony_ci number. The textual representation of VID, PID, CN and IN shall be 6762306a36Sopenharmony_ci in lower case hexadecimal with leading zeroes suppressed. 6862306a36Sopenharmony_ci The other compatible strings from the above standard binding could 6962306a36Sopenharmony_ci also be used, but a device adhering to this binding may leave out 7062306a36Sopenharmony_ci all except for "usbifVID,PID.configCN.IN". 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci reg: 7362306a36Sopenharmony_ci description: should be 2 cells long, the first cell represents 7462306a36Sopenharmony_ci the interface number and the second cell represents the 7562306a36Sopenharmony_ci configuration value. 7662306a36Sopenharmony_ci maxItems: 1 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_cirequired: 7962306a36Sopenharmony_ci - reg 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ciadditionalProperties: true 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ciexamples: 8462306a36Sopenharmony_ci # hub connected to port 1 8562306a36Sopenharmony_ci # device connected to port 2 8662306a36Sopenharmony_ci # device connected to port 3 8762306a36Sopenharmony_ci # interface 0 of configuration 1 8862306a36Sopenharmony_ci # interface 0 of configuration 2 8962306a36Sopenharmony_ci - | 9062306a36Sopenharmony_ci usb@11270000 { 9162306a36Sopenharmony_ci reg = <0x11270000 0x1000>; 9262306a36Sopenharmony_ci interrupts = <0x0 0x4e 0x0>; 9362306a36Sopenharmony_ci #address-cells = <1>; 9462306a36Sopenharmony_ci #size-cells = <0>; 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci hub@1 { 9762306a36Sopenharmony_ci compatible = "usb5e3,608"; 9862306a36Sopenharmony_ci reg = <1>; 9962306a36Sopenharmony_ci }; 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci device@2 { 10262306a36Sopenharmony_ci compatible = "usb123,4567"; 10362306a36Sopenharmony_ci reg = <2>; 10462306a36Sopenharmony_ci }; 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci device@3 { 10762306a36Sopenharmony_ci compatible = "usb123,abcd"; 10862306a36Sopenharmony_ci reg = <3>; 10962306a36Sopenharmony_ci 11062306a36Sopenharmony_ci #address-cells = <2>; 11162306a36Sopenharmony_ci #size-cells = <0>; 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci interface@0 { 11462306a36Sopenharmony_ci compatible = "usbif123,abcd.config1.0"; 11562306a36Sopenharmony_ci reg = <0 1>; 11662306a36Sopenharmony_ci }; 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci interface@0,2 { 11962306a36Sopenharmony_ci compatible = "usbif123,abcd.config2.0"; 12062306a36Sopenharmony_ci reg = <0 2>; 12162306a36Sopenharmony_ci }; 12262306a36Sopenharmony_ci }; 12362306a36Sopenharmony_ci }; 124