rk31:linux3.10:support bq27320 fg and bq24296 charger ic
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3188-tb.dts
1 /dts-v1/;
2
3 #include "rk3188.dtsi"
4 #include "rk3188-clocks.dtsi"
5 #include <dt-bindings/clock/ddr.h>
6
7 #include "rk3188-mmc.dtsi"
8 #include "lcd-b101ew05.dtsi"
9
10 / {
11         memory {
12                 device_type = "memory";
13                 reg = <0x60000000 0x40000000>;
14         };
15
16         chosen {
17                 bootargs = "clk_ignore_unused";
18         };
19
20         fiq-debugger {
21                 status = "okay";
22         };
23
24     wireless-wlan {
25         compatible = "wlan-platdata";
26
27         wifi_chip_type = "";
28         sdio_vref = <28000>;
29
30         //power_ctrl_by_pmu;
31         pmu_regulator = "act_ldo3";
32         pmu_enable_level = <1>; //1->HIGH, 0->LOW
33
34         WIFI,poweren_gpio = <&gpio3 GPIO_D0 GPIO_ACTIVE_HIGH>;
35         WIFI,host_wake_irq = <&gpio3 GPIO_D2 GPIO_ACTIVE_HIGH>;
36         //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
37
38         status = "okay";
39     };
40
41     wireless-bluetooth {
42         compatible = "bluetooth-platdata";
43
44         support_uart_rts_ctrl;
45         uart_rts_gpios = <&gpio1 GPIO_A3 GPIO_ACTIVE_LOW>;
46         pinctrl-names = "default";
47         pinctrl-0 = <&uart0_rts>;
48
49         BT,power_gpio = <&gpio3 GPIO_C7 GPIO_ACTIVE_HIGH>;
50         BT,reset_gpio = <&gpio3 GPIO_D1 GPIO_ACTIVE_HIGH>;
51         BT,wake_gpio = <&gpio3 GPIO_C6 GPIO_ACTIVE_HIGH>;
52         BT,wake_host_irq = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
53
54         status = "okay";
55     };
56
57         backlight {
58                 compatible = "pwm-backlight";
59                 pwms = <&pwm3 0 25000>;
60                 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>;
61                 default-brightness-level = <128>;
62                 enable-gpios = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
63         };
64
65         codec_hdmi_i2s: codec-hdmi-i2s {
66                 compatible = "hdmi-i2s";
67         };
68
69         codec_hdmi_spdif: codec-hdmi-spdif {
70                 compatible = "hdmi-spdif";
71         };
72
73         rockchip-rt5631 {
74                 compatible = "rockchip-rt5631";
75                 dais {
76                         dai0 {
77                                 audio-codec = <&rt5631>;
78                                 i2s-controller = <&i2s0>;
79                                 format = "i2s";
80                                 //continuous-clock;
81                                 //bitclock-inversion;
82                                 //frame-inversion;
83                                 //bitclock-master;
84                                 //frame-master;
85                         };
86                 };
87         };
88
89         rockchip-rk610 {
90                 compatible = "rockchip-rk610";
91                 dais {
92                         dai0 {
93                                 audio-codec = <&rk610_codec>;
94                                 i2s-controller = <&i2s0>;
95                                 format = "i2s";
96                                 //continuous-clock;
97                                 //bitclock-inversion;
98                                 //frame-inversion;
99                                 //bitclock-master;
100                                 //frame-master;
101                         };
102                 };
103         };
104
105         rockchip-hdmi-i2s {
106                 compatible = "rockchip-hdmi-i2s";
107                 dais {
108                         dai0 {
109                                 audio-codec = <&codec_hdmi_i2s>;
110                                 i2s-controller = <&i2s0>;
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         };
124         
125         vmac-phy {
126                 compatible = "rockchip,vmac-phy";
127                 power-gpios = <&gpio0 GPIO_C0 GPIO_ACTIVE_HIGH>;
128         };
129 };
130
131 &uart0 {
132         status = "okay";
133         dma-names = "!tx", "!rx";
134 };
135
136
137 &uart3 {
138         status = "okay";
139         dma-names = "!tx", "!rx";
140 };
141
142 &watchdog {
143                 rockchip,timeout = <50>;
144                 rockchip,debug = <1>;
145                 status = "disabled";
146 };
147
148 &i2c0 {
149         status = "okay";
150         rt5631: rt5631@1a {
151                 compatible = "rt5631";
152                 reg = <0x1a>;
153         };
154
155         rk610ctl@40 {
156                 compatible = "rk610_ctl";
157                 reg = <0x40>;
158                 rk610-reset-io = <&gpio3 GPIO_B2 GPIO_ACTIVE_HIGH>;
159                 clocks = <&clk_i2s>;
160                 clock-names = "i2s_clk";
161         };
162
163         rk610_codec: rk610codec@60 {//RK610_CODEC addr  from 0x60 to 0x80 (0x60~0x80)
164                 compatible = "rk610_codec";
165                 reg = <0x60>;
166                 spk_ctl_io = <&gpio2 GPIO_D7 GPIO_ACTIVE_HIGH>;
167                 boot_depop = <1>;
168                 pa_enable_time = <1000>;
169         };
170
171         sensor@1d {
172                 compatible = "gs_mma8452";
173                 reg = <0x1d>;
174                 type = <SENSOR_TYPE_ACCEL>;
175                 irq-gpio = <&gpio0 GPIO_B7 IRQ_TYPE_EDGE_FALLING>;              
176                 irq_enable = <1>;
177                 poll_delay_ms = <30>;
178                 layout = <1>;
179         };
180 };
181
182 &i2c1 {
183         status = "okay";
184         rtc@51 {
185                 compatible = "nxp,pcf8563";
186                 reg = <0x51>;
187         };
188         
189         act8846: act8846@5a {
190                 reg = <0x5a>;
191                 status = "okay";
192         };
193         rk808: rk808@1b {
194                 reg = <0x1b>;
195                 status = "okay";
196         };
197         bq24296: bq24296@6b {
198                 compatible = "ti,bq24296";
199                 reg = <0x6b>;
200 /*      gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
201           bq24296,chg_current = <1000 500 2000>;
202                 status = "disable";
203         };
204         bq27320: bq27320@55 {
205                 compatible = "ti,bq27320";
206                 reg = <0x55>;
207 /*  gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
208                 status = "disable";
209         };
210 };
211
212 &i2c2 {
213         status = "okay";
214         ts@55 {
215                 compatible = "goodix,gt8xx";
216                 reg = <0x55>;
217                 touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
218                 reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>;
219                 power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
220                 max-x = <1280>;
221                 max-y = <800>;
222         };
223         ts@01 {
224                 compatible = "ct,ct36x";
225                 reg = <0x01>;
226                 ct-model = <365>;
227                 touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
228                 reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_HIGH>;
229                 max-x = <1280>;
230                 max-y = <800>;
231                 orientation=<1 0 0 1>;
232         };
233 };
234
235 &i2c3 {
236         status = "okay";
237 };
238
239 &fb {
240         rockchip,disp-mode = <DUAL>;
241 };
242
243 &lcdc0 {
244         status = "okay";
245         power_ctr = <&disp_power_ctr>;
246         display-timings = <&disp_timings>;
247 };
248
249 &lcdc1 {
250         status = "okay";
251 };
252
253 &adc {
254         status = "okay";
255
256         key {
257                 compatible = "rockchip,key";
258                 io-channels = <&adc 1>; 
259
260                 vol-up-key {
261                         linux,code = <115>;
262                         label = "volume up";
263                         rockchip,adc_value = <1>;
264                 };
265
266                 vol-down-key {
267                         linux,code = <114>;
268                         label = "volume down";
269                         rockchip,adc_value = <170>;
270                 };
271
272                 power-key {
273                         gpios = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>;
274                         linux,code = <116>;
275                         label = "power";
276                         gpio-key,wakeup;
277                 };
278
279                 menu-key {
280                         linux,code = <139>;
281                         label = "menu";
282                         rockchip,adc_value = <355>;
283                 };
284
285                 home-key {
286                         linux,code = <102>;
287                         label = "home";
288                         rockchip,adc_value = <746>;
289                 };
290
291                 back-key {
292                         linux,code = <158>;
293                         label = "back";
294                         rockchip,adc_value = <560>;
295                 };
296
297                 camera-key {
298                         linux,code = <212>;
299                         label = "camera";
300                         rockchip,adc_value = <450>;
301                 };       
302         };
303 };
304
305 &pwm3 {
306         status = "okay";
307 };
308
309 &clk_core_dvfs_table {
310         operating-points = <
311                 /* KHz    uV */
312                 312000 1100000
313                 504000 1100000
314                 816000 1100000
315                 1008000 1100000
316                 1200000 1200000
317                 1416000 1300000
318                 1608000 1350000
319                 >;
320 };
321
322 &clk_gpu_dvfs_table {
323         operating-points = <
324                 /* KHz    uV */
325                 200000 1200000
326                 300000 1200000
327                 400000 1200000
328                 >;
329 };
330
331 &clk_ddr_dvfs_table {
332         operating-points = <
333                 /* KHz    uV */
334                 200000 1200000
335                 300000 1200000
336                 400000 1200000
337                 >;
338
339         freq_table = <
340                 /*status                freq(KHz)*/
341                 SYS_STATUS_NORMAL       400000
342                 SYS_STATUS_SUSPEND      200000
343                 SYS_STATUS_VIDEO        300000
344                 SYS_STATUS_DUALVIEW     500000
345                 >;
346 };
347
348 /include/ "act8846.dtsi"
349 &act8846 {
350         gpios =<&gpio3 GPIO_D3 GPIO_ACTIVE_LOW>; 
351
352 regulators {
353                 
354                  dcdc1_reg: regulator@0{
355                         regulator-name= "act_dcdc1";
356                         regulator-min-microvolt = <1200000>;
357                         regulator-max-microvolt = <1200000>;
358                         regulator-always-on;
359                         regulator-boot-on;
360                 };
361
362                 dcdc2_reg: regulator@1 {
363                         regulator-name= "vdd_logic";
364                         regulator-always-on;
365                         regulator-boot-on;                      
366                 };
367
368                 dcdc3_reg: regulator@2 {
369                         regulator-name= "vdd_arm";
370                         regulator-always-on;
371                         regulator-boot-on;
372                 };
373
374                 dcdc4_reg: regulator@3 {
375                         regulator-name= "vccio";
376                         regulator-min-microvolt = <1800000>;
377                         regulator-max-microvolt = <3300000>;
378                         regulator-always-on;
379                         regulator-boot-on;
380                 };
381
382                 ldo1_reg: regulator@4 {
383                         regulator-name= "act_ldo1";
384                         regulator-min-microvolt = <1000000>;
385                         regulator-max-microvolt = <1000000>;
386                         regulator-always-on;
387                         regulator-boot-on;
388                 };
389
390                 ldo2_reg: regulator@5 {
391                         regulator-name= "act_ldo2";
392                         regulator-min-microvolt = <1200000>;
393                         regulator-max-microvolt = <1200000>;
394                         regulator-always-on;
395                         regulator-boot-on;
396                 };
397
398                 ldo3_reg: regulator@6 {
399                         regulator-name= "act_ldo3";
400                         regulator-min-microvolt = <1800000>;
401                         regulator-max-microvolt = <1800000>;
402                         regulator-always-on;
403                         regulator-boot-on;
404                 };
405
406                 ldo4_reg:regulator@7 {
407                         regulator-name= "act_ldo4";
408                         regulator-min-microvolt = <3300000>;
409                         regulator-max-microvolt = <3300000>;
410                         regulator-always-on;
411                         regulator-boot-on;
412                 };
413
414                 ldo5_reg: regulator@8 {
415                         regulator-name= "act_ldo5";
416                         regulator-min-microvolt = <3300000>;
417                         regulator-max-microvolt = <3300000>;
418                         regulator-always-on;
419                         regulator-boot-on;
420                 };
421
422                 ldo6_reg: regulator@9 {
423                         regulator-name= "act_ldo6";
424                         regulator-min-microvolt = <3300000>;
425                         regulator-max-microvolt = <3300000>;
426                         regulator-always-on;
427                         regulator-boot-on;
428                 };
429
430                 ldo7_reg: regulator@10 {
431                         regulator-name= "act_ldo7";
432                         regulator-min-microvolt = <1800000>;
433                         regulator-max-microvolt = <1800000>;
434                         regulator-always-on;
435                         regulator-boot-on;
436                 };
437
438                 ldo8_reg: regulator@11 {
439                         regulator-name= "act_ldo8";
440                         regulator-min-microvolt = <2800000>;
441                         regulator-max-microvolt = <2800000>;
442                         regulator-always-on;
443                         regulator-boot-on;
444                 };
445         };
446 };
447 /include/ "rk808.dtsi"
448 &rk808{
449         gpios =<&gpio0 GPIO_B3 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_A1 GPIO_ACTIVE_LOW>; 
450
451 regulators {
452                 
453                  rk808_dcdc1_reg: regulator@0{
454                         regulator-name= "vdd_arm";      
455                         regulator-always-on;
456                         regulator-boot-on;
457                 };
458
459                 rk808_dcdc2_reg: regulator@1 {
460                         regulator-name= "vdd_logic";
461                         regulator-always-on;
462                         regulator-boot-on;              
463                 };
464
465                 rk808_dcdc3_reg: regulator@2 {
466                         regulator-name= "rk_dcdc3";
467                         regulator-min-microvolt = <1200000>;
468                         regulator-max-microvolt = <1200000>;
469                         regulator-always-on;
470                         regulator-boot-on;
471                 };
472
473                 rk808_dcdc4_reg: regulator@3 {
474                         regulator-name= "vccio";
475                         regulator-min-microvolt = <1800000>;
476                         regulator-max-microvolt = <3300000>;
477                         regulator-always-on;
478                         regulator-boot-on;
479                 };
480
481                 rk808_ldo1_reg: regulator@4 {
482                         regulator-name= "rk_ldo1";
483                         regulator-min-microvolt = <3300000>;
484                         regulator-max-microvolt = <3300000>;
485                         regulator-always-on;
486                         regulator-boot-on;
487                 };
488
489                 rk808_ldo2_reg: regulator@5 {
490                         regulator-name= "rk_ldo2";
491                         regulator-min-microvolt = <3300000>;
492                         regulator-max-microvolt = <3300000>;
493                         regulator-always-on;
494                         regulator-boot-on;
495                 };
496
497                 rk808_ldo3_reg: regulator@6 {
498                         regulator-name= "rk_ldo3";
499                         regulator-min-microvolt = <1000000>;
500                         regulator-max-microvolt = <1000000>;
501                         regulator-always-on;
502                         regulator-boot-on;
503                 };
504
505                 rk808_ldo4_reg:regulator@7 {
506                         regulator-name= "rk_ldo4";
507                         regulator-min-microvolt = <1800000>;
508                         regulator-max-microvolt = <1800000>;
509                         regulator-always-on;
510                         regulator-boot-on;
511                 };
512
513                 rk808_ldo5_reg: regulator@8 {
514                         regulator-name= "rk_ldo5";
515                         regulator-min-microvolt = <2800000>;
516                         regulator-max-microvolt = <2800000>;
517                         regulator-always-on;
518                         regulator-boot-on;
519                 };
520
521                 rk808_ldo6_reg: regulator@9 {
522                         regulator-name= "rk_ldo6";
523                         regulator-min-microvolt = <1200000>;
524                         regulator-max-microvolt = <1200000>;
525                         regulator-always-on;
526                         regulator-boot-on;
527                 };
528
529                 rk808_ldo7_reg: regulator@10 {
530                         regulator-name= "rk_ldo7";
531                         regulator-min-microvolt = <1800000>;
532                         regulator-max-microvolt = <1800000>;
533                         regulator-always-on;
534                         regulator-boot-on;
535                 };
536
537                 rk808_ldo8_reg: regulator@11 {
538                         regulator-name= "rk_ldo8";
539                         regulator-min-microvolt = <1800000>;
540                         regulator-max-microvolt = <1800000>;
541                         regulator-always-on;
542                         regulator-boot-on;
543                 };
544         };
545 };
546
547