Revert "pwm-backlight: support invert-brightness function"
[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 &gmac {
166 //      power_ctl_by = "gpio";  //"gpio" "pmu"
167         power-gpio = <&gpio0 GPIO_A6 GPIO_ACTIVE_HIGH>;
168 //      power-pmu = "act_ldo"
169         reset-gpio = <&gpio4 GPIO_A7 GPIO_ACTIVE_HIGH>;
170 };
171
172 &pinctrl {
173
174         gpio7_gpio {
175                         gpio7_b7: gpio7-b7 {
176                                 rockchip,pins = <GPIO7_B7>;
177                                 rockchip,pull = <VALUE_PULL_UP>;
178                         };
179
180                         //to add
181                 };
182
183         //could add other pinctrl definition such as gpio
184
185 };
186
187 &emmc {
188         clock-frequency = <50000000>;
189         clock-freq-min-max = <400000 50000000>;
190
191         supports-highspeed;
192         supports-emmc;
193         bootpart-no-access;
194         
195         status = "okay";
196 };
197     
198 &sdmmc {
199         clock-frequency = <50000000>;
200         lock-freq-min-max = <400000 50000000>;              
201             
202         supports-highspeed;
203         supports-sd;
204         broken-cd;
205         card-detect-delay = <200>;
206
207         
208         vmmc-supply = <&rk808_ldo5_reg>;
209         status = "disabled";
210 };
211                 
212 &sdio {
213         clock-frequency = <50000000>;
214         clock-freq-min-max = <200000 50000000>;
215                 
216         supports-highspeed;             
217         supports-sdio;
218         //cap-sdio-irq;
219
220         status = "okay";
221 };
222
223 &spi0 {
224         status = "okay";
225         max-freq = <48000000>;  
226         /*
227         spi_test@00 {
228                 compatible = "rockchip,spi_test_bus0_cs0";
229                 reg = <0>;
230                 spi-max-frequency = <24000000>;
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                 poll_mode = <0>;
242                 type = <0>;
243                 enable_dma = <0>;               
244         };
245         */
246 };
247
248 &spi1 {
249         status = "okay";
250         max-freq = <48000000>;
251         /*
252         spi_test@10 {
253                 compatible = "rockchip,spi_test_bus1_cs0";
254                 reg = <0>;
255                 spi-max-frequency = <24000000>;
256                 poll_mode = <0>;
257                 type = <0>;
258                 enable_dma = <0>;
259         };
260
261         spi_test@11 {
262                 compatible = "rockchip,spi_test_bus1_cs1";
263                 reg = <1>;
264                 spi-max-frequency = <24000000>;
265                 poll_mode = <0>;
266                 type = <0>;
267                 enable_dma = <0>;
268         };
269         */
270 };
271
272 &spi2 {
273         status = "okay";
274         max-freq = <48000000>;
275         /*
276         spi_test@20 {
277                 compatible = "rockchip,spi_test_bus2_cs0";
278                 reg = <0>;
279                 spi-max-frequency = <24000000>;
280                 poll_mode = <0>;
281                 type = <0>;
282                 enable_dma = <0>;
283         };
284
285         spi_test@21 {
286                 compatible = "rockchip,spi_test_bus2_cs1";
287                 reg = <1>;
288                 spi-max-frequency = <24000000>;
289                 poll_mode = <0>;
290                 type = <0>;
291                 enable_dma = <0>;
292         };
293         */
294 };
295
296 &i2c0 {
297         status = "okay";
298         rk808: rk808@1b {
299                 reg = <0x1b>;
300                 status = "okay";
301         };
302         
303         bq24296: bq24296@6b {
304                 compatible = "ti,bq24296";
305                 reg = <0x6b>;
306                 gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B0 GPIO_ACTIVE_HIGH>;
307                 bq24296,chg_current = <1000 2000 3000>;
308                 status = "okay";
309         };
310         bq27320: bq27320@55 {
311                 compatible = "ti,bq27320";
312                 reg = <0x55>;
313         /*   gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
314                 status = "okay";
315         };
316
317         CW2015@62 {
318                 compatible = "cw201x";
319                 reg = <0x62>;
320                 dc_det_gpio = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
321                 bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
322                 chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
323                 bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58 0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
324                         0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45 0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D 0x52 0x52
325                         0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43 0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0xFF 0x7B 0xBB
326                         0xCB 0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x46 0xAE>;
327                 is_dc_charge = <1>;
328                 is_usb_charge = <0>;
329         };
330 };
331
332 &i2c1 {
333         status = "okay";
334         rtc@51 {
335                 compatible = "nxp,pcf8563";
336                 reg = <0x51>;
337         };
338         
339         sensor@1d {
340                 compatible = "gs_mma8452";
341                 reg = <0x1d>;
342                 type = <SENSOR_TYPE_ACCEL>;
343                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
344                 irq_enable = <1>;
345                 poll_delay_ms = <30>;
346                 layout = <1>;
347         };
348                 sensor@19 {
349                 compatible = "gs_lis3dh";
350                 reg = <0x19>;
351                 type = <SENSOR_TYPE_ACCEL>;
352                 irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
353                 irq_enable = <1>;
354                 poll_delay_ms = <30>;
355                 layout = <1>;
356         };
357                 sensor@0d {
358                 compatible = "ak8963";
359                 reg = <0x0d>;
360                 type = <SENSOR_TYPE_COMPASS>;
361                 irq-gpio = <&gpio8 GPIO_A2 IRQ_TYPE_EDGE_RISING>;
362                 irq_enable = <1>;
363                 poll_delay_ms = <30>;
364                 layout = <1>;
365         };
366
367                 sensor@6b {
368                 compatible = "l3g20d_gyro";
369                 reg = <0x6b>;
370                 type = <SENSOR_TYPE_GYROSCOPE>;
371                 irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_LEVEL_LOW>;
372                 irq_enable = <1>;
373                 poll_delay_ms = <30>;
374                 layout = <1>;
375         };
376         sensor@10 {
377               compatible = "ls_cm3218";
378               reg = <0x10>;
379               type = <SENSOR_TYPE_LIGHT>;
380               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
381               irq_enable = <1>;
382               poll_delay_ms = <30>;
383               layout = <1>;
384        };
385         
386 };
387
388 &i2c2 {
389         status = "okay";
390         rt5631: rt5631@1a {
391                 compatible = "rt5631";
392                 reg = <0x1a>;
393         };
394         es8323: es8323@10 {
395                 compatible = "es8323";
396                 reg = <0x10>;
397         };
398         rt3261: rt3261@1c {
399                 compatible = "rt3261";
400                 reg = <0x1c>;
401         //      codec-en-gpio = <0>;//sdk default high level
402                 spk-num= <2>;
403                 modem-input-mode = <1>;
404                 lout-to-modem_mode = <1>;
405                 spk-amplify = <2>;
406                 playback-if1-data_control = <0>;
407                 playback-if2-data_control = <0>;
408         };
409         rt5616: rt5616@1b {
410                 compatible = "rt5616";
411                 reg = <0x1b>;
412         };
413 };
414
415 &i2c3 {
416         status = "okay";
417 };
418
419 &i2c4 {
420         status = "okay";
421         ts@55 {
422                 compatible = "goodix,gt8xx";
423                 reg = <0x55>;
424                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
425                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
426                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
427                 max-x = <1280>;
428                 max-y = <800>;
429         };
430         
431         ts@01 {
432                 compatible = "ct,ct36x";
433                 reg = <0x01>;
434                 ct-model = <365>;
435                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
436                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
437                 max-x = <1280>;
438                 max-y = <800>;
439                 orientation=<1 0 0 1>;
440         };
441 };
442
443 &i2c5 {
444         status = "disable";
445 };
446
447 &fb {
448         rockchip,disp-mode = <DUAL>;
449 };
450
451 &rk_screen {
452          display-timings = <&disp_timings>;
453 };
454
455 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
456 &lcdc1 {
457         status = "okay";
458         power_ctr: power_ctr {
459                 rockchip,debug = <0>;
460                 rockchip,mirror = <NO_MIRROR>;
461                 lcd_en:lcd_en {
462                         rockchip,power_type = <GPIO>;
463                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
464                         rockchip,delay = <10>;
465                 };
466                 
467                 lcd_cs:lcd_cs {
468 rockchip,power_type = <GPIO>;
469                         gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
470                         rockchip,delay = <10>;
471                 };
472
473                 /*lcd_rst:lcd_rst {
474                         rockchip,power_type = <GPIO>;
475                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
476                         rockchip,delay = <5>;
477                 };*/
478
479         };
480 };
481
482 &lcdc0 {
483         status = "okay";
484 };
485
486 &hdmi {
487         status = "okay";
488         rockchips,hdmi_audio_source = <0>;
489 };
490
491 &adc {
492         status = "okay";
493
494         key {
495                 compatible = "rockchip,key";
496                 io-channels = <&adc 1>;
497
498                 vol-up-key {
499                         linux,code = <115>;
500                         label = "volume up";
501                         rockchip,adc_value = <1>;
502                 };
503
504                 vol-down-key {
505                         linux,code = <114>;
506                         label = "volume down";
507                         rockchip,adc_value = <170>;
508                 };
509
510                 power-key {
511                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
512                         linux,code = <116>;
513                         label = "power";
514                         gpio-key,wakeup;
515                 };
516
517                 menu-key {
518                         linux,code = <139>;
519                         label = "menu";
520                         rockchip,adc_value = <355>;
521                 };
522
523                 home-key {
524                         linux,code = <102>;
525                         label = "home";
526                         rockchip,adc_value = <746>;
527                 };
528
529                 back-key {
530                         linux,code = <158>;
531                         label = "back";
532                         rockchip,adc_value = <560>;
533                 };
534
535                 camera-key {
536                         linux,code = <212>;
537                         label = "camera";
538                         rockchip,adc_value = <450>;
539                 };
540         };
541 };
542
543 &pwm0 {
544         status = "okay";
545 };
546
547 &pwm1 {
548         status = "okay";
549 };
550
551
552 &clk_core_dvfs_table {
553         operating-points = <
554                 /* KHz    uV */
555                 312000 1100000
556                 504000 1100000
557                 816000 1100000
558                 1008000 1100000
559                 >;
560 };
561
562 &clk_gpu_dvfs_table {
563         operating-points = <
564                 /* KHz    uV */
565                 200000 1200000
566                 300000 1200000
567                 400000 1200000
568                 600000 1300000
569                 >;
570 };
571
572 &clk_ddr_dvfs_table {
573         operating-points = <
574                 /* KHz    uV */
575                 200000 1200000
576                 300000 1200000
577                 400000 1200000
578                 >;
579
580         freq_table = <
581                 /*status                freq(KHz)*/
582                 SYS_STATUS_NORMAL       400000
583                 SYS_STATUS_SUSPEND      200000
584                 SYS_STATUS_VIDEO        300000
585                 SYS_STATUS_DUALVIEW     500000
586                 >;
587 };
588
589 /include/ "rk808.dtsi"
590 &rk808 {
591         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B3 GPIO_ACTIVE_LOW>;
592
593         regulators {
594                 
595                 rk808_dcdc1_reg: regulator@0{
596                         regulator-name= "vdd_arm";
597                         regulator-always-on;
598                         regulator-boot-on;
599                 };
600
601                 rk808_dcdc2_reg: regulator@1 {
602                         regulator-name= "vdd_gpu";
603                         regulator-always-on;
604                         regulator-boot-on;
605                 };
606
607                 rk808_dcdc3_reg: regulator@2 {
608                         regulator-name= "rk_dcdc3";
609                         regulator-min-microvolt = <1200000>;
610                         regulator-max-microvolt = <1200000>;
611                         regulator-always-on;
612                         regulator-boot-on;
613                 };
614
615                 rk808_dcdc4_reg: regulator@3 {
616                         regulator-name= "vccio";
617                         regulator-min-microvolt = <1800000>;
618                         regulator-max-microvolt = <3300000>;
619                         regulator-always-on;
620                         regulator-boot-on;
621                 };
622
623                 rk808_ldo1_reg: regulator@4 {
624                         regulator-name= "rk_ldo1";
625                         regulator-min-microvolt = <3300000>;
626                         regulator-max-microvolt = <3300000>;
627                         regulator-always-on;
628                         regulator-boot-on;
629                 };
630
631                 rk808_ldo2_reg: regulator@5 {
632                         regulator-name= "rk_ldo2";
633                         regulator-min-microvolt = <3300000>;
634                         regulator-max-microvolt = <3300000>;
635                         regulator-always-on;
636                         regulator-boot-on;
637                 };
638
639                 rk808_ldo3_reg: regulator@6 {
640                         regulator-name= "rk_ldo3";
641                         regulator-min-microvolt = <1000000>;
642                         regulator-max-microvolt = <1000000>;
643                         regulator-always-on;
644                         regulator-boot-on;
645                 };
646
647                 rk808_ldo4_reg:regulator@7 {
648                         regulator-name= "rk_ldo4";
649                         regulator-min-microvolt = <1800000>;
650                         regulator-max-microvolt = <1800000>;
651                         regulator-always-on;
652                         regulator-boot-on;
653                 };
654
655                 rk808_ldo5_reg: regulator@8 {
656                         regulator-name= "rk_ldo5";
657                         regulator-min-microvolt = <3300000>;
658                         regulator-max-microvolt = <3300000>;
659                         regulator-always-on;
660                         regulator-boot-on;
661                 };
662
663                 rk808_ldo6_reg: regulator@9 {
664                         regulator-name= "rk_ldo6";
665                         regulator-min-microvolt = <1000000>;
666                         regulator-max-microvolt = <1000000>;
667                         regulator-always-on;
668                         regulator-boot-on;
669                 };
670
671                 rk808_ldo7_reg: regulator@10 {
672                         regulator-name= "rk_ldo7";
673                         regulator-min-microvolt = <1800000>;
674                         regulator-max-microvolt = <1800000>;
675                         regulator-always-on;
676                         regulator-boot-on;
677                 };
678
679                 rk808_ldo8_reg: regulator@11 {
680                         regulator-name= "rk_ldo8";
681                         regulator-min-microvolt = <3300000>;
682                         regulator-max-microvolt = <3300000>;
683                         regulator-always-on;
684                         regulator-boot-on;
685                 };
686         };
687 };