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