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