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

dt-bindings: usb: Convert SMSC USB3503 binding to a schema

The SMSC USB3503 USB Hub Controller is supported by Linux thanks to
its device tree binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Cc: Dongjin Kim <tobetter@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210927073514.14334-1-maxime@cerno.tech
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Maxime Ripard and committed by
Greg Kroah-Hartman
b1464dec 2abc8657

+108 -39
+108
Documentation/devicetree/bindings/usb/smsc,usb3503.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/usb/smsc,usb3503.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: SMSC USB3503 High-Speed Hub Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Dongjin Kim <tobetter@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - smsc,usb3503 16 + - smsc,usb3503a 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + connect-gpios: 22 + maxItems: 1 23 + description: > 24 + GPIO for connect 25 + 26 + intn-gpios: 27 + maxItems: 1 28 + description: > 29 + GPIO for interrupt 30 + 31 + reset-gpios: 32 + maxItems: 1 33 + description: > 34 + GPIO for reset 35 + 36 + disabled-ports: 37 + $ref: /schemas/types.yaml#/definitions/uint32-array 38 + minItems: 1 39 + maxItems: 3 40 + items: 41 + minimum: 1 42 + maximum: 3 43 + description: > 44 + Specifies the ports unused using their port number. Do not describe this 45 + property if all ports have to be enabled. 46 + 47 + initial-mode: 48 + enum: [1, 2] 49 + description: > 50 + Specifies initial mode. 1 for Hub mode, 2 for standby mode. 51 + 52 + clocks: 53 + maxItems: 1 54 + description: > 55 + Clock used for driving REFCLK signal. If not provided the driver assumes 56 + that clock signal is always available, its rate is specified by REF_SEL 57 + pins and a value from the primary reference clock frequencies table is 58 + used. 59 + 60 + clock-names: 61 + const: refclk 62 + 63 + refclk-frequency: 64 + $ref: /schemas/types.yaml#/definitions/uint32 65 + description: > 66 + Frequency of the REFCLK signal as defined by REF_SEL pins. If not 67 + provided, driver will not set rate of the REFCLK signal and assume that a 68 + value from the primary reference clock frequencies table is used. 69 + 70 + required: 71 + - compatible 72 + 73 + additionalProperties: false 74 + 75 + examples: 76 + - | 77 + i2c { 78 + #address-cells = <1>; 79 + #size-cells = <0>; 80 + 81 + usb-hub@8 { 82 + compatible = "smsc,usb3503"; 83 + reg = <0x08>; 84 + connect-gpios = <&gpx3 0 1>; 85 + disabled-ports = <2 3>; 86 + intn-gpios = <&gpx3 4 1>; 87 + reset-gpios = <&gpx3 5 1>; 88 + initial-mode = <1>; 89 + clocks = <&clks 80>; 90 + clock-names = "refclk"; 91 + }; 92 + }; 93 + 94 + - | 95 + #include <dt-bindings/gpio/gpio.h> 96 + 97 + usb-hub { 98 + /* I2C is not connected */ 99 + compatible = "smsc,usb3503"; 100 + initial-mode = <1>; /* initialize in HUB mode */ 101 + disabled-ports = <1>; 102 + intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ 103 + reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ 104 + connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ 105 + refclk-frequency = <19200000>; 106 + }; 107 + 108 + ...
-39
Documentation/devicetree/bindings/usb/usb3503.txt
··· 1 - SMSC USB3503 High-Speed Hub Controller 2 - 3 - Required properties: 4 - - compatible: Should be "smsc,usb3503" or "smsc,usb3503a". 5 - 6 - Optional properties: 7 - - reg: Specifies the i2c slave address, it is required and should be 0x08 8 - if I2C is used. 9 - - connect-gpios: Should specify GPIO for connect. 10 - - disabled-ports: Should specify the ports unused. 11 - '1' or '2' or '3' are available for this property to describe the port 12 - number. 1~3 property values are possible to be described. 13 - Do not describe this property if all ports have to be enabled. 14 - - intn-gpios: Should specify GPIO for interrupt. 15 - - reset-gpios: Should specify GPIO for reset. 16 - - initial-mode: Should specify initial mode. 17 - (1 for HUB mode, 2 for STANDBY mode) 18 - - refclk: Clock used for driving REFCLK signal (optional, if not provided 19 - the driver assumes that clock signal is always available, its 20 - rate is specified by REF_SEL pins and a value from the primary 21 - reference clock frequencies table is used). Use clocks and 22 - clock-names in order to assign it 23 - - refclk-frequency: Frequency of the REFCLK signal as defined by REF_SEL 24 - pins (optional, if not provided, driver will not set rate of the 25 - REFCLK signal and assume that a value from the primary reference 26 - clock frequencies table is used) 27 - 28 - Examples: 29 - usb3503@8 { 30 - compatible = "smsc,usb3503"; 31 - reg = <0x08>; 32 - connect-gpios = <&gpx3 0 1>; 33 - disabled-ports = <2 3>; 34 - intn-gpios = <&gpx3 4 1>; 35 - reset-gpios = <&gpx3 5 1>; 36 - initial-mode = <1>; 37 - clocks = <&clks 80>; 38 - clock-names = "refclk"; 39 - };