ARM: dts: rk322x: move the gpio_keys node from dtsi to product dts.
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-evb-rk818-mipi.dts
1 /*
2  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44 #include "rk3288-evb.dtsi"
45 #include "rk3288-android.dtsi"
46
47 / {
48         compatible = "rockchip,rk3288-evb-rk818", "rockchip,rk3288";
49
50         sdio_pwrseq: sdio-pwrseq {
51                 compatible = "mmc-pwrseq-simple";
52                 clocks = <&rk818 1>;
53                 clock-names = "ext_clock";
54
55                 /*
56                  * On the module itself this is one of these (depending
57                  * on the actual card populated):
58                  * - SDIO_RESET_L_WL_REG_ON
59                  * - PDN (power down when low)
60                  */
61                 reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
62         };
63
64         wireless-bluetooth {
65                 clocks = <&rk818 1>;
66                 clock-names = "ext_clock";
67         };
68
69         /delete-node/ sdmmc-regulator;
70
71         vcc_lcd: vcc-lcd {
72                 compatible = "regulator-fixed";
73                 enable-active-high;
74                 regulator-boot-on;
75                 gpio = <&gpio7 3 GPIO_ACTIVE_HIGH>;
76                 pinctrl-names = "default";
77                 pinctrl-0 = <&lcd_en>;
78                 regulator-name = "vcc_lcd";
79                 vin-supply = <&vcc_io>;
80         };
81 };
82
83 &cpu0 {
84         cpu0-supply = <&vdd_cpu>;
85 };
86
87 &edp_panel {
88         power-supply = <&vcc_lcd>;
89 };
90
91 &gpu {
92         status = "okay";
93         mali-supply = <&vdd_gpu>;
94 };
95
96 &hdmi_analog_sound {
97         status = "okay";
98 };
99
100 &i2c0 {
101         clock-frequency = <400000>;
102
103         vdd_cpu: syr827@40 {
104                 compatible = "silergy,syr827";
105                 reg = <0x40>;
106                 vin-supply = <&vcc_sys>;
107                 regulator-compatible = "fan53555-reg";
108                 pinctrl-0 = <&vsel1_gpio>;
109                 vsel-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
110                 regulator-name = "vdd_cpu";
111                 regulator-min-microvolt = <712500>;
112                 regulator-max-microvolt = <1500000>;
113                 regulator-ramp-delay = <1000>;
114                 fcs,suspend-voltage-selector = <1>;
115                 regulator-always-on;
116                 regulator-boot-on;
117                 regulator-initial-state = <3>;
118                 regulator-state-mem {
119                         regulator-off-in-suspend;
120                 };
121         };
122
123         rk818: pmic@1c {
124                 compatible = "rockchip,rk818";
125                 reg = <0x1c>;
126                 status = "okay";
127
128                 clock-output-names = "xin32k", "wifibt_32kin";
129                 interrupt-parent = <&gpio0>;
130                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
131                 pinctrl-names = "default";
132                 pinctrl-0 = <&pmic_int>;
133                 rockchip,system-power-controller;
134                 wakeup-source;
135                 #clock-cells = <1>;
136
137                 vcc1-supply = <&vcc_sys>;
138                 vcc2-supply = <&vcc_sys>;
139                 vcc3-supply = <&vcc_sys>;
140                 vcc4-supply = <&vcc_sys>;
141                 vcc6-supply = <&vcc_sys>;
142                 vcc7-supply = <&vcc_sys>;
143                 vcc8-supply = <&vcc_sys>;
144                 vcc9-supply = <&vcc_io>;
145
146                 regulators {
147                         vdd_logic: DCDC_REG1 {
148                                 regulator-name = "vdd_logic";
149                                 regulator-always-on;
150                                 regulator-boot-on;
151                                 regulator-min-microvolt = <800000>;
152                                 regulator-max-microvolt = <1250000>;
153                                 regulator-ramp-delay = <6001>;
154                                 regulator-state-mem {
155                                         regulator-on-in-suspend;
156                                         regulator-suspend-microvolt = <1000000>;
157                                 };
158                         };
159
160                         vdd_gpu: DCDC_REG2 {
161                                 regulator-name = "vdd_gpu";
162                                 regulator-always-on;
163                                 regulator-boot-on;
164                                 regulator-min-microvolt = <800000>;
165                                 regulator-max-microvolt = <1250000>;
166                                 regulator-ramp-delay = <6001>;
167                                 regulator-state-mem {
168                                         regulator-on-in-suspend;
169                                         regulator-suspend-microvolt = <1000000>;
170                                 };
171                         };
172
173                         vcc_ddr: DCDC_REG3 {
174                                 regulator-always-on;
175                                 regulator-boot-on;
176                                 regulator-name = "vcc_ddr";
177                                 regulator-state-mem {
178                                         regulator-on-in-suspend;
179                                 };
180                         };
181
182                         vcc_io: DCDC_REG4 {
183                                 regulator-always-on;
184                                 regulator-boot-on;
185                                 regulator-min-microvolt = <3300000>;
186                                 regulator-max-microvolt = <3300000>;
187                                 regulator-name = "vcc_io";
188                                 regulator-state-mem {
189                                         regulator-off-in-suspend;
190                                 };
191                         };
192
193                         vcca_codec: LDO_REG1 {
194                                 regulator-always-on;
195                                 regulator-boot-on;
196                                 regulator-min-microvolt = <3300000>;
197                                 regulator-max-microvolt = <3300000>;
198                                 regulator-name = "vcca_codec";
199                                 regulator-state-mem {
200                                         regulator-off-in-suspend;
201                                 };
202                         };
203
204                         vcc_tp: LDO_REG2 {
205                                 regulator-always-on;
206                                 regulator-boot-on;
207                                 regulator-min-microvolt = <3300000>;
208                                 regulator-max-microvolt = <3300000>;
209                                 regulator-name = "vcc_tp";
210                                 regulator-state-mem {
211                                         regulator-off-in-suspend;
212                                 };
213                         };
214
215                         vdd_10: LDO_REG3 {
216                                 regulator-always-on;
217                                 regulator-boot-on;
218                                 regulator-min-microvolt = <1000000>;
219                                 regulator-max-microvolt = <1000000>;
220                                 regulator-name = "vdd_10";
221                                 regulator-state-mem {
222                                         regulator-on-in-suspend;
223                                         regulator-suspend-microvolt = <1000000>;
224                                 };
225                         };
226
227                         vcc18_lcd: LDO_REG4 {
228                                 regulator-always-on;
229                                 regulator-boot-on;
230                                 regulator-min-microvolt = <1800000>;
231                                 regulator-max-microvolt = <1800000>;
232                                 regulator-name = "vcc18_lcd";
233                                 regulator-state-mem {
234                                         regulator-off-in-suspend;
235                                 };
236                         };
237
238                         vccio_pmu: LDO_REG5 {
239                                 regulator-always-on;
240                                 regulator-boot-on;
241                                 regulator-min-microvolt = <3300000>;
242                                 regulator-max-microvolt = <3300000>;
243                                 regulator-name = "vccio_pmu";
244                                 regulator-state-mem {
245                                         regulator-on-in-suspend;
246                                         regulator-suspend-microvolt = <3300000>;
247                                 };
248                         };
249
250                         vdd10_lcd: LDO_REG6 {
251                                 regulator-always-on;
252                                 regulator-boot-on;
253                                 regulator-min-microvolt = <1000000>;
254                                 regulator-max-microvolt = <1000000>;
255                                 regulator-name = "vdd10_lcd";
256                                 regulator-state-mem {
257                                         regulator-off-in-suspend;
258                                 };
259                         };
260
261                         vcc_18: LDO_REG7 {
262                                 regulator-always-on;
263                                 regulator-boot-on;
264                                 regulator-min-microvolt = <1800000>;
265                                 regulator-max-microvolt = <1800000>;
266                                 regulator-name = "vcc_18";
267                                 regulator-state-mem {
268                                         regulator-on-in-suspend;
269                                         regulator-suspend-microvolt = <1800000>;
270                                 };
271                         };
272
273                         vccio_wl: LDO_REG8 {
274                                 regulator-always-on;
275                                 regulator-boot-on;
276                                 regulator-min-microvolt = <1800000>;
277                                 regulator-max-microvolt = <3300000>;
278                                 regulator-name = "vccio_wl";
279                                 regulator-state-mem {
280                                         regulator-on-in-suspend;
281                                         regulator-suspend-microvolt = <3300000>;
282                                 };
283                         };
284
285                         vccio_sd: LDO_REG9 {
286                                 regulator-always-on;
287                                 regulator-boot-on;
288                                 regulator-min-microvolt = <1800000>;
289                                 regulator-max-microvolt = <3300000>;
290                                 regulator-name = "vccio_sd";
291                                 regulator-state-mem {
292                                         regulator-on-in-suspend;
293                                         regulator-suspend-microvolt = <3300000>;
294                                 };
295                         };
296
297                         vcc_sd: SWITCH_REG {
298                                 regulator-always-on;
299                                 regulator-boot-on;
300                                 regulator-name = "vcc_sd";
301                                 regulator-state-mem {
302                                         regulator-on-in-suspend;
303                                 };
304                         };
305                 };
306         };
307 };
308
309 &i2c1 {
310         status = "okay";
311         clock-frequency = <400000>;
312
313         mpu6050@68 {
314                 compatible = "invensense,mpu6050";
315                 status = "okay";
316                 pinctrl-names = "default";
317                 pinctrl-0 = <&mpu6050_irq_gpio>;
318                 reg = <0x68>;
319                 irq-gpio = <&gpio8 0 IRQ_TYPE_EDGE_RISING>;
320                 mpu-int_config = <0x10>;
321                 mpu-level_shifter = <0>;
322                 mpu-orientation = <0 1 0 1 0 0 0 0 1>;
323                 orientation-x= <0>;
324                 orientation-y= <1>;
325                 orientation-z= <0>;
326                 support-hw-poweroff = <1>;
327                 mpu-debug = <1>;
328         };
329 };
330
331 &lvds_panel {
332         power-supply = <&vcc_lcd>;
333 };
334
335 &mipi_dsi {
336         status = "okay";
337
338         panel: panel {
339                 compatible = "simple-panel-dsi";
340                 reg = <0>;
341                 backlight = <&backlight>;
342                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
343                 power-supply = <&vcc_lcd>;
344                 dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST)>;
345                 dsi,format = <MIPI_DSI_FMT_RGB888>;
346                 dsi,lanes = <4>;
347                 delay,prepare = <120>;
348                 delay,enable = <120>;
349                 status = "okay";
350
351                 disp_timings: display-timings {
352                         native-mode = <&timing0>;
353
354                         timing0: timing0 {
355                                 clock-frequency = <150000000>;
356                                 hactive = <1200>;
357                                 vactive = <1920>;
358                                 hback-porch = <80>;
359                                 hfront-porch = <81>;
360                                 vback-porch = <21>;
361                                 vfront-porch = <21>;
362                                 hsync-len = <10>;
363                                 vsync-len = <3>;
364                                 hsync-active = <0>;
365                                 vsync-active = <0>;
366                                 de-active = <0>;
367                                 pixelclk-active = <0>;
368                         };
369                 };
370         };
371 };
372
373 &route_mipi {
374         status = "okay";
375 };
376
377 &tsadc {
378         rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
379         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
380         pinctrl-1 = <&otp_gpio>;
381 };
382
383 &pinctrl {
384         lcd {
385                 lcd_en: lcd-en  {
386                         rockchip,pins = <7 3 RK_FUNC_GPIO &pcfg_pull_none>;
387                 };
388         };
389
390         mpu6050 {
391                 mpu6050_irq_gpio: mpu6050-irq-gpio {
392                         rockchip,pins = <8 0 RK_FUNC_GPIO &pcfg_pull_none>;
393                 };
394         };
395
396         pmic {
397                 pmic_int: pmic-int {
398                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
399                 };
400                 vsel1_gpio: vsel1-gpio {
401                         rockchip,pins = <RK_GPIO0 0 RK_FUNC_GPIO &pcfg_pull_down>;
402                 };
403         };
404 };