ramips: add support for D-Link DAP-1325-A1
[openwrt/openwrt.git] / target / linux / mediatek / patches-5.10 / 171-dt-bindings-usb-convert-mediatek-musb.txt-to-YAML-sc.patch
1 From f9924caf5d952594b2d912e2ec318189ce64cf04 Mon Sep 17 00:00:00 2001
2 From: Chunfeng Yun <chunfeng.yun@mediatek.com>
3 Date: Fri, 25 Dec 2020 15:52:55 +0800
4 Subject: [PATCH] dt-bindings: usb: convert mediatek, musb.txt to YAML schema
5
6 Convert mediatek,musb.txt to YAML schema mediatek,musb.yaml
7
8 Cc: Min Guo <min.guo@mediatek.com>
9 Reviewed-by: Rob Herring <robh@kernel.org>
10 Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
11 Link: https://lore.kernel.org/r/20201225075258.33352-8-chunfeng.yun@mediatek.com
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 .../devicetree/bindings/usb/mediatek,musb.txt | 57 ---------
15 .../bindings/usb/mediatek,musb.yaml | 113 ++++++++++++++++++
16 2 files changed, 113 insertions(+), 57 deletions(-)
17 delete mode 100644 Documentation/devicetree/bindings/usb/mediatek,musb.txt
18 create mode 100644 Documentation/devicetree/bindings/usb/mediatek,musb.yaml
19
20 diff --git a/Documentation/devicetree/bindings/usb/mediatek,musb.txt b/Documentation/devicetree/bindings/usb/mediatek,musb.txt
21 deleted file mode 100644
22 index 5eedb02965622..0000000000000
23 --- a/Documentation/devicetree/bindings/usb/mediatek,musb.txt
24 +++ /dev/null
25 @@ -1,57 +0,0 @@
26 -MediaTek musb DRD/OTG controller
27 --------------------------------------------
28 -
29 -Required properties:
30 - - compatible : should be one of:
31 - "mediatek,mt2701-musb"
32 - ...
33 - followed by "mediatek,mtk-musb"
34 - - reg : specifies physical base address and size of
35 - the registers
36 - - interrupts : interrupt used by musb controller
37 - - interrupt-names : must be "mc"
38 - - phys : PHY specifier for the OTG phy
39 - - dr_mode : should be one of "host", "peripheral" or "otg",
40 - refer to usb/generic.txt
41 - - clocks : a list of phandle + clock-specifier pairs, one for
42 - each entry in clock-names
43 - - clock-names : must contain "main", "mcu", "univpll"
44 - for clocks of controller
45 -
46 -Optional properties:
47 - - power-domains : a phandle to USB power domain node to control USB's
48 - MTCMOS
49 -
50 -Required child nodes:
51 - usb connector node as defined in bindings/connector/usb-connector.yaml
52 -Optional properties:
53 - - id-gpios : input GPIO for USB ID pin.
54 - - vbus-gpios : input GPIO for USB VBUS pin.
55 - - vbus-supply : reference to the VBUS regulator, needed when supports
56 - dual-role mode
57 - - usb-role-switch : use USB Role Switch to support dual-role switch, see
58 - usb/generic.txt.
59 -
60 -Example:
61 -
62 -usb2: usb@11200000 {
63 - compatible = "mediatek,mt2701-musb",
64 - "mediatek,mtk-musb";
65 - reg = <0 0x11200000 0 0x1000>;
66 - interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
67 - interrupt-names = "mc";
68 - phys = <&u2port2 PHY_TYPE_USB2>;
69 - dr_mode = "otg";
70 - clocks = <&pericfg CLK_PERI_USB0>,
71 - <&pericfg CLK_PERI_USB0_MCU>,
72 - <&pericfg CLK_PERI_USB_SLV>;
73 - clock-names = "main","mcu","univpll";
74 - power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
75 - usb-role-switch;
76 - connector{
77 - compatible = "gpio-usb-b-connector", "usb-b-connector";
78 - type = "micro";
79 - id-gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
80 - vbus-supply = <&usb_vbus>;
81 - };
82 -};
83 diff --git a/Documentation/devicetree/bindings/usb/mediatek,musb.yaml b/Documentation/devicetree/bindings/usb/mediatek,musb.yaml
84 new file mode 100644
85 index 0000000000000..790efe8b62746
86 --- /dev/null
87 +++ b/Documentation/devicetree/bindings/usb/mediatek,musb.yaml
88 @@ -0,0 +1,113 @@
89 +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
90 +# Copyright (c) 2020 MediaTek
91 +%YAML 1.2
92 +---
93 +$id: http://devicetree.org/schemas/usb/mediatek,musb.yaml#
94 +$schema: http://devicetree.org/meta-schemas/core.yaml#
95 +
96 +title: MediaTek MUSB DRD/OTG Controller Device Tree Bindings
97 +
98 +maintainers:
99 + - Min Guo <min.guo@mediatek.com>
100 +
101 +properties:
102 + $nodename:
103 + pattern: '^usb@[0-9a-f]+$'
104 +
105 + compatible:
106 + items:
107 + - enum:
108 + - mediatek,mt2701-musb
109 + - const: mediatek,mtk-musb
110 +
111 + reg:
112 + maxItems: 1
113 +
114 + interrupts:
115 + maxItems: 1
116 +
117 + interrupt-names:
118 + items:
119 + - const: mc
120 +
121 + clocks:
122 + items:
123 + - description: The main/core clock
124 + - description: The system bus clock
125 + - description: The 48Mhz clock
126 +
127 + clock-names:
128 + items:
129 + - const: main
130 + - const: mcu
131 + - const: univpll
132 +
133 + phys:
134 + maxItems: 1
135 +
136 + usb-role-switch:
137 + $ref: /schemas/types.yaml#/definitions/flag
138 + description: Support role switch. See usb/generic.txt
139 + type: boolean
140 +
141 + dr_mode:
142 + enum:
143 + - host
144 + - otg
145 + - peripheral
146 +
147 + power-domains:
148 + description: A phandle to USB power domain node to control USB's MTCMOS
149 + maxItems: 1
150 +
151 + connector:
152 + $ref: /connector/usb-connector.yaml#
153 + description: Connector for dual role switch
154 + type: object
155 +
156 +dependencies:
157 + usb-role-switch: [ 'connector' ]
158 + connector: [ 'usb-role-switch' ]
159 +
160 +required:
161 + - compatible
162 + - reg
163 + - interrupts
164 + - interrupt-names
165 + - phys
166 + - clocks
167 + - clock-names
168 +
169 +additionalProperties: false
170 +
171 +examples:
172 + - |
173 + #include <dt-bindings/clock/mt2701-clk.h>
174 + #include <dt-bindings/gpio/gpio.h>
175 + #include <dt-bindings/interrupt-controller/arm-gic.h>
176 + #include <dt-bindings/interrupt-controller/irq.h>
177 + #include <dt-bindings/phy/phy.h>
178 + #include <dt-bindings/power/mt2701-power.h>
179 +
180 + usb@11200000 {
181 + compatible = "mediatek,mt2701-musb", "mediatek,mtk-musb";
182 + reg = <0x11200000 0x1000>;
183 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
184 + interrupt-names = "mc";
185 + phys = <&u2port2 PHY_TYPE_USB2>;
186 + dr_mode = "otg";
187 + clocks = <&pericfg CLK_PERI_USB0>,
188 + <&pericfg CLK_PERI_USB0_MCU>,
189 + <&pericfg CLK_PERI_USB_SLV>;
190 + clock-names = "main","mcu","univpll";
191 + power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
192 + usb-role-switch;
193 +
194 + connector {
195 + compatible = "gpio-usb-b-connector", "usb-b-connector";
196 + type = "micro";
197 + id-gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
198 + vbus-supply = <&usb_vbus>;
199 + };
200 + };
201 +...
202 --
203 2.32.0
204