rk3288:bq24296:modify bq24296 gpio unvalid
[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 = <20>;
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         };
109
110         rockchip-rt5631 {
111                 compatible = "rockchip-rt5631";
112                 dais {
113                         dai0 {
114                                 audio-codec = <&rt5631>;
115                                 i2s-controller = <&i2s>;
116                                 format = "i2s";
117                                 //continuous-clock;
118                                 //bitclock-inversion;
119                                 //frame-inversion;
120                                 //bitclock-master;
121                                 //frame-master;
122                         };
123                 };
124         };
125
126         rockchip-rt3224 {
127                 compatible = "rockchip-rt3261";
128                 dais {
129                         dai0 {
130                                 audio-codec = <&rt3261>;
131                                 i2s-controller = <&i2s>;
132                                 format = "i2s";
133                                 //continuous-clock;
134                                 //bitclock-inversion;
135                                 //frame-inversion;
136                                 //bitclock-master;
137                                 //frame-master;
138                         };
139                 };
140         };
141
142 };
143
144 &emmc {
145         clock-frequency = <50000000>;
146         clock-freq-min-max = <400000 50000000>;
147
148         supports-highspeed;
149         supports-emmc;
150         bootpart-no-access;
151         
152         status = "okay";
153 };
154     
155 &sdmmc {
156         clock-frequency = <50000000>;
157         lock-freq-min-max = <400000 50000000>;              
158             
159         supports-highspeed;
160         supports-sd;
161         broken-cd;
162         card-detect-delay = <200>;
163
164         
165         vmmc-supply = <&rk808_ldo5_reg>;
166         status = "disabled";
167 };
168                 
169 &sdio {
170         clock-frequency = <50000000>;
171         clock-freq-min-max = <200000 50000000>;
172                 
173         supports-highspeed;             
174         supports-sdio;
175         cap-sdio-irq;
176
177         status = "diabled";
178 };
179
180 &spi0 {
181         status = "okay";
182 };
183
184 &spi1 {
185         status = "okay";
186 };
187
188 &spi2 {
189         status = "okay";
190 };
191
192 &i2c0 {
193         status = "okay";
194         rk808: rk808@1b {
195                 reg = <0x1b>;
196                 status = "okay";
197         };
198         
199         bq24296: bq24296@6b {
200                 compatible = "ti,bq24296";
201                 reg = <0x6b>;
202                 gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>;
203                 bq24296,chg_current = <1000 500 2000>;
204                 status = "okay";
205         };
206         bq27320: bq27320@55 {
207                 compatible = "ti,bq27320";
208                 reg = <0x55>;
209         /*   gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
210                 status = "okay";
211         };
212 };
213
214 &i2c1 {
215         status = "okay";
216         rtc@51 {
217                 compatible = "nxp,pcf8563";
218                 reg = <0x51>;
219         };
220         
221         sensor@1d {
222                 compatible = "gs_mma8452";
223                 reg = <0x1d>;
224                 type = <SENSOR_TYPE_ACCEL>;
225                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
226                 irq_enable = <1>;
227                 poll_delay_ms = <30>;
228                 layout = <1>;
229         };
230                 sensor@19 {
231                 compatible = "gs_lis3dh";
232                 reg = <0x19>;
233                 type = <SENSOR_TYPE_ACCEL>;
234                 irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
235                 irq_enable = <1>;
236                 poll_delay_ms = <30>;
237                 layout = <1>;
238         };
239                 sensor@0d {
240                 compatible = "ak8963";
241                 reg = <0x0d>;
242                 type = <SENSOR_TYPE_COMPASS>;
243                 irq-gpio = <&gpio8 GPIO_A2 IRQ_TYPE_EDGE_RISING>;
244                 irq_enable = <1>;
245                 poll_delay_ms = <30>;
246                 layout = <1>;
247         };
248
249                 sensor@6b {
250                 compatible = "l3g20d_gyro";
251                 reg = <0x6b>;
252                 type = <SENSOR_TYPE_GYROSCOPE>;
253                 irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_LEVEL_LOW>;
254                 irq_enable = <1>;
255                 poll_delay_ms = <30>;
256                 layout = <1>;
257         };
258         sensor@10 {
259               compatible = "ls_cm3218";
260               reg = <0x10>;
261               type = <SENSOR_TYPE_LIGHT>;
262               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
263               irq_enable = <1>;
264               poll_delay_ms = <30>;
265               layout = <1>;
266        };
267         
268 };
269
270 &i2c2 {
271         status = "okay";
272         rt5631: rt5631@1a {
273                 compatible = "rt5631";
274                 reg = <0x1a>;
275         };
276         es8323: es8323@10 {
277                 compatible = "es8323";
278                 reg = <0x10>;
279         };
280         rt3261: rt3261@1c {
281                 compatible = "rt3261";
282                 reg = <0x1c>;
283                 codec-en-gpio = <0>;//sdk default high level
284                 spk-num= <2>;
285                 modem-input-mode = <1>;
286                 lout-to-modem_mode = <1>;
287                 spk-amplify = <2>;
288                 playback-if1-data_control = <0>;
289                 playback-if2-data_control = <0>;
290         };
291         rt5616: rt5616@1b {
292                 compatible = "rt5616";
293                 reg = <0x1b>;
294         };
295 };
296
297 &i2c3 {
298         status = "okay";
299 };
300
301 &i2c4 {
302         status = "okay";
303 /*
304         ts@55 {
305                 compatible = "goodix,gt8xx";
306                 reg = <0x55>;
307                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
308                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
309                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
310                 max-x = <1280>;
311                 max-y = <800>;
312         };
313         
314         ts@01 {
315                 compatible = "ct,ct36x";
316                 reg = <0x01>;
317                 ct-model = <365>;
318                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
319                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
320                 max-x = <1280>;
321                 max-y = <800>;
322                 orientation=<1 0 0 1>;
323         };
324 */
325 };
326
327 &i2c5 {
328         status = "okay";
329 };
330
331 &fb {
332         rockchip,disp-mode = <DUAL>;
333 };
334
335 &rk_screen {
336          display-timings = <&disp_timings>;
337 };
338
339 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
340 &lcdc1 {
341         status = "okay";
342         power_ctr: power_ctr {
343                 rockchip,debug = <0>;
344                 rockchip,mirror = <NO_MIRROR>;
345                 lcd_en:lcd_en {
346                         rockchip,power_type = <GPIO>;
347                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
348                         rockchip,delay = <10>;
349                 };
350                 
351                 /*lcd_cs:lcd_cs {
352                         rockchip,power_type = <REGULATOR>;
353                         rockchip,delay = <10>;
354                 };
355
356                 lcd_rst:lcd_rst {
357                         rockchip,power_type = <GPIO>;
358                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
359                         rockchip,delay = <5>;
360                 };*/
361
362         };
363 };
364
365 &lcdc0 {
366         status = "okay";
367 };
368
369 &hdmi {
370         status = "okay";
371         rockchips,hdmi_audio_source = <0>;
372 };
373
374 &adc {
375         status = "okay";
376
377         key {
378                 compatible = "rockchip,key";
379                 io-channels = <&adc 1>;
380
381                 vol-up-key {
382                         linux,code = <115>;
383                         label = "volume up";
384                         rockchip,adc_value = <1>;
385                 };
386
387                 vol-down-key {
388                         linux,code = <114>;
389                         label = "volume down";
390                         rockchip,adc_value = <170>;
391                 };
392
393                 power-key {
394                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
395                         linux,code = <116>;
396                         label = "power";
397                         gpio-key,wakeup;
398                 };
399
400                 menu-key {
401                         linux,code = <139>;
402                         label = "menu";
403                         rockchip,adc_value = <355>;
404                 };
405
406                 home-key {
407                         linux,code = <102>;
408                         label = "home";
409                         rockchip,adc_value = <746>;
410                 };
411
412                 back-key {
413                         linux,code = <158>;
414                         label = "back";
415                         rockchip,adc_value = <560>;
416                 };
417
418                 camera-key {
419                         linux,code = <212>;
420                         label = "camera";
421                         rockchip,adc_value = <450>;
422                 };
423         };
424 };
425
426 &pwm0 {
427         status = "okay";
428 };
429
430 &pwm1 {
431         status = "okay";
432 };
433
434
435 &clk_core_dvfs_table {
436         operating-points = <
437                 /* KHz    uV */
438                 312000 1100000
439                 504000 1100000
440                 816000 1100000
441                 1008000 1100000
442                 >;
443 };
444
445 &clk_gpu_dvfs_table {
446         operating-points = <
447                 /* KHz    uV */
448                 200000 1200000
449                 300000 1200000
450                 400000 1200000
451                 >;
452 };
453
454 &clk_ddr_dvfs_table {
455         operating-points = <
456                 /* KHz    uV */
457                 200000 1200000
458                 300000 1200000
459                 400000 1200000
460                 >;
461
462         freq_table = <
463                 /*status                freq(KHz)*/
464                 SYS_STATUS_NORMAL       400000
465                 SYS_STATUS_SUSPEND      200000
466                 SYS_STATUS_VIDEO        300000
467                 SYS_STATUS_DUALVIEW     500000
468                 >;
469 };
470
471 /include/ "rk808.dtsi"
472 &rk808 {
473         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B3 GPIO_ACTIVE_LOW>;
474
475         regulators {
476                 
477                 rk808_dcdc1_reg: regulator@0{
478                         regulator-name= "vdd_arm";
479                         regulator-always-on;
480                         regulator-boot-on;
481                 };
482
483                 rk808_dcdc2_reg: regulator@1 {
484                         regulator-name= "vdd_gpu";
485                         regulator-always-on;
486                         regulator-boot-on;
487                 };
488
489                 rk808_dcdc3_reg: regulator@2 {
490                         regulator-name= "rk_dcdc3";
491                         regulator-min-microvolt = <1200000>;
492                         regulator-max-microvolt = <1200000>;
493                         regulator-always-on;
494                         regulator-boot-on;
495                 };
496
497                 rk808_dcdc4_reg: regulator@3 {
498                         regulator-name= "vccio";
499                         regulator-min-microvolt = <1800000>;
500                         regulator-max-microvolt = <3300000>;
501                         regulator-always-on;
502                         regulator-boot-on;
503                 };
504
505                 rk808_ldo1_reg: regulator@4 {
506                         regulator-name= "rk_ldo1";
507                         regulator-min-microvolt = <3300000>;
508                         regulator-max-microvolt = <3300000>;
509                         regulator-always-on;
510                         regulator-boot-on;
511                 };
512
513                 rk808_ldo2_reg: regulator@5 {
514                         regulator-name= "rk_ldo2";
515                         regulator-min-microvolt = <3300000>;
516                         regulator-max-microvolt = <3300000>;
517                         regulator-always-on;
518                         regulator-boot-on;
519                 };
520
521                 rk808_ldo3_reg: regulator@6 {
522                         regulator-name= "rk_ldo3";
523                         regulator-min-microvolt = <1000000>;
524                         regulator-max-microvolt = <1000000>;
525                         regulator-always-on;
526                         regulator-boot-on;
527                 };
528
529                 rk808_ldo4_reg:regulator@7 {
530                         regulator-name= "rk_ldo4";
531                         regulator-min-microvolt = <1800000>;
532                         regulator-max-microvolt = <1800000>;
533                         regulator-always-on;
534                         regulator-boot-on;
535                 };
536
537                 rk808_ldo5_reg: regulator@8 {
538                         regulator-name= "rk_ldo5";
539                         regulator-min-microvolt = <3300000>;
540                         regulator-max-microvolt = <3300000>;
541                         regulator-always-on;
542                         regulator-boot-on;
543                 };
544
545                 rk808_ldo6_reg: regulator@9 {
546                         regulator-name= "rk_ldo6";
547                         regulator-min-microvolt = <1000000>;
548                         regulator-max-microvolt = <1000000>;
549                         regulator-always-on;
550                         regulator-boot-on;
551                 };
552
553                 rk808_ldo7_reg: regulator@10 {
554                         regulator-name= "rk_ldo7";
555                         regulator-min-microvolt = <1800000>;
556                         regulator-max-microvolt = <1800000>;
557                         regulator-always-on;
558                         regulator-boot-on;
559                 };
560
561                 rk808_ldo8_reg: regulator@11 {
562                         regulator-name= "rk_ldo8";
563                         regulator-min-microvolt = <3300000>;
564                         regulator-max-microvolt = <3300000>;
565                         regulator-always-on;
566                         regulator-boot-on;
567                 };
568         };
569 };