Merge branch 'develop-3.10' of ssh://10.10.10.29/rk/kernel into develop-3.10
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-p977.dts
1 /dts-v1/;
2
3 #include "rk3288.dtsi"
4 #include "lcd-LP097Qx1.dtsi"
5
6 / {
7         fiq-debugger {
8                 status = "okay";
9         };
10
11         5v_power_en {
12         compatible = "5v_en";
13                 5ven,pin =<&gpio7 GPIO_B4 GPIO_ACTIVE_HIGH>;    // 5v power for otg and hdmi
14                 status = "okay";        
15         };
16
17
18     wireless-wlan {
19         compatible = "wlan-platdata";
20
21         wifi_chip_type = "";
22         sdio_vref = <1800>; //1800mv or 3300mv
23
24         //power_ctrl_by_pmu;
25         pmu_regulator = "act_ldo3";
26         pmu_enable_level = <1>; //1->HIGH, 0->LOW
27
28         WIFI,poweren_gpio = <&gpio4 GPIO_D4 GPIO_ACTIVE_HIGH>;
29         WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
30         //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
31
32         status = "okay";
33     };
34
35     wireless-bluetooth {
36         compatible = "bluetooth-platdata";
37
38         uart_rts_gpios = <&gpio4 GPIO_C3 GPIO_ACTIVE_LOW>;
39         pinctrl-names = "default","rts_gpio";
40         pinctrl-0 = <&uart0_rts>;
41         pinctrl-1 = <&uart0_rts_gpio>;
42
43         //BT,power_gpio = <&gpio4 GPIO_D3 GPIO_ACTIVE_HIGH>;
44         BT,reset_gpio = <&gpio4 GPIO_D5 GPIO_ACTIVE_HIGH>;
45         BT,wake_gpio = <&gpio4 GPIO_D2 GPIO_ACTIVE_HIGH>;
46         BT,wake_host_irq = <&gpio4 GPIO_D7 GPIO_ACTIVE_LOW>;
47
48         status = "okay";
49     };
50
51     hallsensor {
52                compatible = "hall_och165t";
53                type = <SENSOR_TYPE_HALL>;
54                irq-gpio = <&gpio0 GPIO_A6 IRQ_TYPE_EDGE_BOTH>;
55      };
56
57         backlight {
58                 compatible = "pwm-backlight";
59                 pwms = <&pwm0 0 25000>;
60                 brightness-levels = <255 255 254 254 253 253 252 252 251 251 250 250 249 249 248 248 247 247 246 246 245 245 244 244 243 243 242 242 241 241 240 240
61 239 239 238 238 237 237 236 236 235 235 234 234 233 233 232 232 231 231 230 230 229 229 228 228 227 227 226 226 225 225
62 224 224 223 223 222 222 221 221 220 220 219 219 218 218 217 217 216 216 215 215 214 214 213 213 212 212 211 211 210 210
63 209 209 208 208 207 207 206 206 205 205 204 204 203 203 202 202 201 201 200 200 199 199 198 198 197 197 196 196 195 195
64 194 194 193 193 192 192 191 191 190 190 189 189 188 188 187 187 186 186 185 185 184 184 183 183 182 182 181 181 180 180
65 179 179 178 178 177 177 176 176 175 175 174 174 173 173 172 172 171 171 170 170 169 169 168 168 167 167 166 166 165 165 
66 164 164 163 163 162 162 161 161 160 160 159 159 158 158 157 157 156 156 155 155 154 154 153 153 152 152 151 151 150 150
67 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150
68 150 150 150 150 150 150 150 150 150 150 150 150 150 150>;
69                 default-brightness-level = <20>;
70                 enable-gpios = <&gpio7 GPIO_A2 GPIO_ACTIVE_HIGH>;
71         };
72
73         pwm_regulator {
74                 compatible = "rockchip_pwm_regulator";
75                 pwms = <&pwm1 0 25000>;
76                 rockchip,pwm_id= <1>;
77                 rockchip,pwm_voltage_map= <925000 950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000>;
78                 rockchip,pwm_voltage= <1000000>;
79                 rockchip,pwm_min_voltage= <925000>;
80                 rockchip,pwm_max_voltage= <1400000>;
81                 rockchip,pwm_suspend_voltage= <950000>;
82                 rockchip,pwm_coefficient= <475>;
83                 regulators {
84                         #address-cells = <1>;
85                         #size-cells = <0>;
86                         pwm_reg0: regulator@0 {
87                                 regulator-compatible = "pwm_dcdc1";
88                                 regulator-name= "vdd_logic";
89                                 regulator-min-microvolt = <925000>;
90                                 regulator-max-microvolt = <1400000>;
91                                 regulator-always-on;
92                                 regulator-boot-on;
93                         };
94                 };
95         };
96
97         codec_hdmi_i2s: codec-hdmi-i2s {
98                 compatible = "hdmi-i2s";
99         };
100
101         codec_hdmi_spdif: codec-hdmi-spdif {
102                 compatible = "hdmi-spdif";
103         };
104
105         rockchip-hdmi-i2s {
106                 compatible = "rockchip-hdmi-i2s";
107                 dais {
108                         dai0 {
109                                 audio-codec = <&codec_hdmi_i2s>;
110                                 i2s-controller = <&i2s>;
111                                 format = "i2s";
112                                 //continuous-clock;
113                                 //bitclock-inversion;
114                                 //frame-inversion;
115                                 //bitclock-master;
116                                 //frame-master;
117                         };
118                 };
119         };
120         
121         rockchip-hdmi-spdif {
122                 compatible = "rockchip-hdmi-spdif";
123                 dais {
124                         dai0 {
125                                 audio-codec = <&codec_hdmi_spdif>;
126                                 i2s-controller = <&spdif>;
127                         };
128                 };              
129         };
130
131         rockchip-rt5631 {
132                 compatible = "rockchip-rt5631";
133                 dais {
134                         dai0 {
135                                 audio-codec = <&rt5631>;
136                                 i2s-controller = <&i2s>;
137                                 format = "i2s";
138                                 //continuous-clock;
139                                 //bitclock-inversion;
140                                 //frame-inversion;
141                                 //bitclock-master;
142                                 //frame-master;
143                         };
144                 };
145         };
146
147         usb_control {
148                 compatible = "rockchip,rk3288-usb-control";
149
150                 otg_drv_gpio = <&gpio0 GPIO_B4 GPIO_ACTIVE_LOW>;
151
152                 rockchip,remote_wakeup;
153                 rockchip,usb_irq_wakeup;
154         };
155 };
156 &pinctrl {
157         gpio0_gpio {
158                         gpio0_c2: gpio0-c2 {
159                                 rockchip,pins = <GPIO0_C2>;
160                                 rockchip,pull = <VALUE_PULL_DOWN>;
161                         };
162
163                         //to add
164                 };
165                 
166         gpio7_gpio {
167                         gpio7_b7: gpio7-b7 {
168                                 rockchip,pins = <GPIO7_B7>;
169                                 rockchip,pull = <VALUE_PULL_UP>;
170                         };
171
172                         //to add
173                 };
174         //could add other pinctrl definition such as gpio
175
176 };
177
178 &emmc {
179         clock-frequency = <150000000>;
180         clock-freq-min-max = <400000 150000000>;
181
182         supports-highspeed;
183         supports-emmc;
184         bootpart-no-access;
185
186         supports-DDR_MODE;
187         caps2-mmc-hs200;
188
189         ignore-pm-notify;
190                 keep-power-in-suspend;
191         status = "okay";
192 };
193     
194 &sdmmc {
195         clock-frequency = <50000000>;
196         lock-freq-min-max = <400000 50000000>;              
197             
198         supports-highspeed;
199         supports-sd;
200         broken-cd;
201         card-detect-delay = <200>;
202         ignore-pm-notify;
203         keep-power-in-suspend;
204         
205         vmmc-supply = <&rk808_ldo5_reg>;
206         status = "okay";
207 };
208                 
209 &sdio {
210         clock-frequency = <50000000>;
211         clock-freq-min-max = <200000 50000000>;
212                 
213         supports-highspeed;             
214         supports-sdio;
215                 ignore-pm-notify;
216                 keep-power-in-suspend;
217                 //cap-sdio-irq;
218                 status = "okay";
219 };
220
221 &spi0 {
222         status = "okay";
223         max-freq = <48000000>;  
224         /*
225         spi_test@00 {
226                 compatible = "rockchip,spi_test_bus0_cs0";
227                 reg = <0>;
228                 spi-max-frequency = <24000000>;
229                 //spi-cpha;
230                 //spi-cpol;
231                 poll_mode = <0>;
232                 type = <0>;
233                 enable_dma = <0>;
234
235         };
236
237         spi_test@01 {
238                 compatible = "rockchip,spi_test_bus0_cs1";
239                 reg = <1>;
240                 spi-max-frequency = <24000000>;
241                 spi-cpha;
242                 spi-cpol;
243                 poll_mode = <0>;
244                 type = <0>;
245                 enable_dma = <0>;               
246         };
247         */
248 };
249
250 &spi1 {
251         status = "disabled";
252         max-freq = <48000000>;
253         /*
254         spi_test@10 {
255                 compatible = "rockchip,spi_test_bus1_cs0";
256                 reg = <0>;
257                 spi-max-frequency = <24000000>;
258                 //spi-cpha;
259                 //spi-cpol;
260                 poll_mode = <0>;
261                 type = <0>;
262                 enable_dma = <0>;
263         };
264
265         */
266 };
267
268 &spi2 {
269         status = "okay";
270         max-freq = <48000000>;
271         /*
272         spi_test@20 {
273                 compatible = "rockchip,spi_test_bus2_cs0";
274                 reg = <0>;
275                 spi-max-frequency = <24000000>;
276                 //spi-cpha;
277                 //spi-cpol;
278                 poll_mode = <0>;
279                 type = <0>;
280                 enable_dma = <0>;
281         };
282
283         spi_test@21 {
284                 compatible = "rockchip,spi_test_bus2_cs1";
285                 reg = <1>;
286                 spi-max-frequency = <24000000>;
287                 //spi-cpha;
288                 //spi-cpol;
289                 poll_mode = <0>;
290                 type = <0>;
291                 enable_dma = <0>;
292         };
293         */
294 };
295 &uart_bt {
296         status = "okay";
297         dma-names = "!tx", "!rx";
298         pinctrl-0 = <&uart0_xfer &uart0_cts>;
299 };
300
301 &i2c0 {
302         status = "okay";
303         rk808: rk808@1b {
304                 reg = <0x1b>;
305                 status = "okay";
306         };
307         
308
309
310         CW2015@62 {
311                 compatible = "cw201x";
312                 reg = <0x62>;
313                 dc_det_gpio = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
314                 bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
315                 chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
316                 bat_config_info = <0x15 0x2A 0x58 0x57 0x51 0x5F 0x4C 0x45 0x47 0x45 0x48 0x4C 0x47 0x36
317                            0x2B 0x24 0x1E 0x16 0x16 0x17 0x1D 0x28 0x3B 0x4B 0x46 0x23 0x0D 0x71
318                            0x41 0x62 0x5F 0x6E 0x6F 0x6F 0x6E 0x72 0x41 0x1B 0x30 0x22 0x01 0x21
319                            0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0x12 0x70 0x8F 0xCB
320                            0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x1F 0x21>;
321                 is_dc_charge = <1>;
322                 is_usb_charge = <0>;
323         };
324 };
325
326 &i2c1 {
327         status = "okay";
328         rtc@51 {
329                 compatible = "nxp,pcf8563";
330                 reg = <0x51>;
331         };
332         
333         sensor@1d {
334                 compatible = "gs_mma8452";
335                 reg = <0x1d>;
336                 type = <SENSOR_TYPE_ACCEL>;
337                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
338                 irq_enable = <1>;
339                 poll_delay_ms = <30>;
340                 layout = <8>;
341         };
342
343         sensor@0d {
344                 compatible = "ak8975";
345                 reg = <0x0d>;
346                 type = <SENSOR_TYPE_COMPASS>;
347                 irq-gpio = <&gpio8 GPIO_A1 IRQ_TYPE_EDGE_RISING>;
348                 irq_enable = <1>;
349                 poll_delay_ms = <30>;
350                 layout = <1>;
351         };
352
353         sensor@10 {
354               compatible = "ls_cm3218";
355               reg = <0x10>;
356               type = <SENSOR_TYPE_LIGHT>;
357               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
358               irq_enable = <1>;
359               poll_delay_ms = <30>;
360               layout = <1>;
361        };
362 /*            
363         mpu6050:mpu@68{
364         compatible = "mpu6050";
365         reg = <0x68>;
366         mpu-int_config = <0x10>;
367         mpu-level_shifter = <0>;
368         mpu-orientation = <1 0 0 0 1 0 0 0 1>;  
369         orientation-x= <1>;
370         orientation-y= <0>;
371         orientation-z= <1>;
372         irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;                 
373         mpu-debug = <0>;
374         };
375
376         ak8963:compass@0d{
377         compatible = "ak8963";
378         reg = <0x0d>;
379         compass-bus = <0>;
380         compass-adapt_num = <0>;
381         compass-orientation = <1 0 0 0 1 0 0 0 1>;
382         orientation-x= <0>;
383         orientation-y= <0>;
384         orientation-z= <1>;     
385         compass-debug = <1>;
386         status = "disabled";
387         };
388
389         ak8975:compass@0d{
390         compatible = "ak8975";
391         reg = <0x0d>;
392         compass-bus = <0>;
393         compass-adapt_num = <0>;
394         compass-orientation = <0 1 0 1 0 0 0 0 1>;
395         orientation-x= <0>;
396         orientation-y= <0>;
397         orientation-z= <0>;     
398         compass-debug = <0>;
399         };
400 */
401 };
402
403 &i2c2 {
404         status = "okay";
405
406         rt5631: rt5631@1a {
407                 compatible = "rt5631";
408                 reg = <0x1a>;
409                 phone_det_level = <1>;
410         };
411         
412 };
413
414 &i2c3 {
415         status = "okay";
416 };
417
418 &i2c4 {
419         status = "okay";
420         ts@01 {
421                 compatible = "ct,vtl_ts";
422                 reg = <0x01>;
423                 screen_max_x = <2048>;
424                 screen_max_y = <1536>;
425                 irq_gpio_number = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
426                 rst_gpio_number = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
427         };
428 };
429
430 &i2c5 {
431         status = "disable";
432 };
433
434 &fb {
435         rockchip,disp-mode = <DUAL>;
436 };
437
438 &rk_screen {
439          display-timings = <&disp_timings>;
440 };
441
442 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
443 &lcdc1 {
444         status = "okay";
445         power_ctr: power_ctr {
446                 rockchip,debug = <0>;
447                 rockchip,mirror = <NO_MIRROR>;
448                 /*
449                 lcd_en:lcd_en {
450                         rockchip,power_type = <GPIO>;
451                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
452                         rockchip,delay = <10>;
453                 };
454                 */
455                 /*lcd_cs:lcd_cs {
456                         rockchip,power_type = <REGULATOR>;
457                         rockchip,delay = <10>;
458                 };
459
460                 lcd_rst:lcd_rst {
461                         rockchip,power_type = <GPIO>;
462                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
463                         rockchip,delay = <5>;
464                 };*/
465
466         };
467 };
468
469 &lcdc0 {
470         status = "okay";
471 };
472
473 &hdmi {
474         status = "okay";
475         rockchips,hdmi_audio_source = <0>;
476 };
477
478 &adc {
479         status = "okay";
480
481
482         key {
483                 compatible = "rockchip,key";
484                 io-channels = <&adc 1>;
485
486                 vol-up-key {
487                         linux,code = <115>;
488                         label = "volume up";
489                         rockchip,adc_value = <1>;
490                 };
491
492                 vol-down-key {
493                         linux,code = <114>;
494                         label = "volume down";
495                         rockchip,adc_value = <170>;
496                 };
497
498                 power-key {
499                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
500                         linux,code = <116>;
501                         label = "power";
502                         gpio-key,wakeup;
503                 };
504
505                 back-key {
506                         linux,code = <158>;
507                         label = "back";
508                         rockchip,adc_value = <355>;
509                 };
510 /*
511                 home-key {
512                         linux,code = <102>;
513                         label = "home";
514                         rockchip,adc_value = <746>;
515                 };
516
517                 back-key {
518                         linux,code = <158>;
519                         label = "back";
520                         rockchip,adc_value = <560>;
521                 };
522 */
523                 camera-key {
524                         linux,code = <212>;
525                         label = "camera";
526                         rockchip,adc_value = <450>;
527                 };
528         };
529 };
530
531 &pwm0 {
532         status = "okay";
533 };
534
535 &pwm1 {
536         status = "okay";
537 };
538
539
540 &clk_core_dvfs_table {
541         operating-points = <
542                 /* KHz    uV */
543                 126000 850000
544                 216000 850000
545                 312000 850000
546                 408000 850000
547                 600000 850000
548                 696000 900000
549                 816000 950000
550                 1008000 1000000
551                 1200000 1050000
552                 1416000 1150000
553                 1512000 1200000
554                 1608000 1250000
555                 1704000 1300000
556                 1800000 1350000
557                 >;
558         status="okay";
559 };
560
561 &clk_gpu_dvfs_table {
562         operating-points = <
563                 /* KHz    uV */
564                 100000 850000
565                 200000 850000
566                 300000 900000
567                 400000 1000000
568                 500000 1100000
569         //      600000 1250000
570                 >;
571         status="okay";
572 };
573
574 &clk_ddr_dvfs_table {
575         operating-points = <
576                 /* KHz    uV */
577                 200000 1050000
578                 300000 1050000
579                 400000 1050000
580                 533000 1050000
581                 >;
582
583         freq-table = <
584                 /*status                freq(KHz)*/
585                 SYS_STATUS_NORMAL       400000
586                 SYS_STATUS_SUSPEND      200000
587                 SYS_STATUS_VIDEO        300000
588                 SYS_STATUS_DUALVIEW     500000
589                 SYS_STATUS_BOOST        324000
590                 >;
591         auto-freq-table = <
592                 240000
593                 324000
594                 396000
595                 528000
596                 >;
597         auto-freq=<1>;
598         status="okay";
599 };
600
601 /include/ "rk808.dtsi"
602 &rk808 {
603         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_A0 GPIO_ACTIVE_LOW>;
604         rk808,system-power-controller;
605
606         regulators {
607                 
608                 rk808_dcdc1_reg: regulator@0{
609                         regulator-name= "vdd_arm";
610                         regulator-always-on;
611                         regulator-boot-on;
612                 };
613
614                 rk808_dcdc2_reg: regulator@1 {
615                         regulator-name= "vdd_gpu";
616                         regulator-always-on;
617                         regulator-boot-on;
618                 };
619
620                 rk808_dcdc3_reg: regulator@2 {
621                         regulator-name= "rk_dcdc3";
622                         regulator-min-microvolt = <1200000>;
623                         regulator-max-microvolt = <1200000>;
624                         regulator-always-on;
625                         regulator-boot-on;
626                 };
627
628                 rk808_dcdc4_reg: regulator@3 {
629                         regulator-name= "vccio";
630                         regulator-min-microvolt = <1800000>;
631                         regulator-max-microvolt = <3300000>;
632                         regulator-always-on;
633                         regulator-boot-on;
634                 };
635
636                 rk808_ldo1_reg: regulator@4 {
637                         regulator-name= "rk_ldo1";
638                         regulator-min-microvolt = <3300000>;
639                         regulator-max-microvolt = <3300000>;
640                         regulator-always-on;
641                         regulator-boot-on;
642                 };
643
644                 rk808_ldo2_reg: regulator@5 {
645                         regulator-name= "rk_ldo2";
646                         regulator-min-microvolt = <3300000>;
647                         regulator-max-microvolt = <3300000>;
648                         regulator-always-on;
649                         regulator-boot-on;
650                 };
651
652                 rk808_ldo3_reg: regulator@6 {
653                         regulator-name= "rk_ldo3";
654                         regulator-min-microvolt = <1000000>;
655                         regulator-max-microvolt = <1000000>;
656                         regulator-always-on;
657                         regulator-boot-on;
658                 };
659
660                 rk808_ldo4_reg:regulator@7 {
661                         regulator-name= "rk_ldo4";
662                         regulator-min-microvolt = <1800000>;
663                         regulator-max-microvolt = <1800000>;
664                         regulator-always-on;
665                         regulator-boot-on;
666                 };
667
668                 rk808_ldo5_reg: regulator@8 {
669                         regulator-name= "vcc_sd";
670                         regulator-min-microvolt = <1800000>;
671                         regulator-max-microvolt = <3300000>;
672                         regulator-always-on;
673                         regulator-boot-on;
674                 };
675
676                 rk808_ldo6_reg: regulator@9 {
677                         regulator-name= "rk_ldo6";
678                         regulator-min-microvolt = <1000000>;
679                         regulator-max-microvolt = <1000000>;
680                         regulator-always-on;
681                         regulator-boot-on;
682                 };
683
684                 rk808_ldo7_reg: regulator@10 {
685                         regulator-name= "rk_ldo7";
686                         regulator-min-microvolt = <1800000>;
687                         regulator-max-microvolt = <1800000>;
688                         regulator-always-on;
689                         regulator-boot-on;
690                 };
691
692                 rk808_ldo8_reg: regulator@11 {
693                         regulator-name= "rk_ldo8";
694                         regulator-min-microvolt = <3300000>;
695                         regulator-max-microvolt = <3300000>;
696                         regulator-always-on;
697                         regulator-boot-on;
698                 };
699
700                 rk808_ldo9_reg: regulator@12 {
701                         regulator-name= "rk_ldo9";
702                         regulator-always-on;
703                         regulator-boot-on;
704                 };
705
706                 rk808_ldo10_reg: regulator@13 {
707                         regulator-name= "rk_ldo10";
708                         regulator-always-on;
709                         regulator-boot-on;
710                 };
711         };
712 };
713
714 &lcdc_vdd_domain {
715         regulator-name = "vcc30_lcd";
716         };
717 &dpio_vdd_domain{
718         regulator-name = "vcc18_cif";   
719         };
720 &flash0_vdd_domain{
721         regulator-name = "vcc_flash";   
722         };
723 &flash1_vdd_domain{
724         regulator-name = "vcc_flash";                   
725         };
726 &apio3_vdd_domain{
727         regulator-name = "vccio_wl";            
728         };
729 &apio5_vdd_domain{
730         regulator-name = "vccio";               
731         };
732 &apio4_vdd_domain{
733         regulator-name = "vccio";               
734         };
735 &apio1_vdd_domain{
736         regulator-name = "vccio";                       
737         };
738 &apio2_vdd_domain{
739         regulator-name = "vccio";               
740         };
741 &sdmmc0_vdd_domain{
742         regulator-name = "vcc_sd";                      
743         };
744