rk3288 spdif: spdif sound support
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-tb.dts
1 /dts-v1/;
2
3 #include "rk3288.dtsi"
4 #include "lcd-b101ew05.dtsi"
5
6 / {
7         fiq-debugger {
8                 status = "okay";
9         };
10
11     wireless-wlan {
12         compatible = "wlan-platdata";
13
14         wifi_chip_type = "";
15         sdio_vref = <28000>;
16
17         //power_ctrl_by_pmu;
18         pmu_regulator = "act_ldo3";
19         pmu_enable_level = <1>; //1->HIGH, 0->LOW
20
21         WIFI,poweren_gpio = <&gpio4 GPIO_D4 GPIO_ACTIVE_HIGH>;
22         WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
23         //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
24
25         status = "okay";
26     };
27
28     wireless-bluetooth {
29         compatible = "bluetooth-platdata";
30
31         uart_rts_gpios = <&gpio4 GPIO_C3 GPIO_ACTIVE_LOW>;
32         pinctrl-names = "default","rts_gpio";
33         pinctrl-0 = <&uart0_rts>;
34         pinctrl-1 = <&uart0_rts_gpio>;
35
36         BT,power_gpio = <&gpio4 GPIO_D3 GPIO_ACTIVE_HIGH>;
37         BT,reset_gpio = <&gpio4 GPIO_D5 GPIO_ACTIVE_HIGH>;
38         BT,wake_gpio = <&gpio4 GPIO_D2 GPIO_ACTIVE_HIGH>;
39         BT,wake_host_irq = <&gpio4 GPIO_D7 GPIO_ACTIVE_LOW>;
40
41         status = "okay";
42     };
43
44     hallsensor {
45                compatible = "hall_och165t";
46                type = <SENSOR_TYPE_HALL>;
47                irq-gpio = <&gpio0 GPIO_A6 IRQ_TYPE_EDGE_BOTH>;
48      };
49
50         backlight {
51                 compatible = "pwm-backlight";
52                 pwms = <&pwm0 0 25000>;
53                 brightness-levels = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255>;
54                 default-brightness-level = <128>;
55                 enable-gpios = <&gpio7 GPIO_A2 GPIO_ACTIVE_HIGH>;
56         };
57
58         pwm_regulator {
59                 compatible = "rockchip_pwm_regulator";
60                 pwms = <&pwm1 0 25000>;
61                 rockchip,pwm_id= <1>;
62                 rockchip,pwm_voltage_map= <925000 950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000>;
63                 rockchip,pwm_voltage= <1000000>;
64                 rockchip,pwm_min_voltage= <925000>;
65                 rockchip,pwm_max_voltage= <1400000>;
66                 rockchip,pwm_suspend_voltage= <950000>;
67                 rockchip,pwm_coefficient= <475>;
68                 regulators {
69                         #address-cells = <1>;
70                         #size-cells = <0>;
71                         pwm_reg0: regulator@0 {
72                                 regulator-compatible = "pwm_dcdc1";
73                                 regulator-name= "vdd_logic";
74                                 regulator-min-microvolt = <925000>;
75                                 regulator-max-microvolt = <1400000>;
76                                 regulator-always-on;
77                                 regulator-boot-on;
78                         };
79                 };
80         };
81
82         codec_hdmi_i2s: codec-hdmi-i2s {
83                 compatible = "hdmi-i2s";
84         };
85
86         codec_hdmi_spdif: codec-hdmi-spdif {
87                 compatible = "hdmi-spdif";
88         };
89
90         rockchip-hdmi-i2s {
91                 compatible = "rockchip-hdmi-i2s";
92                 dais {
93                         dai0 {
94                                 audio-codec = <&codec_hdmi_i2s>;
95                                 i2s-controller = <&i2s>;
96                                 format = "i2s";
97                                 //continuous-clock;
98                                 //bitclock-inversion;
99                                 //frame-inversion;
100                                 //bitclock-master;
101                                 //frame-master;
102                         };
103                 };
104         };
105         
106         rockchip-hdmi-spdif {
107                 compatible = "rockchip-hdmi-spdif";
108                 dais {
109                         dai0 {
110                                 audio-codec = <&codec_hdmi_spdif>;
111                                 i2s-controller = <&spdif>;
112                                 format = "spdif";
113                                 //continuous-clock;
114                                 //bitclock-inversion;
115                                 //frame-inversion;
116                                 //bitclock-master;
117                                 //frame-master;
118                         };
119                 };              
120         };
121
122         rockchip-rt5631 {
123                 compatible = "rockchip-rt5631";
124                 dais {
125                         dai0 {
126                                 audio-codec = <&rt5631>;
127                                 i2s-controller = <&i2s>;
128                                 format = "i2s";
129                                 //continuous-clock;
130                                 //bitclock-inversion;
131                                 //frame-inversion;
132                                 //bitclock-master;
133                                 //frame-master;
134                         };
135                 };
136         };
137
138         rockchip-rt3224 {
139                 compatible = "rockchip-rt3261";
140                 dais {
141                         dai0 {
142                                 audio-codec = <&rt3261>;
143                                 i2s-controller = <&i2s>;
144                                 format = "i2s";
145                                 //continuous-clock;
146                                 //bitclock-inversion;
147                                 //frame-inversion;
148                                 //bitclock-master;
149                                 //frame-master;
150                         };
151                         dai1 {
152                                 audio-codec = <&rt3261>;
153                                 i2s-controller = <&i2s>;
154                                 format = "i2s";
155                                 //continuous-clock;
156                                 //bitclock-inversion;
157                                 //frame-inversion;
158                                 //bitclock-master;
159                                 //frame-master;
160                         };
161                 };
162         };
163
164 };
165
166 &emmc {
167         clock-frequency = <50000000>;
168         clock-freq-min-max = <400000 50000000>;
169
170         supports-highspeed;
171         supports-emmc;
172         bootpart-no-access;
173         
174         status = "okay";
175 };
176     
177 &sdmmc {
178         clock-frequency = <50000000>;
179         lock-freq-min-max = <400000 50000000>;              
180             
181         supports-highspeed;
182         supports-sd;
183         broken-cd;
184         card-detect-delay = <200>;
185
186         
187         vmmc-supply = <&rk808_ldo5_reg>;
188         status = "disabled";
189 };
190                 
191 &sdio {
192         clock-frequency = <50000000>;
193         clock-freq-min-max = <200000 50000000>;
194                 
195         supports-highspeed;             
196         supports-sdio;
197         cap-sdio-irq;
198
199         status = "diabled";
200 };
201
202 &spi0 {
203         status = "okay";
204 };
205
206 &spi1 {
207         status = "okay";
208 };
209
210 &spi2 {
211         status = "okay";
212 };
213
214 &i2c0 {
215         status = "okay";
216         rk808: rk808@1b {
217                 reg = <0x1b>;
218                 status = "okay";
219         };
220         
221         bq24296: bq24296@6b {
222                 compatible = "ti,bq24296";
223                 reg = <0x6b>;
224                 gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>;
225                 bq24296,chg_current = <1000 500 2000>;
226                 status = "okay";
227         };
228         bq27320: bq27320@55 {
229                 compatible = "ti,bq27320";
230                 reg = <0x55>;
231         /*   gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
232                 status = "okay";
233         };
234
235         CW2015@62 {
236                 compatible = "cw201x";
237                 reg = <0x62>;
238                 dc_det_gpio = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
239                 bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
240                 chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
241                 bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58 0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
242                         0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45 0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D 0x52 0x52
243                         0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43 0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0xFF 0x7B 0xBB
244                         0xCB 0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x46 0xAE>;
245                 is_dc_charge = <1>;
246                 is_usb_charge = <0>;
247         };
248 };
249
250 &i2c1 {
251         status = "okay";
252         rtc@51 {
253                 compatible = "nxp,pcf8563";
254                 reg = <0x51>;
255         };
256         
257         sensor@1d {
258                 compatible = "gs_mma8452";
259                 reg = <0x1d>;
260                 type = <SENSOR_TYPE_ACCEL>;
261                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
262                 irq_enable = <1>;
263                 poll_delay_ms = <30>;
264                 layout = <1>;
265         };
266                 sensor@19 {
267                 compatible = "gs_lis3dh";
268                 reg = <0x19>;
269                 type = <SENSOR_TYPE_ACCEL>;
270                 irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
271                 irq_enable = <1>;
272                 poll_delay_ms = <30>;
273                 layout = <1>;
274         };
275                 sensor@0d {
276                 compatible = "ak8963";
277                 reg = <0x0d>;
278                 type = <SENSOR_TYPE_COMPASS>;
279                 irq-gpio = <&gpio8 GPIO_A2 IRQ_TYPE_EDGE_RISING>;
280                 irq_enable = <1>;
281                 poll_delay_ms = <30>;
282                 layout = <1>;
283         };
284
285                 sensor@6b {
286                 compatible = "l3g20d_gyro";
287                 reg = <0x6b>;
288                 type = <SENSOR_TYPE_GYROSCOPE>;
289                 irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_LEVEL_LOW>;
290                 irq_enable = <1>;
291                 poll_delay_ms = <30>;
292                 layout = <1>;
293         };
294         sensor@10 {
295               compatible = "ls_cm3218";
296               reg = <0x10>;
297               type = <SENSOR_TYPE_LIGHT>;
298               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
299               irq_enable = <1>;
300               poll_delay_ms = <30>;
301               layout = <1>;
302        };
303         
304 };
305
306 &i2c2 {
307         status = "okay";
308         rt5631: rt5631@1a {
309                 compatible = "rt5631";
310                 reg = <0x1a>;
311         };
312         es8323: es8323@10 {
313                 compatible = "es8323";
314                 reg = <0x10>;
315         };
316         rt3261: rt3261@1c {
317                 compatible = "rt3261";
318                 reg = <0x1c>;
319         //      codec-en-gpio = <0>;//sdk default high level
320                 spk-num= <2>;
321                 modem-input-mode = <1>;
322                 lout-to-modem_mode = <1>;
323                 spk-amplify = <2>;
324                 playback-if1-data_control = <0>;
325                 playback-if2-data_control = <0>;
326         };
327         rt5616: rt5616@1b {
328                 compatible = "rt5616";
329                 reg = <0x1b>;
330         };
331 };
332
333 &i2c3 {
334         status = "okay";
335 };
336
337 &i2c4 {
338         status = "okay";
339         ts@55 {
340                 compatible = "goodix,gt8xx";
341                 reg = <0x55>;
342                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
343                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
344                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
345                 max-x = <1280>;
346                 max-y = <800>;
347         };
348         
349         ts@01 {
350                 compatible = "ct,ct36x";
351                 reg = <0x01>;
352                 ct-model = <365>;
353                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
354                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
355                 max-x = <1280>;
356                 max-y = <800>;
357                 orientation=<1 0 0 1>;
358         };
359 };
360
361 &i2c5 {
362         status = "okay";
363 };
364
365 &fb {
366         rockchip,disp-mode = <DUAL>;
367 };
368
369 &rk_screen {
370          display-timings = <&disp_timings>;
371 };
372
373 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
374 &lcdc1 {
375         status = "okay";
376         power_ctr: power_ctr {
377                 rockchip,debug = <0>;
378                 rockchip,mirror = <NO_MIRROR>;
379                 lcd_en:lcd_en {
380                         rockchip,power_type = <GPIO>;
381                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
382                         rockchip,delay = <10>;
383                 };
384                 
385                 lcd_cs:lcd_cs {
386 rockchip,power_type = <GPIO>;
387                         gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
388                         rockchip,delay = <10>;
389                 };
390
391                 /*lcd_rst:lcd_rst {
392                         rockchip,power_type = <GPIO>;
393                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
394                         rockchip,delay = <5>;
395                 };*/
396
397         };
398 };
399
400 &lcdc0 {
401         status = "okay";
402 };
403
404 &hdmi {
405         status = "okay";
406         rockchips,hdmi_audio_source = <0>;
407 };
408
409 &adc {
410         status = "okay";
411
412         key {
413                 compatible = "rockchip,key";
414                 io-channels = <&adc 1>;
415
416                 vol-up-key {
417                         linux,code = <115>;
418                         label = "volume up";
419                         rockchip,adc_value = <1>;
420                 };
421
422                 vol-down-key {
423                         linux,code = <114>;
424                         label = "volume down";
425                         rockchip,adc_value = <170>;
426                 };
427
428                 power-key {
429                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
430                         linux,code = <116>;
431                         label = "power";
432                         gpio-key,wakeup;
433                 };
434
435                 menu-key {
436                         linux,code = <139>;
437                         label = "menu";
438                         rockchip,adc_value = <355>;
439                 };
440
441                 home-key {
442                         linux,code = <102>;
443                         label = "home";
444                         rockchip,adc_value = <746>;
445                 };
446
447                 back-key {
448                         linux,code = <158>;
449                         label = "back";
450                         rockchip,adc_value = <560>;
451                 };
452
453                 camera-key {
454                         linux,code = <212>;
455                         label = "camera";
456                         rockchip,adc_value = <450>;
457                 };
458         };
459 };
460
461 &pwm0 {
462         status = "okay";
463 };
464
465 &pwm1 {
466         status = "okay";
467 };
468
469
470 &clk_core_dvfs_table {
471         operating-points = <
472                 /* KHz    uV */
473                 312000 1100000
474                 504000 1100000
475                 816000 1100000
476                 1008000 1100000
477                 >;
478 };
479
480 &clk_gpu_dvfs_table {
481         operating-points = <
482                 /* KHz    uV */
483                 200000 1200000
484                 300000 1200000
485                 400000 1200000
486                 600000 1300000
487                 >;
488 };
489
490 &clk_ddr_dvfs_table {
491         operating-points = <
492                 /* KHz    uV */
493                 200000 1200000
494                 300000 1200000
495                 400000 1200000
496                 >;
497
498         freq_table = <
499                 /*status                freq(KHz)*/
500                 SYS_STATUS_NORMAL       400000
501                 SYS_STATUS_SUSPEND      200000
502                 SYS_STATUS_VIDEO        300000
503                 SYS_STATUS_DUALVIEW     500000
504                 >;
505 };
506
507 /include/ "rk808.dtsi"
508 &rk808 {
509         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B3 GPIO_ACTIVE_LOW>;
510
511         regulators {
512                 
513                 rk808_dcdc1_reg: regulator@0{
514                         regulator-name= "vdd_arm";
515                         regulator-always-on;
516                         regulator-boot-on;
517                 };
518
519                 rk808_dcdc2_reg: regulator@1 {
520                         regulator-name= "vdd_gpu";
521                         regulator-always-on;
522                         regulator-boot-on;
523                 };
524
525                 rk808_dcdc3_reg: regulator@2 {
526                         regulator-name= "rk_dcdc3";
527                         regulator-min-microvolt = <1200000>;
528                         regulator-max-microvolt = <1200000>;
529                         regulator-always-on;
530                         regulator-boot-on;
531                 };
532
533                 rk808_dcdc4_reg: regulator@3 {
534                         regulator-name= "vccio";
535                         regulator-min-microvolt = <1800000>;
536                         regulator-max-microvolt = <3300000>;
537                         regulator-always-on;
538                         regulator-boot-on;
539                 };
540
541                 rk808_ldo1_reg: regulator@4 {
542                         regulator-name= "rk_ldo1";
543                         regulator-min-microvolt = <3300000>;
544                         regulator-max-microvolt = <3300000>;
545                         regulator-always-on;
546                         regulator-boot-on;
547                 };
548
549                 rk808_ldo2_reg: regulator@5 {
550                         regulator-name= "rk_ldo2";
551                         regulator-min-microvolt = <3300000>;
552                         regulator-max-microvolt = <3300000>;
553                         regulator-always-on;
554                         regulator-boot-on;
555                 };
556
557                 rk808_ldo3_reg: regulator@6 {
558                         regulator-name= "rk_ldo3";
559                         regulator-min-microvolt = <1000000>;
560                         regulator-max-microvolt = <1000000>;
561                         regulator-always-on;
562                         regulator-boot-on;
563                 };
564
565                 rk808_ldo4_reg:regulator@7 {
566                         regulator-name= "rk_ldo4";
567                         regulator-min-microvolt = <1800000>;
568                         regulator-max-microvolt = <1800000>;
569                         regulator-always-on;
570                         regulator-boot-on;
571                 };
572
573                 rk808_ldo5_reg: regulator@8 {
574                         regulator-name= "rk_ldo5";
575                         regulator-min-microvolt = <3300000>;
576                         regulator-max-microvolt = <3300000>;
577                         regulator-always-on;
578                         regulator-boot-on;
579                 };
580
581                 rk808_ldo6_reg: regulator@9 {
582                         regulator-name= "rk_ldo6";
583                         regulator-min-microvolt = <1000000>;
584                         regulator-max-microvolt = <1000000>;
585                         regulator-always-on;
586                         regulator-boot-on;
587                 };
588
589                 rk808_ldo7_reg: regulator@10 {
590                         regulator-name= "rk_ldo7";
591                         regulator-min-microvolt = <1800000>;
592                         regulator-max-microvolt = <1800000>;
593                         regulator-always-on;
594                         regulator-boot-on;
595                 };
596
597                 rk808_ldo8_reg: regulator@11 {
598                         regulator-name= "rk_ldo8";
599                         regulator-min-microvolt = <3300000>;
600                         regulator-max-microvolt = <3300000>;
601                         regulator-always-on;
602                         regulator-boot-on;
603                 };
604         };
605 };