UPSTREAM: ARM: dts: rockchip: add the sdio power sequence for kylin board
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3036-kylin.dts
1 /*
2  * This file is dual-licensed: you can use it either under the terms
3  * of the GPL or the X11 license, at your option. Note that this dual
4  * licensing only applies to this file, and not this project as a
5  * whole.
6  *
7  *  a) This file is free software; you can redistribute it and/or
8  *     modify it under the terms of the GNU General Public License as
9  *     published by the Free Software Foundation; either version 2 of the
10  *     License, or (at your option) any later version.
11  *
12  *     This file is distributed in the hope that it will be useful,
13  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *     GNU General Public License for more details.
16  *
17  *  Or, alternatively,
18  *
19  *  b) Permission is hereby granted, free of charge, to any person
20  *     obtaining a copy of this software and associated documentation
21  *     files (the "Software"), to deal in the Software without
22  *     restriction, including without limitation the rights to use,
23  *     copy, modify, merge, publish, distribute, sublicense, and/or
24  *     sell copies of the Software, and to permit persons to whom the
25  *     Software is furnished to do so, subject to the following
26  *     conditions:
27  *
28  *     The above copyright notice and this permission notice shall be
29  *     included in all copies or substantial portions of the Software.
30  *
31  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38  *     OTHER DEALINGS IN THE SOFTWARE.
39  */
40
41 /dts-v1/;
42
43 #include "rk3036.dtsi"
44
45 / {
46         model = "Rockchip RK3036 KylinBoard";
47         compatible = "rockchip,rk3036-kylin", "rockchip,rk3036";
48
49         sdio_pwrseq: sdio-pwrseq {
50                 compatible = "mmc-pwrseq-simple";
51                 pinctrl-names = "default";
52                 pinctrl-0 = <&bt_wake_h>;
53
54                 /*
55                  * On the module itself this is one of these (depending
56                  * on the actual card populated):
57                  * - SDIO_RESET_L_WL_REG_ON
58                  * - SDIO_RESET_L_WL_RST
59                  * - SDIO_RESET_L_BT_EN
60                  */
61                 reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>, /* WL_REG_ON */
62                               <&gpio0 27 GPIO_ACTIVE_LOW>, /* WL_RST */
63                               <&gpio2 9  GPIO_ACTIVE_LOW>; /* BT_EN */
64         };
65
66         sound {
67                 compatible = "simple-audio-card";
68                 simple-audio-card,format = "i2s";
69                 simple-audio-card,name = "rockchip,rt5616-codec";
70                 simple-audio-card,mclk-fs = <256>;
71                 simple-audio-card,widgets =
72                         "Microphone", "Microphone Jack",
73                         "Headphone", "Headphone Jack";
74                 simple-audio-card,routing =
75                         "MIC1", "Microphone Jack",
76                         "MIC2", "Microphone Jack",
77                         "Microphone Jack", "micbias1",
78                         "Headphone Jack", "HPOL",
79                         "Headphone Jack", "HPOR";
80
81                 simple-audio-card,cpu {
82                         sound-dai = <&i2s>;
83                 };
84
85                 simple-audio-card,codec {
86                         sound-dai = <&rt5616>;
87                 };
88         };
89
90         vcc_sys: vsys-regulator {
91                 compatible = "regulator-fixed";
92                 regulator-name = "vcc_sys";
93                 regulator-min-microvolt = <5000000>;
94                 regulator-max-microvolt = <5000000>;
95                 regulator-always-on;
96                 regulator-boot-on;
97         };
98 };
99
100 &acodec {
101         status = "okay";
102 };
103
104 &emmc {
105         status = "okay";
106 };
107
108 &i2c1 {
109         clock-frequency = <400000>;
110
111         status = "okay";
112
113         rk808: pmic@1b {
114                 compatible = "rockchip,rk808";
115                 reg = <0x1b>;
116                 interrupt-parent = <&gpio2>;
117                 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
118                 pinctrl-names = "default";
119                 pinctrl-0 = <&pmic_int &global_pwroff>;
120                 rockchip,system-power-controller;
121                 wakeup-source;
122                 #clock-cells = <1>;
123                 clock-output-names = "xin32k", "rk808-clkout2";
124
125                 vcc1-supply = <&vcc_sys>;
126                 vcc2-supply = <&vcc_sys>;
127                 vcc3-supply = <&vcc_sys>;
128                 vcc4-supply = <&vcc_sys>;
129                 vcc6-supply = <&vcc_sys>;
130                 vcc7-supply = <&vcc_sys>;
131                 vcc8-supply = <&vcc_18>;
132                 vcc9-supply = <&vcc_io>;
133                 vcc10-supply = <&vcc_io>;
134                 vcc11-supply = <&vcc_sys>;
135                 vcc12-supply = <&vcc_io>;
136                 vddio-supply = <&vccio_pmu>;
137
138                 regulators {
139                         vdd_cpu: DCDC_REG1 {
140                                 regulator-always-on;
141                                 regulator-boot-on;
142                                 regulator-min-microvolt = <750000>;
143                                 regulator-max-microvolt = <1350000>;
144                                 regulator-name = "vdd_arm";
145                                 regulator-state-mem {
146                                         regulator-off-in-suspend;
147                                 };
148                         };
149
150                         vdd_gpu: DCDC_REG2 {
151                                 regulator-always-on;
152                                 regulator-boot-on;
153                                 regulator-min-microvolt = <850000>;
154                                 regulator-max-microvolt = <1250000>;
155                                 regulator-name = "vdd_gpu";
156                                 regulator-state-mem {
157                                         regulator-on-in-suspend;
158                                         regulator-suspend-microvolt = <1000000>;
159                                 };
160                         };
161
162                         vcc_ddr: DCDC_REG3 {
163                                 regulator-always-on;
164                                 regulator-boot-on;
165                                 regulator-name = "vcc_ddr";
166                                 regulator-state-mem {
167                                         regulator-on-in-suspend;
168                                 };
169                         };
170
171                         vcc_io: DCDC_REG4 {
172                                 regulator-always-on;
173                                 regulator-boot-on;
174                                 regulator-min-microvolt = <3300000>;
175                                 regulator-max-microvolt = <3300000>;
176                                 regulator-name = "vcc_io";
177                                 regulator-state-mem {
178                                         regulator-on-in-suspend;
179                                         regulator-suspend-microvolt = <3300000>;
180                                 };
181                         };
182
183                         vccio_pmu: LDO_REG1 {
184                                 regulator-always-on;
185                                 regulator-boot-on;
186                                 regulator-min-microvolt = <3300000>;
187                                 regulator-max-microvolt = <3300000>;
188                                 regulator-name = "vccio_pmu";
189                                 regulator-state-mem {
190                                         regulator-on-in-suspend;
191                                         regulator-suspend-microvolt = <3300000>;
192                                 };
193                         };
194
195                         vcc_tp: LDO_REG2 {
196                                 regulator-always-on;
197                                 regulator-boot-on;
198                                 regulator-min-microvolt = <3300000>;
199                                 regulator-max-microvolt = <3300000>;
200                                 regulator-name = "vcc_tp";
201                                 regulator-state-mem {
202                                         regulator-off-in-suspend;
203                                 };
204                         };
205
206                         vdd_10: LDO_REG3 {
207                                 regulator-always-on;
208                                 regulator-boot-on;
209                                 regulator-min-microvolt = <1000000>;
210                                 regulator-max-microvolt = <1000000>;
211                                 regulator-name = "vdd_10";
212                                 regulator-state-mem {
213                                         regulator-on-in-suspend;
214                                         regulator-suspend-microvolt = <1000000>;
215                                 };
216                         };
217
218                         vcc18_lcd: LDO_REG4 {
219                                 regulator-always-on;
220                                 regulator-boot-on;
221                                 regulator-min-microvolt = <1800000>;
222                                 regulator-max-microvolt = <1800000>;
223                                 regulator-name = "vcc18_lcd";
224                                 regulator-state-mem {
225                                         regulator-on-in-suspend;
226                                         regulator-suspend-microvolt = <1800000>;
227                                 };
228                         };
229
230                         vccio_sd: LDO_REG5 {
231                                 regulator-always-on;
232                                 regulator-boot-on;
233                                 regulator-min-microvolt = <1800000>;
234                                 regulator-max-microvolt = <3300000>;
235                                 regulator-name = "vccio_sd";
236                                 regulator-state-mem {
237                                         regulator-on-in-suspend;
238                                         regulator-suspend-microvolt = <3300000>;
239                                 };
240                         };
241
242                         vout5: LDO_REG6 {
243                                 regulator-always-on;
244                                 regulator-boot-on;
245                                 regulator-min-microvolt = <1800000>;
246                                 regulator-max-microvolt = <2500000>;
247                                 regulator-name = "vout5";
248                                 regulator-state-mem {
249                                         regulator-on-in-suspend;
250                                         regulator-suspend-microvolt = <1800000>;
251                                 };
252                         };
253
254                         vcc_18: LDO_REG7 {
255                                 regulator-always-on;
256                                 regulator-boot-on;
257                                 regulator-min-microvolt = <1800000>;
258                                 regulator-max-microvolt = <1800000>;
259                                 regulator-name = "vcc_18";
260                                 regulator-state-mem {
261                                         regulator-on-in-suspend;
262                                         regulator-suspend-microvolt = <1800000>;
263                                 };
264                         };
265
266                         vcca_codec: LDO_REG8 {
267                                 regulator-always-on;
268                                 regulator-boot-on;
269                                 regulator-min-microvolt = <1800000>;
270                                 regulator-max-microvolt = <1800000>;
271                                 regulator-name = "vcca_codec";
272                                 regulator-state-mem {
273                                         regulator-on-in-suspend;
274                                         regulator-suspend-microvolt = <1800000>;
275                                 };
276                         };
277
278                         vcc_wl: SWITCH_REG1 {
279                                 regulator-always-on;
280                                 regulator-boot-on;
281                                 regulator-name = "vcc_wl";
282                                 regulator-state-mem {
283                                         regulator-on-in-suspend;
284                                 };
285                         };
286
287                         vcc_lcd: SWITCH_REG2 {
288                                 regulator-always-on;
289                                 regulator-boot-on;
290                                 regulator-name = "vcc_lcd";
291                                 regulator-state-mem {
292                                         regulator-on-in-suspend;
293                                 };
294                         };
295                 };
296         };
297 };
298
299 &i2c2 {
300         status = "okay";
301
302         rt5616: rt5616@1b {
303                 compatible = "rt5616";
304                 reg = <0x1b>;
305                 #sound-dai-cells = <0>;
306         };
307 };
308
309 &i2s {
310         #sound-dai-cells = <0>;
311         status = "okay";
312 };
313
314 &sdio {
315         status = "okay";
316
317         broken-cd;
318         bus-width = <4>;
319         cap-sd-highspeed;
320         cap-sdio-irq;
321         default-sample-phase = <90>;
322         keep-power-in-suspend;
323         mmc-pwrseq = <&sdio_pwrseq>;
324         non-removable;
325         num-slots = <1>;
326         pinctrl-names = "default";
327         pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>;
328         sd-uhs-sdr12;
329         sd-uhs-sdr25;
330         sd-uhs-sdr50;
331         sd-uhs-sdr104;
332 };
333
334 &uart0 {
335         status = "okay";
336 };
337
338 &uart2 {
339         status = "okay";
340 };
341
342 &usb_host {
343         status = "okay";
344 };
345
346 &usb_otg {
347         status = "okay";
348 };
349
350 &pinctrl {
351         pmic {
352                 pmic_int: pmic-int {
353                         rockchip,pins = <2 2 RK_FUNC_GPIO &pcfg_pull_default>;
354                 };
355         };
356
357         sdio {
358                 bt_wake_h: bt-wake-h {
359                         rockchip,pins = <2 8 RK_FUNC_GPIO &pcfg_pull_default>;
360                 };
361         };
362
363         sleep {
364                 global_pwroff: global-pwroff {
365                         rockchip,pins = <2 7 RK_FUNC_1 &pcfg_pull_none>;
366                 };
367         };
368 };