arm64: dts: rockchip: move more common nodes to rk3368-android
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3368-tb.dtsi
1 /*
2  * Copyright (c) 2015 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 #include <dt-bindings/pwm/pwm.h>
44 #include "rk3368.dtsi"
45 #include "rk3368-android.dtsi"
46
47 / {
48         compatible = "rockchip,tb", "rockchip,rk3368";
49
50         sound {
51                 compatible = "simple-audio-card";
52                 simple-audio-card,format = "i2s";
53                 simple-audio-card,name = "rockchip,rt5640-codec";
54                 simple-audio-card,mclk-fs = <256>;
55                 simple-audio-card,widgets =
56                         "Microphone", "Mic Jack",
57                         "Headphone", "Headphone Jack";
58                 simple-audio-card,routing =
59                         "Mic Jack", "MICBIAS1",
60                         "IN1P", "Mic Jack",
61                         "Headphone Jack", "HPOL",
62                         "Headphone Jack", "HPOR";
63                 simple-audio-card,cpu {
64                         sound-dai = <&i2s_8ch>;
65                 };
66                 simple-audio-card,codec {
67                         sound-dai = <&rt5640>;
68                 };
69         };
70
71         backlight: backlight {
72                 compatible = "pwm-backlight";
73                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
74                 brightness-levels = <
75                           0   1   2   3   4   5   6   7
76                           8   9  10  11  12  13  14  15
77                          16  17  18  19  20  21  22  23
78                          24  25  26  27  28  29  30  31
79                          32  33  34  35  36  37  38  39
80                          40  41  42  43  44  45  46  47
81                          48  49  50  51  52  53  54  55
82                          56  57  58  59  60  61  62  63
83                          64  65  66  67  68  69  70  71
84                          72  73  74  75  76  77  78  79
85                          80  81  82  83  84  85  86  87
86                          88  89  90  91  92  93  94  95
87                          96  97  98  99 100 101 102 103
88                         104 105 106 107 108 109 110 111
89                         112 113 114 115 116 117 118 119
90                         120 121 122 123 124 125 126 127
91                         128 129 130 131 132 133 134 135
92                         136 137 138 139 140 141 142 143
93                         144 145 146 147 148 149 150 151
94                         152 153 154 155 156 157 158 159
95                         160 161 162 163 164 165 166 167
96                         168 169 170 171 172 173 174 175
97                         176 177 178 179 180 181 182 183
98                         184 185 186 187 188 189 190 191
99                         192 193 194 195 196 197 198 199
100                         200 201 202 203 204 205 206 207
101                         208 209 210 211 212 213 214 215
102                         216 217 218 219 220 221 222 223
103                         224 225 226 227 228 229 230 231
104                         232 233 234 235 236 237 238 239
105                         240 241 242 243 244 245 246 247
106                         248 249 250 251 252 253 254 255>;
107                 default-brightness-level = <200>;
108                 enable-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
109         };
110
111         rk_key: rockchip-key {
112                 compatible = "rockchip,key";
113                 status = "disabled";
114
115                 io-channels = <&saradc 1>;
116
117                 vol-up-key {
118                         linux,code = <115>;
119                         label = "volume up";
120                         rockchip,adc_value = <1>;
121                 };
122
123                 vol-down-key {
124                         linux,code = <114>;
125                         label = "volume down";
126                         rockchip,adc_value = <170>;
127                 };
128
129                 power-key {
130                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
131                         linux,code = <116>;
132                         label = "power";
133                         gpio-key,wakeup;
134                 };
135
136                 menu-key {
137                         linux,code = <59>;
138                         label = "menu";
139                         rockchip,adc_value = <355>;
140                 };
141
142                 home-key {
143                         linux,code = <102>;
144                         label = "home";
145                         rockchip,adc_value = <746>;
146                 };
147
148                 back-key {
149                         linux,code = <158>;
150                         label = "back";
151                         rockchip,adc_value = <560>;
152                 };
153
154                 camera-key {
155                         linux,code = <212>;
156                         label = "camera";
157                         rockchip,adc_value = <450>;
158                 };
159         };
160
161         vcc_sys: vcc-sys {
162                 compatible = "regulator-fixed";
163                 regulator-name = "vcc_sys";
164                 regulator-always-on;
165                 regulator-boot-on;
166                 regulator-min-microvolt = <3800000>;
167                 regulator-max-microvolt = <3800000>;
168         };
169 };
170
171 &emmc {
172         bus-width = <8>;
173         cap-mmc-highspeed;
174         supports-emmc;
175         disable-wp;
176         non-removable;
177         num-slots = <1>;
178         pinctrl-names = "default";
179         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
180         status = "okay";
181 };
182
183 &sdmmc {
184         clock-frequency = <37500000>;
185         clock-freq-min-max = <400000 37500000>;
186         supports-sd;
187         cap-mmc-highspeed;
188         cap-sd-highspeed;
189         card-detect-delay = <200>;
190         disable-wp;
191         num-slots = <1>;
192         pinctrl-names = "default";
193         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
194         status = "disabled";
195 };
196
197 &i2c0 {
198         status = "okay";
199
200         syr827: syr827@40 {
201                 compatible = "silergy,syr827";
202                 status = "disabled";
203                 reg = <0x40>;
204
205                 regulator-compatible = "fan53555-reg";
206                 regulator-name = "vdd_arm";
207                 regulator-min-microvolt = <712500>;
208                 regulator-max-microvolt = <1500000>;
209                 fcs,suspend-voltage-selector = <1>;
210                 regulator-always-on;
211                 regulator-boot-on;
212                 regulator-initial-state = <3>;
213                 regulator-state-mem {
214                         regulator-off-in-suspend;
215                         regulator-suspend-microvolt = <900000>;
216                 };
217         };
218
219         syr828: syr828@41 {
220                 compatible = "silergy,syr828";
221                 status = "disabled";
222                 reg = <0x41>;
223
224                 regulator-compatible = "fan53555-reg";
225                 regulator-name = "vdd_gpu";
226                 regulator-min-microvolt = <712500>;
227                 regulator-max-microvolt = <1500000>;
228                 fcs,suspend-voltage-selector = <1>;
229                 regulator-always-on;
230                 regulator-boot-on;
231                 regulator-initial-state = <3>;
232                 regulator-state-mem {
233                         regulator-on-in-suspend;
234                         regulator-suspend-microvolt = <900000>;
235                 };
236         };
237
238         act8846: act8846@5a {
239                 /*
240                  * Note: u-boot ONLY match old compatible,
241                  * it's better to add both instances here.
242                  */
243                 compatible = "act,act8846", "active-semi,act8846";
244                 status = "disabled";
245                 reg = <0x5a>;
246                 system-power-controller;
247
248                 regulators {
249                         act8846_reg1: REG1 {
250                                 regulator-name = "VCC_DDR";
251                                 regulator-min-microvolt = <1200000>;
252                                 regulator-max-microvolt = <1200000>;
253                                 regulator-always-on;
254                         };
255
256                         act8846_reg2: REG2 {
257                                 regulator-name = "VCC_IO";
258                                 regulator-min-microvolt = <3300000>;
259                                 regulator-max-microvolt = <3300000>;
260                                 regulator-always-on;
261                         };
262
263                         act8846_reg3: REG3 {
264                                 regulator-name = "VDD_LOG";
265                                 regulator-min-microvolt = <700000>;
266                                 regulator-max-microvolt = <1500000>;
267                                 regulator-always-on;
268                         };
269
270                         act8846_reg4: REG4 {
271                                 regulator-name = "VCC_20";
272                                 regulator-min-microvolt = <2000000>;
273                                 regulator-max-microvolt = <2000000>;
274                                 regulator-always-on;
275                         };
276
277                         act8846_reg5: REG5 {
278                                 regulator-name = "VCCIO_SD";
279                                 regulator-min-microvolt = <1800000>;
280                                 regulator-max-microvolt = <3300000>;
281                                 regulator-always-on;
282                         };
283
284                         act8846_reg6: REG6 {
285                                 regulator-name = "VDD10_LCD";
286                                 regulator-min-microvolt = <1000000>;
287                                 regulator-max-microvolt = <1000000>;
288                                 regulator-always-on;
289                         };
290
291                         act8846_reg7: REG7 {
292                                 regulator-name = "VCCA_CODEC";
293                                 regulator-min-microvolt = <3300000>;
294                                 regulator-max-microvolt = <3300000>;
295                                 regulator-always-on;
296                         };
297
298                         act8846_reg8: REG8 {
299                                 regulator-name = "VCCA_TP";
300                                 regulator-min-microvolt = <3300000>;
301                                 regulator-max-microvolt = <3300000>;
302                                 regulator-always-on;
303                         };
304
305                         act8846_reg9: REG9 {
306                                 regulator-name = "VCCIO_PMU";
307                                 regulator-min-microvolt = <3300000>;
308                                 regulator-max-microvolt = <3300000>;
309                                 regulator-always-on;
310                         };
311
312                         act8846_reg10: REG10 {
313                                 regulator-name = "VDD_10";
314                                 regulator-min-microvolt = <1000000>;
315                                 regulator-max-microvolt = <1000000>;
316                                 regulator-always-on;
317                         };
318
319                         act8846_reg11: REG11 {
320                                 regulator-name = "VCC_18";
321                                 regulator-min-microvolt = <1800000>;
322                                 regulator-max-microvolt = <1800000>;
323                                 regulator-always-on;
324                         };
325
326                         act8846_reg12: REG12 {
327                                 regulator-name = "VCC18_LCD";
328                                 regulator-min-microvolt = <1800000>;
329                                 regulator-max-microvolt = <1800000>;
330                                 regulator-always-on;
331                         };
332                 };
333         };
334
335         rk818: pmic@1c {
336                 compatible = "rockchip,rk818";
337                 status = "disabled";
338                 reg = <0x1c>;
339                 clock-output-names = "xin32k", "wifibt_32kin";
340                 interrupt-parent = <&gpio0>;
341                 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
342                 pinctrl-names = "default";
343                 pinctrl-0 = <&pmic_int_l>;
344                 rockchip,system-power-controller;
345                 wakeup-source;
346                 #clock-cells = <1>;
347
348                 vcc1-supply = <&vcc_sys>;
349                 vcc2-supply = <&vcc_sys>;
350                 vcc3-supply = <&vcc_sys>;
351                 vcc4-supply = <&vcc_sys>;
352                 vcc6-supply = <&vcc_sys>;
353                 vcc7-supply = <&vcc_sys>;
354                 vcc8-supply = <&vcc_sys>;
355                 vcc9-supply = <&vcc_io>;
356
357                 regulators {
358                         vdd_logic: DCDC_REG1 {
359                                 regulator-name = "vdd_logic";
360                                 regulator-always-on;
361                                 regulator-boot-on;
362                                 regulator-min-microvolt = <750000>;
363                                 regulator-max-microvolt = <1450000>;
364                                 regulator-ramp-delay = <6001>;
365                                 regulator-state-mem {
366                                         regulator-on-in-suspend;
367                                         regulator-suspend-microvolt = <1000000>;
368                                 };
369                         };
370
371                         vdd_gpu: DCDC_REG2 {
372                                 regulator-name = "vdd_gpu";
373                                 regulator-always-on;
374                                 regulator-boot-on;
375                                 regulator-min-microvolt = <800000>;
376                                 regulator-max-microvolt = <1250000>;
377                                 regulator-ramp-delay = <6001>;
378                                 regulator-state-mem {
379                                         regulator-on-in-suspend;
380                                         regulator-suspend-microvolt = <1000000>;
381                                 };
382                         };
383
384                         vcc_ddr: DCDC_REG3 {
385                                 regulator-always-on;
386                                 regulator-boot-on;
387                                 regulator-name = "vcc_ddr";
388                                 regulator-state-mem {
389                                         regulator-on-in-suspend;
390                                 };
391                         };
392
393                         vcc_io: DCDC_REG4 {
394                                 regulator-always-on;
395                                 regulator-boot-on;
396                                 regulator-min-microvolt = <3300000>;
397                                 regulator-max-microvolt = <3300000>;
398                                 regulator-name = "vcc_io";
399                                 regulator-state-mem {
400                                         regulator-on-in-suspend;
401                                         regulator-suspend-microvolt = <3300000>;
402                                 };
403                         };
404
405                         vcca_codec: LDO_REG1 {
406                                 regulator-always-on;
407                                 regulator-boot-on;
408                                 regulator-min-microvolt = <3300000>;
409                                 regulator-max-microvolt = <3300000>;
410                                 regulator-name = "vcca_codec";
411                                 regulator-state-mem {
412                                         regulator-on-in-suspend;
413                                         regulator-suspend-microvolt = <3300000>;
414                                 };
415                         };
416
417                         vcc_tp: LDO_REG2 {
418                                 regulator-boot-on;
419                                 regulator-min-microvolt = <3000000>;
420                                 regulator-max-microvolt = <3000000>;
421                                 regulator-name = "vcc_tp";
422                                 regulator-state-mem {
423                                         regulator-off-in-suspend;
424                                 };
425                         };
426
427                         vdd_10: LDO_REG3 {
428                                 regulator-always-on;
429                                 regulator-boot-on;
430                                 regulator-min-microvolt = <1000000>;
431                                 regulator-max-microvolt = <1000000>;
432                                 regulator-name = "vdd_10";
433                                 regulator-state-mem {
434                                         regulator-on-in-suspend;
435                                         regulator-suspend-microvolt = <1000000>;
436                                 };
437                         };
438
439                         vcc18_lcd: LDO_REG4 {
440                                 regulator-always-on;
441                                 regulator-boot-on;
442                                 regulator-min-microvolt = <1800000>;
443                                 regulator-max-microvolt = <1800000>;
444                                 regulator-name = "vcc18_lcd";
445                                 regulator-state-mem {
446                                         regulator-on-in-suspend;
447                                         regulator-suspend-microvolt = <1800000>;
448                                 };
449                         };
450
451                         vccio_pmu: LDO_REG5 {
452                                 regulator-always-on;
453                                 regulator-boot-on;
454                                 regulator-min-microvolt = <1800000>;
455                                 regulator-max-microvolt = <1800000>;
456                                 regulator-name = "vccio_pmu";
457                                 regulator-state-mem {
458                                         regulator-on-in-suspend;
459                                         regulator-suspend-microvolt = <1800000>;
460                                 };
461                         };
462
463                         vdd10_lcd: LDO_REG6 {
464                                 regulator-always-on;
465                                 regulator-boot-on;
466                                 regulator-min-microvolt = <1000000>;
467                                 regulator-max-microvolt = <1000000>;
468                                 regulator-name = "vdd10_lcd";
469                                 regulator-state-mem {
470                                         regulator-on-in-suspend;
471                                         regulator-suspend-microvolt = <1000000>;
472                                 };
473                         };
474
475                         vcc_18: LDO_REG7 {
476                                 regulator-always-on;
477                                 regulator-boot-on;
478                                 regulator-min-microvolt = <1800000>;
479                                 regulator-max-microvolt = <1800000>;
480                                 regulator-name = "vcc_18";
481                                 regulator-state-mem {
482                                         regulator-on-in-suspend;
483                                         regulator-suspend-microvolt = <1800000>;
484                                 };
485                         };
486
487                         vccio_wl: LDO_REG8 {
488                                 regulator-always-on;
489                                 regulator-boot-on;
490                                 regulator-min-microvolt = <1800000>;
491                                 regulator-max-microvolt = <3300000>;
492                                 regulator-name = "vccio_wl";
493                                 regulator-state-mem {
494                                         regulator-on-in-suspend;
495                                         regulator-suspend-microvolt = <3300000>;
496                                 };
497                         };
498
499                         vccio_sd: LDO_REG9 {
500                                 regulator-always-on;
501                                 regulator-boot-on;
502                                 regulator-min-microvolt = <1800000>;
503                                 regulator-max-microvolt = <3300000>;
504                                 regulator-name = "vccio_sd";
505                                 regulator-state-mem {
506                                         regulator-on-in-suspend;
507                                         regulator-suspend-microvolt = <3300000>;
508                                 };
509                         };
510
511                         vcc_sd: SWITCH_REG {
512                                 regulator-always-on;
513                                 regulator-boot-on;
514                                 regulator-name = "vcc_sd";
515                                 regulator-state-mem {
516                                         regulator-on-in-suspend;
517                                 };
518                         };
519                 };
520         };
521
522 };
523
524 &i2c1 {
525         status = "okay";
526
527         rt5640: rt5640@1c {
528                 #sound-dai-cells = <0>;
529                 compatible = "realtek,rt5640";
530                 reg = <0x1c>;
531                 clocks = <&cru SCLK_I2S_8CH_OUT>;
532                 clock-names = "mclk";
533                 realtek,in1-differential;
534                 status = "disabled";
535         };
536 };
537
538 &i2c2 {
539         status = "okay";
540
541         gt911: gt911@14 {
542                 compatible = "goodix,gt911";
543                 reg = <0x14>;
544                 interrupt-parent = <&gpio0>;
545                 interrupts = <12 0>;
546                 status = "disabled";
547         };
548
549         gt9xx: gt9xx@14 {
550                 compatible = "goodix,gt9xx";
551                 reg = <0x14>;
552                 touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
553                 reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
554                 max-x = <1200>;
555                 max-y = <1900>;
556                 tp-size = <911>;
557                 status = "disabled";
558                 tp-supply = <&vcc_tp>;
559         };
560 };
561
562 &i2s_8ch {
563         status = "okay";
564         rockchip,i2s-broken-burst-len;
565         rockchip,playback-channels = <8>;
566         rockchip,capture-channels = <2>;
567         #sound-dai-cells = <0>;
568 };
569
570 &io_domains {
571         status = "okay";
572
573         dvp-supply = <&vcc_18>;
574         audio-supply = <&vcc_io>;
575         gpio30-supply = <&vcc_io>;
576         gpio1830-supply = <&vcc_io>;
577         sdcard-supply = <&vccio_sd>;
578         wifi-supply = <&vccio_wl>;
579 };
580
581 &pmu_io_domains {
582         status = "okay";
583
584         pmu-supply = <&vcc_io>;
585         vop-supply = <&vcc_io>;
586 };
587
588 &pwm0 {
589         status = "okay";
590 };
591
592 &uart2 {
593         status = "okay";
594 };
595
596 &fb {
597         status = "okay";
598         rockchip,disp-mode = <NO_DUAL>;
599         rockchip,uboot-logo-on = <0>;
600 };
601
602 &lcdc {
603         status = "okay";
604         backlight = <&backlight>;
605         rockchip,mirror = <NO_MIRROR>;
606         rockchip,cabc_mode = <0>;
607         rockchip,fb-win-map = <FB_DEFAULT_ORDER>;
608         power_ctr: power_ctr {
609                 rockchip,debug = <0>;
610                 lcd_en: lcd-en {
611                         rockchip,power_type = <GPIO>;
612                         gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;/*GPIO_C6 = 22*/
613                         rockchip,delay = <10>;
614                 };
615
616                 lcd_cs: lcd-cs {
617                         rockchip,power_type = <GPIO>;
618                         gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;/*GPIO_C5 = 21*/
619                         rockchip,delay = <10>;
620                 };
621
622                 /*lcd_rst: lcd-rst {
623                         rockchip,power_type = <GPIO>;
624                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
625                         rockchip,delay = <5>;
626                 };*/
627         };
628 };
629
630 &lvds {
631         pinctrl-names = "lcdc", "sleep";
632         pinctrl-0 = <&lcdc_lcdc>;
633         pinctrl-1 = <&lcdc_gpio>;
634         status = "disabled";
635 };
636
637 &rga {
638         status = "okay";
639 };
640
641 &saradc {
642         status = "okay";
643 };
644
645 &vopb_mmu {
646         status = "okay";
647 };
648
649 &pinctrl {
650         pmic {
651                 pmic_int_l: pmic-int-l {
652                         rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
653                 };
654         };
655 };