Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: usb: usb251xb: Convert to YAML schema

Convert the usb251xb hub DT bindings from text to yaml schema so it is
possible to validate DTs against the schema.

Adjust the example to describe two different hubs at different I2C bus
addresses, to avoid I2C address collission in the example.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20221107134248.21899-1-marex@denx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Marek Vasut and committed by
Greg Kroah-Hartman
fff61d4c afb21a51

+271 -89
-89
Documentation/devicetree/bindings/usb/usb251xb.txt
··· 1 - Microchip USB 2.0 Hi-Speed Hub Controller 2 - 3 - The device node for the configuration of a Microchip USB251x/xBi USB 2.0 4 - Hi-Speed Controller. 5 - 6 - Required properties : 7 - - compatible : Should be "microchip,usb251xb" or one of the specific types: 8 - "microchip,usb2512b", "microchip,usb2512bi", "microchip,usb2513b", 9 - "microchip,usb2513bi", "microchip,usb2514b", "microchip,usb2514bi", 10 - "microchip,usb2517", "microchip,usb2517i", "microchip,usb2422" 11 - - reg : I2C address on the selected bus (default is <0x2C>) 12 - 13 - Optional properties : 14 - - reset-gpios : Should specify the gpio for hub reset 15 - - vdd-supply : Should specify the phandle to the regulator supplying vdd 16 - - skip-config : Skip Hub configuration, but only send the USB-Attach command 17 - - vendor-id : Set USB Vendor ID of the hub (16 bit, default is 0x0424) 18 - - product-id : Set USB Product ID of the hub (16 bit, default depends on type) 19 - - device-id : Set USB Device ID of the hub (16 bit, default is 0x0bb3) 20 - - language-id : Set USB Language ID (16 bit, default is 0x0000) 21 - - manufacturer : Set USB Manufacturer string (max 31 characters long) 22 - - product : Set USB Product string (max 31 characters long) 23 - - serial : Set USB Serial string (max 31 characters long) 24 - - {bus,self}-powered : selects between self- and bus-powered operation 25 - (boolean, default is self-powered) 26 - - disable-hi-speed : disable USB Hi-Speed support (boolean) 27 - - {multi,single}-tt : selects between multi- and single-transaction-translator 28 - (boolean, default is multi-tt) 29 - - disable-eop : disable End of Packet generation in full-speed mode (boolean) 30 - - {ganged,individual}-sensing : select over-current sense type in self-powered 31 - mode (boolean, default is individual) 32 - - {ganged,individual}-port-switching : select port power switching mode 33 - (boolean, default is individual) 34 - - dynamic-power-switching : enable auto-switching from self- to bus-powered 35 - operation if the local power source is removed or unavailable (boolean) 36 - - oc-delay-us : Delay time (in microseconds) for filtering the over-current 37 - sense inputs. Valid values are 100, 4000, 8000 (default) and 16000. If 38 - an invalid value is given, the default is used instead. 39 - - compound-device : indicate the hub is part of a compound device (boolean) 40 - - port-mapping-mode : enable port mapping mode (boolean) 41 - - led-{usb,speed}-mode : led usb/speed indication mode selection 42 - (boolean, default is speed mode) 43 - - string-support : enable string descriptor support (required for manufacturer, 44 - product and serial string configuration) 45 - - non-removable-ports : Should specify the ports which have a non-removable 46 - device connected. 47 - - sp-disabled-ports : Specifies the ports which will be self-power disabled 48 - - bp-disabled-ports : Specifies the ports which will be bus-power disabled 49 - - sp-max-total-current-microamp: Specifies max current consumed by the hub 50 - from VBUS when operating in self-powered hub. It includes the hub 51 - silicon along with all associated circuitry including a permanently 52 - attached peripheral (range: 0 - 100000 uA, default 1000 uA) 53 - - bp-max-total-current-microamp: Specifies max current consumed by the hub 54 - from VBUS when operating in self-powered hub. It includes the hub 55 - silicon along with all associated circuitry including a permanently 56 - attached peripheral (range: 0 - 510000 uA, default 100000 uA) 57 - - sp-max-removable-current-microamp: Specifies max current consumed by the hub 58 - from VBUS when operating in self-powered hub. It includes the hub 59 - silicon along with all associated circuitry excluding a permanently 60 - attached peripheral (range: 0 - 100000 uA, default 1000 uA) 61 - - bp-max-removable-current-microamp: Specifies max current consumed by the hub 62 - from VBUS when operating in self-powered hub. It includes the hub 63 - silicon along with all associated circuitry excluding a permanently 64 - attached peripheral (range: 0 - 510000 uA, default 100000 uA) 65 - - power-on-time-ms : Specifies the time it takes from the time the host 66 - initiates the power-on sequence to a port until the port has adequate 67 - power. The value is given in ms in a 0 - 510 range (default is 100ms). 68 - - swap-dx-lanes : Specifies the ports which will swap the differential-pair 69 - (D+/D-), default is not-swapped. 70 - 71 - Examples: 72 - usb2512b@2c { 73 - compatible = "microchip,usb2512b"; 74 - reg = <0x2c>; 75 - reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; 76 - }; 77 - 78 - usb2514b@2c { 79 - compatible = "microchip,usb2514b"; 80 - reg = <0x2c>; 81 - vendor-id = /bits/ 16 <0x0000>; 82 - product-id = /bits/ 16 <0x0000>; 83 - string-support; 84 - manufacturer = "Foo"; 85 - product = "Foo-Bar"; 86 - serial = "1234567890A"; 87 - /* correct misplaced usb connectors on port 1,2 */ 88 - swap-dx-lanes = <1 2>; 89 - };
+271
Documentation/devicetree/bindings/usb/usb251xb.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/usb/usb251xb.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Microchip USB 2.0 Hi-Speed Hub Controller 8 + 9 + maintainers: 10 + - Richard Leitner <richard.leitner@skidata.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - microchip,usb2422 16 + - microchip,usb2512b 17 + - microchip,usb2512bi 18 + - microchip,usb2513b 19 + - microchip,usb2513bi 20 + - microchip,usb2514b 21 + - microchip,usb2514bi 22 + - microchip,usb2517 23 + - microchip,usb2517i 24 + - microchip,usb251xb 25 + 26 + reg: 27 + maxItems: 1 28 + 29 + reset-gpios: 30 + description: | 31 + Should specify the gpio for hub reset 32 + 33 + vdd-supply: 34 + description: | 35 + Should specify the phandle to the regulator supplying vdd 36 + 37 + skip-config: 38 + $ref: /schemas/types.yaml#/definitions/flag 39 + description: | 40 + Skip Hub configuration, but only send the USB-Attach command 41 + 42 + vendor-id: 43 + $ref: /schemas/types.yaml#/definitions/uint16 44 + default: 0x0424 45 + description: | 46 + Set USB Vendor ID of the hub 47 + 48 + product-id: 49 + $ref: /schemas/types.yaml#/definitions/uint16 50 + description: | 51 + Set USB Product ID of the hub 52 + 53 + device-id: 54 + $ref: /schemas/types.yaml#/definitions/uint16 55 + default: 0x0bb3 56 + description: | 57 + Set USB Device ID of the hub 58 + 59 + language-id: 60 + $ref: /schemas/types.yaml#/definitions/uint16 61 + default: 0x0000 62 + description: | 63 + Set USB Language ID 64 + 65 + manufacturer: 66 + $ref: /schemas/types.yaml#/definitions/string 67 + description: | 68 + Set USB Manufacturer string (max 31 characters long) 69 + 70 + product: 71 + $ref: /schemas/types.yaml#/definitions/string 72 + description: | 73 + Set USB Product string (max 31 characters long) 74 + 75 + serial: 76 + $ref: /schemas/types.yaml#/definitions/string 77 + description: | 78 + Set USB Serial string (max 31 characters long) 79 + 80 + bus-powered: 81 + $ref: /schemas/types.yaml#/definitions/flag 82 + description: | 83 + selects between self- and bus-powered operation 84 + (boolean, default is self-powered) 85 + 86 + self-powered: 87 + $ref: /schemas/types.yaml#/definitions/flag 88 + description: | 89 + selects between self- and bus-powered operation 90 + (boolean, default is self-powered) 91 + 92 + disable-hi-speed: 93 + $ref: /schemas/types.yaml#/definitions/flag 94 + description: | 95 + disable USB Hi-Speed support (boolean) 96 + 97 + multi-tt: 98 + $ref: /schemas/types.yaml#/definitions/flag 99 + description: | 100 + selects between multi- and single-transaction-translator 101 + (boolean, default is multi-tt) 102 + 103 + single-tt: 104 + $ref: /schemas/types.yaml#/definitions/flag 105 + description: | 106 + selects between multi- and single-transaction-translator 107 + (boolean, default is multi-tt) 108 + 109 + disable-eop: 110 + $ref: /schemas/types.yaml#/definitions/flag 111 + description: | 112 + disable End of Packet generation in full-speed mode (boolean) 113 + 114 + ganged-sensing: 115 + $ref: /schemas/types.yaml#/definitions/flag 116 + description: | 117 + select over-current sense type in self-powered mode 118 + (boolean, default is individual) 119 + 120 + individual-sensing: 121 + $ref: /schemas/types.yaml#/definitions/flag 122 + description: | 123 + select over-current sense type in self-powered mode 124 + (boolean, default is individual) 125 + 126 + ganged-port-switching: 127 + $ref: /schemas/types.yaml#/definitions/flag 128 + description: | 129 + select port power switching mode (boolean, default is individual) 130 + 131 + individual-port-switching: 132 + $ref: /schemas/types.yaml#/definitions/flag 133 + description: | 134 + select port power switching mode (boolean, default is individual) 135 + 136 + dynamic-power-switching: 137 + $ref: /schemas/types.yaml#/definitions/flag 138 + description: | 139 + enable auto-switching from self- to bus-powered operation if the 140 + local power source is removed or unavailable (boolean) 141 + 142 + oc-delay-us: 143 + enum: [100, 4000, 8000, 16000] 144 + default: 8000 145 + description: | 146 + Delay time (in microseconds) for filtering the over-current sense 147 + inputs. If an invalid value is given, the default is used instead. 148 + 149 + compound-device: 150 + $ref: /schemas/types.yaml#/definitions/flag 151 + description: | 152 + indicate the hub is part of a compound device (boolean) 153 + 154 + port-mapping-mode: 155 + $ref: /schemas/types.yaml#/definitions/flag 156 + description: | 157 + enable port mapping mode (boolean) 158 + 159 + led-usb-mode: 160 + $ref: /schemas/types.yaml#/definitions/flag 161 + description: | 162 + led usb/speed indication mode selection (boolean, default is speed mode) 163 + 164 + led-speed-mode: 165 + $ref: /schemas/types.yaml#/definitions/flag 166 + description: | 167 + led usb/speed indication mode selection (boolean, default is speed mode) 168 + 169 + string-support: 170 + $ref: /schemas/types.yaml#/definitions/flag 171 + description: | 172 + enable string descriptor support (required for manufacturer, product 173 + and serial string configuration) 174 + 175 + non-removable-ports: 176 + $ref: /schemas/types.yaml#/definitions/uint8-array 177 + description: | 178 + Should specify the ports which have a non-removable device connected. 179 + 180 + sp-disabled-ports: 181 + $ref: /schemas/types.yaml#/definitions/uint8-array 182 + description: | 183 + Specifies the ports which will be self-power disabled 184 + 185 + bp-disabled-ports: 186 + $ref: /schemas/types.yaml#/definitions/uint8-array 187 + description: | 188 + Specifies the ports which will be bus-power disabled 189 + 190 + sp-max-total-current-microamp: 191 + maximum: 100000 192 + default: 1000 193 + description: | 194 + Specifies max current consumed by the hub from VBUS when 195 + operating in self-powered hub. It includes the hub silicon 196 + along with all associated circuitry including a permanently 197 + attached peripheral. 198 + 199 + bp-max-total-current-microamp: 200 + maximum: 510000 201 + default: 100000 202 + description: | 203 + Specifies max current consumed by the hub from VBUS when 204 + operating in self-powered hub. It includes the hub silicon 205 + along with all associated circuitry including a permanently 206 + attached peripheral. 207 + 208 + sp-max-removable-current-microamp: 209 + maximum: 100000 210 + default: 1000 211 + description: | 212 + Specifies max current consumed by the hub from VBUS when 213 + operating in self-powered hub. It includes the hub silicon 214 + along with all associated circuitry excluding a permanently 215 + attached peripheral. 216 + 217 + bp-max-removable-current-microamp: 218 + maximum: 510000 219 + default: 100000 220 + description: | 221 + Specifies max current consumed by the hub from VBUS when 222 + operating in self-powered hub. It includes the hub silicon 223 + along with all associated circuitry excluding a permanently 224 + attached peripheral. 225 + 226 + power-on-time-ms: 227 + maximum: 510 228 + default: 100 229 + description: | 230 + Specifies the time it takes from the time the host initiates the 231 + power-on sequence to a port until the port has adequate power. 232 + 233 + swap-dx-lanes: 234 + $ref: /schemas/types.yaml#/definitions/uint8-array 235 + description: | 236 + Specifies the ports which will swap the differential-pair (D+/D-), 237 + default is not-swapped. 238 + 239 + additionalProperties: false 240 + 241 + required: 242 + - compatible 243 + - reg 244 + 245 + examples: 246 + - | 247 + #include <dt-bindings/gpio/gpio.h> 248 + 249 + i2c { 250 + #address-cells = <1>; 251 + #size-cells = <0>; 252 + 253 + usb-hub@2c { 254 + compatible = "microchip,usb2512b"; 255 + reg = <0x2c>; 256 + reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; 257 + }; 258 + 259 + usb-hub@2d { 260 + compatible = "microchip,usb2514b"; 261 + reg = <0x2d>; 262 + vendor-id = /bits/ 16 <0x0000>; 263 + product-id = /bits/ 16 <0x0000>; 264 + string-support; 265 + manufacturer = "Foo"; 266 + product = "Foo-Bar"; 267 + serial = "1234567890A"; 268 + /* correct misplaced usb connectors on port 1,2 */ 269 + swap-dx-lanes = <1 2>; 270 + }; 271 + };