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