Revert "rk312x:dts: revert code to recovery lcdc io sleep pinctrl to fix white screen...
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3126-86v.dts
1 #include "rk312x-sdk.dtsi"
2 #include "lcd-86v-rgb1024x600.dtsi"
3 //#include "lcd-y81349.dtsi"
4
5 / {
6          compatible = "rockchip,rk3126";
7         backlight {
8                 compatible = "pwm-backlight";
9                 pwms = <&pwm0 0 25000>;
10                           brightness-levels = <255 169 168 168 167 166 166 165 164 164 163 162 162 161 160 160 159 158 158 157 156 156 155 154 154 153 152 152 151 150 150 149 148 148 147 146 146 145 144 144 143 142 142 141 140 140 139 138 138 137 136 136 135 134 134 133 132 132 131 130 130 129 128 128 127 126 126 125 124 124 123 122 122 121 120 120 119 118 118 117 116 116 115 114 114 113 112 112 111 110 110 109 108 108 107 106 106 105 104 104 103 102 102 101 100 100 99 98 98 97 96 96 95 94 94 93 92 92 91 90 90 89 88 88 87 86 86 85 84 84 83 82 82 81 80 80 79 78 78 77 76 76 75 74 74 73 72 72 71 70 70 69 68 68 67 66 66 65 64 64 63 62 62 61 60 60 59 58 58 57 56 56 55 54 54 53 52 52 51 50 50 49 48 48 47 46 46 45 44 44 43 42 42 41 40 40 39 38 38 37 36 36 35 34 34 33 32 32 31 30 30 29 28 28 27 26 26 25 24 24 23 22 22 21 20 20 19 18 18 17 16 16 15 14 14 13 12 12 11 10 10 9 8 8 7 6 6 5 4 4 3 2 2 1 1 1 0 >;
11                           default-brightness-level = <128>;
12                 enable-gpios = <&gpio3 GPIO_C1 GPIO_ACTIVE_HIGH>;
13         };
14
15
16         usb_control {
17                 compatible = "rockchip,rk3126-usb-control";
18                 //host_drv_gpio = <&gpio2 GPIO_B4 GPIO_ACTIVE_LOW>;
19                 //otg_drv_gpio = <&gpio2 GPIO_B6 GPIO_ACTIVE_LOW>; 
20
21                 rockchip,remote_wakeup;
22                 rockchip,usb_irq_wakeup;
23                 };
24                 
25         wireless-wlan {
26         compatible = "wlan-platdata";
27
28         wifi_chip_type = "rtkwifi";
29         sdio_vref = <1800>; //1800mv or 3300mv
30
31         //power_ctrl_by_pmu;
32        // pmu_regulator = "act_ldo3";
33        // pmu_enable_level = <1>; //1->HIGH, 0->LOW
34
35         WIFI,poweren_gpio = <&gpio1 GPIO_A1 GPIO_ACTIVE_HIGH>;
36        // WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
37         //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
38
39         status = "okay";
40     }; 
41     
42         rockchip_suspend {
43                 rockchip,ctrbits = <
44                         (0
45                         |RKPM_CTR_PWR_DMNS
46                         |RKPM_CTR_GTCLKS
47                         |RKPM_CTR_PLLS
48                         //|RKPM_CTR_ARMOFF_LPMD
49                         |RKPM_CTR_IDLESRAM_MD
50                         |RKPM_CTR_DDR
51                         |RKPM_CTR_VOLTS
52     
53                         |RKPM_CTR_VOL_PWM1
54                         )
55                 >;
56                 rockchip,pmic-suspend_gpios = <
57                        GPIO1_A0
58                         >;
59         };
60         
61     chosen {
62         bootargs = "vmalloc=496M cma=4M rockchip_jtag";
63        };
64
65 };
66
67 &vd_arm {
68         pd_ddr {
69                  clk_ddr {
70                         operating-points = <
71                                 /* KHz    uV */
72                                 200000 1100000
73                                 300000 1100000
74                                 400000 1100000
75                                 533000 1250000
76                                 >;
77
78                         freq-table = <
79                                 /*status                freq(KHz)*/
80                                 SYS_STATUS_NORMAL       400000
81                                 SYS_STATUS_SUSPEND      200000
82                                 //SYS_STATUS_VIDEO_1080P  240000
83                                 //SYS_STATUS_VIDEO_4K     400000
84                                 SYS_STATUS_PERFORMANCE  528000
85                                 //SYS_STATUS_DUALVIEW   400000
86                                 //SYS_STATUS_BOOST      324000
87                                 //SYS_STATUS_ISP                533000
88                                 >;
89                         auto-freq-table = <
90                                 240000
91                                 324000
92                                 396000
93                                 528000
94                                 >;
95                         auto-freq=<0>;
96                         status="okay";
97                         };
98                 };
99         pd_gpu {
100                  clk_gpu {
101                         operating-points = <
102                                 /* KHz    uV */
103                                 200000 1100000
104                                 300000 1100000
105                                 400000  1150000
106                                 //480000  1250000
107                                 >;
108                                 status = "okay";
109                         };
110                 };
111         pd_core {
112                  clk_core {
113                         operating-points = <
114                                 /* KHz    uV */
115                                 216000 1000000
116                                 408000 1000000
117                                 600000 1100000
118                                 696000 1150000
119                                 816000 1200000
120                                 1008000 1350000
121                                 1200000 1425000
122                                 >;
123                         virt-temp-limit-1-cpu-busy = <
124                         /* target-temp  limit-freq */
125                                 75      1008000
126                                 85      1200000
127                                 95      1200000
128                                 100     1200000
129                                 >;
130                         virt-temp-limit-2-cpu-busy = <
131                         /* target-temp  limit-freq */
132                                 75      912000
133                                 85      1008000
134                                 95      1104000
135                                 100     1200000
136                                 >;
137                         virt-temp-limit-3-cpu-busy = <
138                         /* target-temp  limit-freq */
139                                 75      816000
140                                 85      912000
141                                 95      100800
142                                 100     110400
143                                 >;
144                         virt-temp-limit-4-cpu-busy = <
145                         /* target-temp  limit-freq */
146                                 75      816000
147                                 85      912000
148                                 95      100800
149                                 100     110400
150                                 >;
151                         temp-limit-enable = <1>;
152                         target-temp = <85>;
153                 };
154          };
155 };
156
157 &vd_logic {
158                         regulator_name = "vdd_logic";
159                         status = "disabled";
160
161         };
162
163
164
165 &pwm_regulator1 {
166         status = "okay";
167 };
168
169 &pwm1 {
170         status = "okay";
171 };
172
173 &fb {
174         rockchip,disp-mode = <NO_DUAL>;
175         rockchip,uboot-logo-on = <0>;
176 };
177
178 &rk_screen {
179         display-timings = <&disp_timings>;
180 };
181
182 &lvds {
183         status = "okay";
184
185         pinctrl-names = "lcdc";
186         pinctrl-0 = <&lcdc0_lcdc_d>;
187 };
188
189 &lcdc {
190         status = "okay";
191
192         pinctrl-names = "default", "gpio";
193         pinctrl-0 = <&lcdc0_lcdc>;
194         pinctrl-1 = <&lcdc0_gpio>;
195
196         rockchip,fb-win-map = <FB_DEFAULT_ORDER>;
197
198         power_ctr: power_ctr {
199                 rockchip,debug = <0>;
200                 lcd_en: lcd_en {
201                         rockchip,power_type = <GPIO>;
202                         gpios = <&gpio3 GPIO_B3 GPIO_ACTIVE_HIGH>;
203                         rockchip,delay = <10>;
204                 };
205         };
206 };
207
208 &hdmi {
209         status = "disabled";
210 };
211
212 &adc {
213         status = "okay";
214
215         key: key {
216                 compatible = "rockchip,key";
217                 io-channels = <&adc 2>;
218
219                 vol-up-key {
220                         linux,code = <115>;
221                         label = "volume up";
222
223                         rockchip,adc_value = <1>;
224
225                 };
226
227                 vol-down-key {
228                         linux,code = <114>;
229                         label = "volume down";
230
231                         rockchip,adc_value = <512>;
232
233                 };
234
235                 power-key {
236                         gpios = <&gpio1 GPIO_A4 GPIO_ACTIVE_LOW>;
237                         linux,code = <116>;
238                         label = "power";
239                         gpio-key,wakeup;
240                 };
241
242         };
243         
244
245         adc-battery {
246                 compatible = "rk30-adc-battery";
247                 io-channels = <&adc 0>;
248                 dc_det_gpio = <&gpio2 GPIO_B1 GPIO_ACTIVE_LOW>;
249                 pwr_hold = <&gpio1 GPIO_A2 GPIO_ACTIVE_LOW>;
250                 //bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
251                 //chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
252                 bat_table = <0 0 0 0 100 100
253                  3500 3619 3678 3734 3742 3783 3813 3884 3968 4110 4220
254                  3750 3710 3770 3830 3850 3880 3910 3980 4060 4240 4300
255                 >;
256                 is_dc_charge = <1>;
257                 is_usb_charge = <0>;
258
259         }; 
260
261         
262 };
263
264 &i2c0 {
265         status = "disabled";
266         rk818: rk818@1c {
267                 reg = <0x1c>;
268                 status = "disabled";
269         };
270 };
271
272
273 &i2c1 {
274         status = "okay";
275
276                 sensor@4c {
277                 compatible = "gs_mc3230";
278                 reg = <0x4c>;
279                 type = <SENSOR_TYPE_ACCEL>;
280                 //irq-gpio = <&gpio2 GPIO_B2 IRQ_TYPE_LEVEL_LOW>;
281                 irq_enable = <0>;
282                 poll_delay_ms = <30>;
283                 layout = <1>;
284         };
285         
286             rtc@51 {
287         compatible = "rtc,hym8563";
288         reg = <0x51>;
289         irq_gpio = <&gpio1 GPIO_A5 IRQ_TYPE_EDGE_FALLING>;
290     };  
291 };
292
293 &i2c2 {
294         status = "okay";
295         
296                 ts@76 {
297                 compatible = "zet6221-ts";
298                 reg = <0x76>;
299                 pinctrl-names = "default", "gpio";
300                 pinctrl-0 = <&i2c0_sda &i2c0_scl>;
301                 pinctrl-1 = <&i2c0_gpio>;
302                 //gpios = <&gpio0 GPIO_A1 GPIO_ACTIVE_LOW>, <&gpio0 GPIO_A0 GPIO_ACTIVE_LOW>;
303                 irq_gpio_number = <&gpio0 GPIO_A1 IRQ_TYPE_LEVEL_LOW>;
304                 rst_gpio_number = <&gpio0 GPIO_A0 GPIO_ACTIVE_HIGH>;
305         };
306         
307                 ts@55 {
308                 compatible = "goodix,gt8xx";
309                 reg = <0x55>;
310                 touch-gpio = <&gpio1 GPIO_B0 IRQ_TYPE_LEVEL_LOW>;
311                 reset-gpio = <&gpio2 GPIO_C1 GPIO_ACTIVE_LOW>;
312                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
313                 max-x = <1280>;
314                 max-y = <800>;
315                 status = "disabled";
316         };
317         
318
319 };
320
321
322 &sdmmc {
323         cd-gpios = <&gpio2 GPIO_A7 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
324         status = "disabled";
325 };
326
327 &sdio {
328         status = "disabled";
329 };
330
331
332 &codec {
333         spk_ctl_io = <&gpio1 GPIO_B0 GPIO_ACTIVE_HIGH>;
334         spk-mute-delay = <200>;
335         hp-mute-delay = <100>;
336         rk312x_for_mid = <1>;
337         is_rk3128 = <0>;
338         spk_volume = <25>;
339         hp_volume = <25>;
340         capture_volume = <26>;
341         gpio_debug = <0>;
342         codec_hp_det = <0>;
343 };
344
345
346
347 &dwc_control_usb {
348         usb_uart {
349                 status = "disabled";
350         };
351 };
352
353 &rk3126_cif_sensor{
354         status = "okay";
355 };