androidComputer: changed for display
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk30 / board-rk30-ds1001b.c
1 /* arch/arm/mach-rk30/board-rk30-sdk.c
2  *
3  * Copyright (C) 2012 ROCKCHIP, Inc.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/input.h>
20 #include <linux/io.h>
21 #include <linux/delay.h>
22 #include <linux/i2c.h>
23 #include <linux/skbuff.h>
24 #include <linux/spi/spi.h>
25 #include <linux/mmc/host.h>
26 #include <linux/ion.h>
27 #include <linux/cpufreq.h>
28 #include <linux/clk.h>
29 #include <mach/dvfs.h>
30
31 #include <asm/setup.h>
32 #include <asm/mach-types.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/flash.h>
36 #include <asm/hardware/gic.h>
37
38 #include <mach/board.h>
39 #include <mach/hardware.h>
40 #include <mach/io.h>
41 #include <mach/gpio.h>
42 #include <mach/iomux.h>
43 #include <linux/fb.h>
44 #include <linux/regulator/machine.h>
45 #if defined(CONFIG_HDMI_RK30)
46         #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
47 #endif
48
49 #if defined(CONFIG_SPIM_RK29)
50 #include "../../../drivers/spi/rk29_spim.h"
51 #endif
52 #if defined(CONFIG_ANDROID_TIMED_GPIO)
53 #include "../../../drivers/staging/android/timed_gpio.h"
54 #endif
55
56 #ifdef  CONFIG_THREE_FB_BUFFER
57 #define RK30_FB0_MEM_SIZE 12*SZ_1M
58 #else
59 #define RK30_FB0_MEM_SIZE 8*SZ_1M
60 #endif
61
62 #ifdef CONFIG_VIDEO_RK29
63 /*---------------- Camera Sensor Macro Define Begin  ------------------------*/
64 /*---------------- Camera Sensor Configuration Macro Begin ------------------------*/
65
66 #define CONFIG_SENSOR_0 RK29_CAM_SENSOR_OV2655                                          /* back camera sensor */
67 #define CONFIG_SENSOR_IIC_ADDR_0                0x60
68 #define CONFIG_SENSOR_IIC_ADAPTER_ID_0    3
69 #define CONFIG_SENSOR_CIF_INDEX_0                    0
70 #define CONFIG_SENSOR_ORIENTATION_0       90
71 #define CONFIG_SENSOR_POWER_PIN_0                 INVALID_GPIO
72 #define CONFIG_SENSOR_RESET_PIN_0                 INVALID_GPIO
73 #define CONFIG_SENSOR_POWERDN_PIN_0       RK30_PIN1_PB6
74 #define CONFIG_SENSOR_FALSH_PIN_0                 INVALID_GPIO
75 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_L
76 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_0 RK29_CAM_RESETACTIVE_L
77 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_0 RK29_CAM_POWERDNACTIVE_H
78 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_0 RK29_CAM_FLASHACTIVE_L
79
80 #define CONFIG_SENSOR_QCIF_FPS_FIXED_0          12504
81 #define CONFIG_SENSOR_240X160_FPS_FIXED_0   12504
82 #define CONFIG_SENSOR_QVGA_FPS_FIXED_0          12504
83 #define CONFIG_SENSOR_CIF_FPS_FIXED_0           12504
84 #define CONFIG_SENSOR_VGA_FPS_FIXED_0           12504
85 #define CONFIG_SENSOR_480P_FPS_FIXED_0          12504
86 #define CONFIG_SENSOR_SVGA_FPS_FIXED_0          12504
87 #define CONFIG_SENSOR_720P_FPS_FIXED_0          12504
88
89 #define CONFIG_SENSOR_01  RK29_CAM_SENSOR_OV5642                   /* back camera sensor 1 */
90 #define CONFIG_SENSOR_IIC_ADDR_01           0x00
91 #define CONFIG_SENSOR_CIF_INDEX_01                    1
92 #define CONFIG_SENSOR_IIC_ADAPTER_ID_01    4
93 #define CONFIG_SENSOR_ORIENTATION_01       90
94 #define CONFIG_SENSOR_POWER_PIN_01         INVALID_GPIO
95 #define CONFIG_SENSOR_RESET_PIN_01         INVALID_GPIO
96 #define CONFIG_SENSOR_POWERDN_PIN_01       INVALID_GPIO
97 #define CONFIG_SENSOR_FALSH_PIN_01         INVALID_GPIO
98 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_01 RK29_CAM_POWERACTIVE_L
99 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_01 RK29_CAM_RESETACTIVE_L
100 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_01 RK29_CAM_POWERDNACTIVE_H
101 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_01 RK29_CAM_FLASHACTIVE_L
102
103 #define CONFIG_SENSOR_QCIF_FPS_FIXED_01      12504
104 #define CONFIG_SENSOR_240X160_FPS_FIXED_01   12504
105 #define CONFIG_SENSOR_QVGA_FPS_FIXED_01      12504
106 #define CONFIG_SENSOR_CIF_FPS_FIXED_01       12504
107 #define CONFIG_SENSOR_VGA_FPS_FIXED_01       12504
108 #define CONFIG_SENSOR_480P_FPS_FIXED_01      12504
109 #define CONFIG_SENSOR_SVGA_FPS_FIXED_01      12504
110 #define CONFIG_SENSOR_720P_FPS_FIXED_01     12504
111
112 #define CONFIG_SENSOR_02 RK29_CAM_SENSOR_OV5640                      /* back camera sensor 2 */
113 #define CONFIG_SENSOR_IIC_ADDR_02           0x00
114 #define CONFIG_SENSOR_CIF_INDEX_02                    1
115 #define CONFIG_SENSOR_IIC_ADAPTER_ID_02    4
116 #define CONFIG_SENSOR_ORIENTATION_02       90
117 #define CONFIG_SENSOR_POWER_PIN_02         INVALID_GPIO
118 #define CONFIG_SENSOR_RESET_PIN_02         INVALID_GPIO
119 #define CONFIG_SENSOR_POWERDN_PIN_02       INVALID_GPIO
120 #define CONFIG_SENSOR_FALSH_PIN_02         INVALID_GPIO
121 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_02 RK29_CAM_POWERACTIVE_L
122 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_02 RK29_CAM_RESETACTIVE_L
123 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_02 RK29_CAM_POWERDNACTIVE_H
124 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_02 RK29_CAM_FLASHACTIVE_L
125
126 #define CONFIG_SENSOR_QCIF_FPS_FIXED_02      12504
127 #define CONFIG_SENSOR_240X160_FPS_FIXED_02   12504
128 #define CONFIG_SENSOR_QVGA_FPS_FIXED_02      12504
129 #define CONFIG_SENSOR_CIF_FPS_FIXED_02       12504
130 #define CONFIG_SENSOR_VGA_FPS_FIXED_02       12504
131 #define CONFIG_SENSOR_480P_FPS_FIXED_02      12504
132 #define CONFIG_SENSOR_SVGA_FPS_FIXED_02      12504
133 #define CONFIG_SENSOR_720P_FPS_FIXED_02      12504
134
135 #define CONFIG_SENSOR_1 RK29_CAM_SENSOR_OV2655                      /* front camera sensor 0 */
136 #define CONFIG_SENSOR_IIC_ADDR_1            0x60
137 #define CONFIG_SENSOR_IIC_ADAPTER_ID_1    3
138 #define CONFIG_SENSOR_CIF_INDEX_1                                 0
139 #define CONFIG_SENSOR_ORIENTATION_1       270
140 #define CONFIG_SENSOR_POWER_PIN_1         INVALID_GPIO
141 #define CONFIG_SENSOR_RESET_PIN_1         INVALID_GPIO
142 #define CONFIG_SENSOR_POWERDN_PIN_1       RK30_PIN1_PB7
143 #define CONFIG_SENSOR_FALSH_PIN_1         INVALID_GPIO
144 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_1 RK29_CAM_POWERACTIVE_L
145 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L
146 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H
147 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L
148
149 #define CONFIG_SENSOR_QCIF_FPS_FIXED_1          12504
150 #define CONFIG_SENSOR_240X160_FPS_FIXED_1   12504
151 #define CONFIG_SENSOR_QVGA_FPS_FIXED_1          12504
152 #define CONFIG_SENSOR_CIF_FPS_FIXED_1           12504
153 #define CONFIG_SENSOR_VGA_FPS_FIXED_1           12504
154 #define CONFIG_SENSOR_480P_FPS_FIXED_1          12504
155 #define CONFIG_SENSOR_SVGA_FPS_FIXED_1          12504
156 #define CONFIG_SENSOR_720P_FPS_FIXED_1          12504
157
158 #define CONFIG_SENSOR_11 RK29_CAM_SENSOR_OV2659                      /* front camera sensor 1 */
159 #define CONFIG_SENSOR_IIC_ADDR_11           0x00
160 #define CONFIG_SENSOR_IIC_ADAPTER_ID_11    3
161 #define CONFIG_SENSOR_CIF_INDEX_11                                0
162 #define CONFIG_SENSOR_ORIENTATION_11       270
163 #define CONFIG_SENSOR_POWER_PIN_11         INVALID_GPIO
164 #define CONFIG_SENSOR_RESET_PIN_11         INVALID_GPIO
165 #define CONFIG_SENSOR_POWERDN_PIN_11       INVALID_GPIO
166 #define CONFIG_SENSOR_FALSH_PIN_11         INVALID_GPIO
167 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_11 RK29_CAM_POWERACTIVE_L
168 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_11 RK29_CAM_RESETACTIVE_L
169 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_11 RK29_CAM_POWERDNACTIVE_H
170 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_11 RK29_CAM_FLASHACTIVE_L
171
172 #define CONFIG_SENSOR_QCIF_FPS_FIXED_11      12504
173 #define CONFIG_SENSOR_240X160_FPS_FIXED_11   12504
174 #define CONFIG_SENSOR_QVGA_FPS_FIXED_11      12500
175 #define CONFIG_SENSOR_CIF_FPS_FIXED_11       12504
176 #define CONFIG_SENSOR_VGA_FPS_FIXED_11       12504
177 #define CONFIG_SENSOR_480P_FPS_FIXED_11      12504
178 #define CONFIG_SENSOR_SVGA_FPS_FIXED_11      12504
179 #define CONFIG_SENSOR_720P_FPS_FIXED_11      12504
180
181 #define CONFIG_SENSOR_12 RK29_CAM_SENSOR_OV2655                      /* front camera sensor 2 */
182 #define CONFIG_SENSOR_IIC_ADDR_12           0x00
183 #define CONFIG_SENSOR_IIC_ADAPTER_ID_12    3
184 #define CONFIG_SENSOR_CIF_INDEX_12                                0
185 #define CONFIG_SENSOR_ORIENTATION_12       270
186 #define CONFIG_SENSOR_POWER_PIN_12         INVALID_GPIO
187 #define CONFIG_SENSOR_RESET_PIN_12         INVALID_GPIO
188 #define CONFIG_SENSOR_POWERDN_PIN_12       INVALID_GPIO
189 #define CONFIG_SENSOR_FALSH_PIN_12         INVALID_GPIO
190 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_12 RK29_CAM_POWERACTIVE_L
191 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_12 RK29_CAM_RESETACTIVE_L
192 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_12 RK29_CAM_POWERDNACTIVE_H
193 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_12 RK29_CAM_FLASHACTIVE_L
194
195 #define CONFIG_SENSOR_QCIF_FPS_FIXED_12      12504
196 #define CONFIG_SENSOR_240X160_FPS_FIXED_12   12504
197 #define CONFIG_SENSOR_QVGA_FPS_FIXED_12      12504
198 #define CONFIG_SENSOR_CIF_FPS_FIXED_12       12504
199 #define CONFIG_SENSOR_VGA_FPS_FIXED_12       12504
200 #define CONFIG_SENSOR_480P_FPS_FIXED_12      12504
201 #define CONFIG_SENSOR_SVGA_FPS_FIXED_12      12504
202 #define CONFIG_SENSOR_720P_FPS_FIXED_12      12504
203
204 #endif  //#ifdef CONFIG_VIDEO_RK29
205 /*---------------- Camera Sensor Configuration Macro End------------------------*/
206 #include "../../../drivers/media/video/rk30_camera.c"
207 /*---------------- Camera Sensor Macro Define End  ---------*/
208
209 #define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
210 /*****************************************************************************************
211  * camera  devices
212  * author: ddl@rock-chips.com
213  *****************************************************************************************/
214 #ifdef CONFIG_VIDEO_RK29
215 #define CONFIG_SENSOR_POWER_IOCTL_USR      0
216 #define CONFIG_SENSOR_RESET_IOCTL_USR      0
217 #define CONFIG_SENSOR_POWERDOWN_IOCTL_USR          0
218 #define CONFIG_SENSOR_FLASH_IOCTL_USR      0
219
220 static void rk_cif_power(int on)
221 {
222     struct regulator *ldo_18,*ldo_28;
223         ldo_28 = regulator_get(NULL, "ldo7");   // vcc28_cif
224         ldo_18 = regulator_get(NULL, "ldo1");   // vcc18_cif
225
226     if(on == 0){        
227         regulator_disable(ldo_28);
228         regulator_put(ldo_28);
229         regulator_disable(ldo_18);
230         regulator_put(ldo_18);
231         mdelay(500);
232         }
233     else{
234         regulator_set_voltage(ldo_28, 2800000, 2800000);
235         regulator_enable(ldo_28);
236     //  printk("%s set ldo7 vcc28_cif=%dmV end\n", __func__, regulator_get_voltage(ldo_28));
237         regulator_put(ldo_28);
238
239         regulator_set_voltage(ldo_18, 1800000, 1800000);
240     //  regulator_set_suspend_voltage(ldo, 1800000);
241         regulator_enable(ldo_18);
242     //  printk("%s set ldo1 vcc18_cif=%dmV end\n", __func__, regulator_get_voltage(ldo));
243         regulator_put(ldo_18);
244         }
245 }
246
247 #if CONFIG_SENSOR_POWER_IOCTL_USR
248 static int sensor_power_usr_cb (struct rk29camera_gpio_res *res,int on)
249 {
250         //#error "CONFIG_SENSOR_POWER_IOCTL_USR is 1, sensor_power_usr_cb function must be writed!!";
251     rk_cif_power(on);
252 }
253 #endif
254
255 #if CONFIG_SENSOR_RESET_IOCTL_USR
256 static int sensor_reset_usr_cb (struct rk29camera_gpio_res *res,int on)
257 {
258         #error "CONFIG_SENSOR_RESET_IOCTL_USR is 1, sensor_reset_usr_cb function must be writed!!";
259 }
260 #endif
261
262 #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
263 static int sensor_powerdown_usr_cb (struct rk29camera_gpio_res *res,int on)
264 {
265         #error "CONFIG_SENSOR_POWERDOWN_IOCTL_USR is 1, sensor_powerdown_usr_cb function must be writed!!";
266 }
267 #endif
268
269 #if CONFIG_SENSOR_FLASH_IOCTL_USR
270 static int sensor_flash_usr_cb (struct rk29camera_gpio_res *res,int on)
271 {
272         #error "CONFIG_SENSOR_FLASH_IOCTL_USR is 1, sensor_flash_usr_cb function must be writed!!";
273 }
274 #endif
275
276 static struct rk29camera_platform_ioctl_cb      sensor_ioctl_cb = {
277         #if CONFIG_SENSOR_POWER_IOCTL_USR
278         .sensor_power_cb = sensor_power_usr_cb,
279         #else
280         .sensor_power_cb = NULL,
281         #endif
282
283         #if CONFIG_SENSOR_RESET_IOCTL_USR
284         .sensor_reset_cb = sensor_reset_usr_cb,
285         #else
286         .sensor_reset_cb = NULL,
287         #endif
288
289         #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
290         .sensor_powerdown_cb = sensor_powerdown_usr_cb,
291         #else
292         .sensor_powerdown_cb = NULL,
293         #endif
294
295         #if CONFIG_SENSOR_FLASH_IOCTL_USR
296         .sensor_flash_cb = sensor_flash_usr_cb,
297         #else
298         .sensor_flash_cb = NULL,
299         #endif
300 };
301
302 #if CONFIG_SENSOR_IIC_ADDR_0
303 static struct reginfo_t rk_init_data_sensor_reg_0[] =
304 {
305                 {0x0000, 0x00,0,0}
306         };
307 static struct reginfo_t rk_init_data_sensor_winseqreg_0[] ={
308         {0x0000, 0x00,0,0}
309         };
310 #endif
311
312 #if CONFIG_SENSOR_IIC_ADDR_1
313 static struct reginfo_t rk_init_data_sensor_reg_1[] =
314 {
315     {0x0000, 0x00,0,0}
316 };
317 static struct reginfo_t rk_init_data_sensor_winseqreg_1[] =
318 {
319        {0x0000, 0x00,0,0}
320 };
321 #endif
322 #if CONFIG_SENSOR_IIC_ADDR_01
323 static struct reginfo_t rk_init_data_sensor_reg_01[] =
324 {
325     {0x0000, 0x00,0,0}
326 };
327 static struct reginfo_t rk_init_data_sensor_winseqreg_01[] =
328 {
329        {0x0000, 0x00,0,0}
330 };
331 #endif
332 #if CONFIG_SENSOR_IIC_ADDR_02
333 static struct reginfo_t rk_init_data_sensor_reg_02[] =
334 {
335     {0x0000, 0x00,0,0}
336 };
337 static struct reginfo_t rk_init_data_sensor_winseqreg_02[] =
338 {
339        {0x0000, 0x00,0,0}
340 };
341 #endif
342 #if CONFIG_SENSOR_IIC_ADDR_11
343 static struct reginfo_t rk_init_data_sensor_reg_11[] =
344 {
345     {0x0000, 0x00,0,0}
346 };
347 static struct reginfo_t rk_init_data_sensor_winseqreg_11[] =
348 {
349        {0x0000, 0x00,0,0}
350 };
351 #endif
352 #if CONFIG_SENSOR_IIC_ADDR_12
353 static struct reginfo_t rk_init_data_sensor_reg_12[] =
354 {
355     {0x0000, 0x00,0,0}
356 };
357 static struct reginfo_t rk_init_data_sensor_winseqreg_12[] =
358 {
359        {0x0000, 0x00,0,0}
360 };
361 #endif
362 static rk_sensor_user_init_data_s rk_init_data_sensor[RK_CAM_NUM] = 
363 {
364     #if CONFIG_SENSOR_IIC_ADDR_0
365     {
366        .rk_sensor_init_width = INVALID_VALUE,
367        .rk_sensor_init_height = INVALID_VALUE,
368        .rk_sensor_init_bus_param = INVALID_VALUE,
369        .rk_sensor_init_pixelcode = INVALID_VALUE,
370        .rk_sensor_init_data = rk_init_data_sensor_reg_0,
371        .rk_sensor_init_winseq = rk_init_data_sensor_winseqreg_0,
372        .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_0) / sizeof(struct reginfo_t),
373        .rk_sensor_init_data_size = sizeof(rk_init_data_sensor_reg_0) / sizeof(struct reginfo_t),
374     },
375     #else
376     {
377        .rk_sensor_init_width = INVALID_VALUE,
378        .rk_sensor_init_height = INVALID_VALUE,
379        .rk_sensor_init_bus_param = INVALID_VALUE,
380        .rk_sensor_init_pixelcode = INVALID_VALUE,
381        .rk_sensor_init_data = NULL,
382        .rk_sensor_init_winseq = NULL,
383        .rk_sensor_winseq_size = 0,
384        .rk_sensor_init_data_size = 0,
385     },
386     #endif
387     #if CONFIG_SENSOR_IIC_ADDR_1
388     {
389        .rk_sensor_init_width = INVALID_VALUE,
390        .rk_sensor_init_height = INVALID_VALUE,
391        .rk_sensor_init_bus_param = INVALID_VALUE,
392        .rk_sensor_init_pixelcode = INVALID_VALUE,
393        .rk_sensor_init_data = rk_init_data_sensor_reg_1,
394        .rk_sensor_init_winseq = rk_init_data_sensor_winseqreg_1,
395        .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_1) / sizeof(struct reginfo_t),
396        .rk_sensor_init_data_size = sizeof(rk_init_data_sensor_reg_1) / sizeof(struct reginfo_t),
397     },
398     #else
399     {
400        .rk_sensor_init_width = INVALID_VALUE,
401        .rk_sensor_init_height = INVALID_VALUE,
402        .rk_sensor_init_bus_param = INVALID_VALUE,
403        .rk_sensor_init_pixelcode = INVALID_VALUE,
404        .rk_sensor_init_data = NULL,
405        .rk_sensor_init_winseq = NULL,
406        .rk_sensor_winseq_size = 0,
407        .rk_sensor_init_data_size = 0,
408     },
409     #endif
410     #if CONFIG_SENSOR_IIC_ADDR_01
411     {
412        .rk_sensor_init_width = INVALID_VALUE,
413        .rk_sensor_init_height = INVALID_VALUE,
414        .rk_sensor_init_bus_param = INVALID_VALUE,
415        .rk_sensor_init_pixelcode = INVALID_VALUE,
416        .rk_sensor_init_data = rk_init_data_sensor_reg_01,
417        .rk_sensor_init_winseq = rk_init_data_sensor_winseqreg_01,
418        .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_01) / sizeof(struct reginfo_t),
419        .rk_sensor_init_data_size = sizeof(rk_init_data_sensor_reg_01) / sizeof(struct reginfo_t),
420     },
421     #else
422     {
423        .rk_sensor_init_width = INVALID_VALUE,
424        .rk_sensor_init_height = INVALID_VALUE,
425        .rk_sensor_init_bus_param = INVALID_VALUE,
426        .rk_sensor_init_pixelcode = INVALID_VALUE,
427        .rk_sensor_init_data = NULL,
428        .rk_sensor_init_winseq = NULL,
429        .rk_sensor_winseq_size = 0,
430        .rk_sensor_init_data_size = 0,
431     },
432     #endif
433     #if CONFIG_SENSOR_IIC_ADDR_02
434     {
435        .rk_sensor_init_width = INVALID_VALUE,
436        .rk_sensor_init_height = INVALID_VALUE,
437        .rk_sensor_init_bus_param = INVALID_VALUE,
438        .rk_sensor_init_pixelcode = INVALID_VALUE,
439        .rk_sensor_init_data = rk_init_data_sensor_reg_02,
440        .rk_sensor_init_winseq = rk_init_data_sensor_winseqreg_02,
441        .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_02) / sizeof(struct reginfo_t),
442        .rk_sensor_init_data_size = sizeof(rk_init_data_sensor_reg_02) / sizeof(struct reginfo_t),
443     },
444     #else
445     {
446        .rk_sensor_init_width = INVALID_VALUE,
447        .rk_sensor_init_height = INVALID_VALUE,
448        .rk_sensor_init_bus_param = INVALID_VALUE,
449        .rk_sensor_init_pixelcode = INVALID_VALUE,
450        .rk_sensor_init_data = NULL,
451        .rk_sensor_init_winseq = NULL,
452        .rk_sensor_winseq_size = 0,
453        .rk_sensor_init_data_size = 0,
454     },
455     #endif
456     #if CONFIG_SENSOR_IIC_ADDR_11
457     {
458        .rk_sensor_init_width = INVALID_VALUE,
459        .rk_sensor_init_height = INVALID_VALUE,
460        .rk_sensor_init_bus_param = INVALID_VALUE,
461        .rk_sensor_init_pixelcode = INVALID_VALUE,
462        .rk_sensor_init_data = rk_init_data_sensor_reg_11,
463        .rk_sensor_init_winseq = rk_init_data_sensor_winseqreg_11,
464        .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_11) / sizeof(struct reginfo_t),
465        .rk_sensor_init_data_size = sizeof(rk_init_data_sensor_reg_11) / sizeof(struct reginfo_t),
466     },
467     #else
468     {
469        .rk_sensor_init_width = INVALID_VALUE,
470        .rk_sensor_init_height = INVALID_VALUE,
471        .rk_sensor_init_bus_param = INVALID_VALUE,
472        .rk_sensor_init_pixelcode = INVALID_VALUE,
473        .rk_sensor_init_data = NULL,
474        .rk_sensor_init_winseq = NULL,
475        .rk_sensor_winseq_size = 0,
476        .rk_sensor_init_data_size = 0,
477     },
478     #endif
479     #if CONFIG_SENSOR_IIC_ADDR_12
480     {
481        .rk_sensor_init_width = INVALID_VALUE,
482        .rk_sensor_init_height = INVALID_VALUE,
483        .rk_sensor_init_bus_param = INVALID_VALUE,
484        .rk_sensor_init_pixelcode = INVALID_VALUE,
485        .rk_sensor_init_data = rk_init_data_sensor_reg_12,
486        .rk_sensor_init_winseq = rk_init_data_sensor_winseqreg_12,
487        .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_12) / sizeof(struct reginfo_t),
488        .rk_sensor_init_data_size = sizeof(rk_init_data_sensor_reg_12) / sizeof(struct reginfo_t),
489     },
490     #else
491     {
492        .rk_sensor_init_width = INVALID_VALUE,
493        .rk_sensor_init_height = INVALID_VALUE,
494        .rk_sensor_init_bus_param = INVALID_VALUE,
495        .rk_sensor_init_pixelcode = INVALID_VALUE,
496        .rk_sensor_init_data = NULL,
497        .rk_sensor_init_winseq = NULL,
498        .rk_sensor_winseq_size = 0,
499        .rk_sensor_init_data_size = 0,
500     },
501     #endif
502
503  };
504 #include "../../../drivers/media/video/rk30_camera.c"
505
506 #endif /* CONFIG_VIDEO_RK29 */
507
508 #if defined(CONFIG_TOUCHSCREEN_GT8XX)
509 #define TOUCH_RESET_PIN  RK30_PIN4_PD0
510 #define TOUCH_PWR_PIN    INVALID_GPIO
511 int goodix_init_platform_hw(void)
512 {
513         int ret;
514         
515         rk30_mux_api_set(GPIO4D0_SMCDATA8_TRACEDATA8_NAME, GPIO4D_GPIO4D0);
516         rk30_mux_api_set(GPIO4C2_SMCDATA2_TRACEDATA2_NAME, GPIO4C_GPIO4C2);
517         printk("%s:0x%x,0x%x\n",__func__,rk30_mux_api_get(GPIO4D0_SMCDATA8_TRACEDATA8_NAME),rk30_mux_api_get(GPIO4C2_SMCDATA2_TRACEDATA2_NAME));
518
519         if (TOUCH_PWR_PIN != INVALID_GPIO) {
520                 ret = gpio_request(TOUCH_PWR_PIN, "goodix power pin");
521                 if (ret != 0) {
522                         gpio_free(TOUCH_PWR_PIN);
523                         printk("goodix power error\n");
524                         return -EIO;
525                 }
526                 gpio_direction_output(TOUCH_PWR_PIN, 0);
527                 gpio_set_value(TOUCH_PWR_PIN, GPIO_LOW);
528                 msleep(100);
529         }
530
531         if (TOUCH_RESET_PIN != INVALID_GPIO) {
532                 ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
533                 if (ret != 0) {
534                         gpio_free(TOUCH_RESET_PIN);
535                         printk("goodix gpio_request error\n");
536                         return -EIO;
537                 }
538                 gpio_direction_output(TOUCH_RESET_PIN, 1);
539                 msleep(100);
540                 //gpio_set_value(TOUCH_RESET_PIN, GPIO_LOW);
541                 //msleep(100);
542                 //gpio_set_value(TOUCH_RESET_PIN, GPIO_HIGH);
543                 //msleep(500);
544         }
545         return 0;
546 }
547
548 struct goodix_platform_data goodix_info = {
549         .model = 8105,
550         .irq_pin = RK30_PIN4_PC2,
551         .rest_pin = TOUCH_RESET_PIN,
552         .init_platform_hw = goodix_init_platform_hw,
553 };
554 #endif
555
556 static struct spi_board_info board_spi_devices[] = {
557 };
558
559 /***********************************************************
560 *       rk30  backlight
561 ************************************************************/
562 #ifdef CONFIG_BACKLIGHT_RK29_BL
563 #define PWM_ID            0
564 #define PWM_MUX_NAME      GPIO0A3_PWM0_NAME
565 #define PWM_MUX_MODE      GPIO0A_PWM0
566 #define PWM_MUX_MODE_GPIO GPIO0A_GPIO0A3
567 #define PWM_GPIO          RK30_PIN0_PA3
568 #define PWM_EFFECT_VALUE  1
569
570 #define LCD_DISP_ON_PIN
571
572 #ifdef  LCD_DISP_ON_PIN
573 //#define BL_EN_MUX_NAME    GPIOF34_UART3_SEL_NAME
574 //#define BL_EN_MUX_MODE    IOMUXB_GPIO1_B34
575
576 #define BL_EN_PIN         RK30_PIN6_PB3
577 #define BL_EN_VALUE       GPIO_HIGH
578 #endif
579 static int rk29_backlight_io_init(void)
580 {
581         int ret = 0;
582         rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
583 #ifdef  LCD_DISP_ON_PIN
584         // rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
585
586         ret = gpio_request(BL_EN_PIN, NULL);
587         if (ret != 0) {
588                 gpio_free(BL_EN_PIN);
589         }
590
591         gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
592         gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
593 #endif
594         return ret;
595 }
596
597 static int rk29_backlight_io_deinit(void)
598 {
599         int ret = 0;
600 #ifdef  LCD_DISP_ON_PIN
601         gpio_free(BL_EN_PIN);
602 #endif
603         rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
604         gpio_free(PWM_GPIO);
605         if (ret = gpio_request(PWM_GPIO, NULL)) {
606           printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
607           return -1;
608         }
609         gpio_direction_output(PWM_GPIO, !BL_EN_VALUE);
610         gpio_set_value(PWM_GPIO,!BL_EN_VALUE);
611         return ret;
612 }
613
614 static int rk29_backlight_pwm_suspend(void)
615 {
616         int ret = 0;
617         rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
618         if (gpio_request(PWM_GPIO, NULL)) {
619                 printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
620                 return -1;
621         }
622         gpio_direction_output(PWM_GPIO, GPIO_LOW);
623 #ifdef  LCD_DISP_ON_PIN
624         gpio_direction_output(BL_EN_PIN, 0);
625         gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
626 #endif
627         return ret;
628 }
629
630 static int rk29_backlight_pwm_resume(void)
631 {
632         gpio_free(PWM_GPIO);
633         rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
634 #ifdef  LCD_DISP_ON_PIN
635         msleep(30);
636         gpio_direction_output(BL_EN_PIN, 1);
637         gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
638 #endif
639         return 0;
640 }
641
642 static struct rk29_bl_info rk29_bl_info = {
643         .pwm_id = PWM_ID,
644         .bl_ref = PWM_EFFECT_VALUE,
645         .io_init = rk29_backlight_io_init,
646         .io_deinit = rk29_backlight_io_deinit,
647         .pwm_suspend = rk29_backlight_pwm_suspend,
648         .pwm_resume = rk29_backlight_pwm_resume,
649         .min_brightness = 60,
650         .pre_div = 20000,
651 };
652
653 static struct platform_device rk29_device_backlight = {
654         .name   = "rk29_backlight",
655         .id     = -1,
656         .dev    = {
657                 .platform_data  = &rk29_bl_info,
658         }
659 };
660
661 #endif
662
663 #ifdef CONFIG_RK29_SUPPORT_MODEM
664
665 #define RK30_MODEM_POWER        RK30_PIN4_PD1
666 #define RK30_MODEM_POWER_IOMUX  rk29_mux_api_set(GPIO4D1_SMCDATA9_TRACEDATA9_NAME, GPIO4D_GPIO4D1)
667
668 static int rk30_modem_io_init(void)
669 {
670     printk("%s\n", __FUNCTION__);
671     RK30_MODEM_POWER_IOMUX;
672
673         return 0;
674 }
675
676 static struct rk29_io_t rk30_modem_io = {
677     .io_addr    = RK30_MODEM_POWER,
678     .enable     = GPIO_HIGH,
679     .disable    = GPIO_LOW,
680     .io_init    = rk30_modem_io_init,
681 };
682
683 static struct platform_device rk30_device_modem = {
684         .name   = "rk30_modem",
685         .id     = -1,
686         .dev    = {
687                 .platform_data  = &rk30_modem_io,
688         }
689 };
690 #endif
691
692 /*MMA8452 gsensor*/
693 #if defined (CONFIG_GS_MMA8452)
694 #define MMA8452_INT_PIN   RK30_PIN4_PC0
695
696 static int mma8452_init_platform_hw(void)
697 {
698         rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
699
700         return 0;
701 }
702
703 static struct gsensor_platform_data mma8452_info = {
704         .model = 8452,
705         .swap_xy = 0,
706         .swap_xyz = 1,
707         .init_platform_hw = mma8452_init_platform_hw,
708         .orientation ={1, 0, 0, 0, 0, -1, 0, -1, 0},
709 };
710 #endif
711 #if defined (CONFIG_COMPASS_AK8975)
712 static struct akm8975_platform_data akm8975_info =
713 {
714         .m_layout = 
715         {
716                 {
717                         {1, 0, 0},
718                         {0, 0, 1},
719                         {0, 1, 0},
720                 },
721
722                 {
723                         {1, 0, 0},
724                         {0, 1, 0},
725                         {0, 0, 1},
726                 },
727
728                 {
729                         {1, 0, 0},
730                         {0, 1, 0},
731                         {0, 0, 1},
732                 },
733
734                 {
735                         {1, 0, 0},
736                         {0, 1, 0},
737                         {0, 0, 1},
738                 },
739         }
740 };
741
742 #endif
743
744 #if defined(CONFIG_GYRO_L3G4200D)
745
746 #include <linux/l3g4200d.h>
747 #define L3G4200D_INT_PIN  RK30_PIN4_PC3
748
749 static int l3g4200d_init_platform_hw(void)
750 {
751         rk30_mux_api_set(GPIO4C3_SMCDATA3_TRACEDATA3_NAME, GPIO4C_GPIO4C3);
752         
753         return 0;
754 }
755
756 static struct l3g4200d_platform_data l3g4200d_info = {
757         .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
758         .init = l3g4200d_init_platform_hw,
759         .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware
760         .y_min = 40,
761         .z_min = 20,
762 };
763
764 #endif
765
766 #ifdef CONFIG_LS_CM3217
767
768 #define CM3217_POWER_PIN        INVALID_GPIO
769 #define CM3217_IRQ_PIN          INVALID_GPIO
770 static int cm3217_init_hw(void)
771 {
772 #if 0
773         if (gpio_request(CM3217_POWER_PIN, NULL) != 0) {
774                 gpio_free(CM3217_POWER_PIN);
775                 printk("%s: request cm3217 power pin error\n", __func__);
776                 return -EIO;
777         }
778         gpio_pull_updown(CM3217_POWER_PIN, PullDisable);
779
780         if (gpio_request(CM3217_IRQ_PIN, NULL) != 0) {
781                 gpio_free(CM3217_IRQ_PIN);
782                 printk("%s: request cm3217 int pin error\n", __func__);
783                 return -EIO;
784         }
785         gpio_pull_updown(CM3217_IRQ_PIN, PullDisable);
786 #endif
787         return 0;
788 }
789
790 static void cm3217_exit_hw(void)
791 {
792 #if 0
793         gpio_free(CM3217_POWER_PIN);
794         gpio_free(CM3217_IRQ_PIN);
795 #endif
796         return;
797 }
798
799 static struct cm3217_platform_data cm3217_info = {
800         .irq_pin = CM3217_IRQ_PIN,
801         .power_pin = CM3217_POWER_PIN,
802         .init_platform_hw = cm3217_init_hw,
803         .exit_platform_hw = cm3217_exit_hw,
804 };
805 #endif
806
807 #ifdef CONFIG_FB_ROCKCHIP
808
809 #define LCD_CS_MUX_NAME    GPIO4C7_SMCDATA7_TRACEDATA7_NAME
810 #define LCD_CS_PIN         RK30_PIN4_PC7
811 #define LCD_CS_VALUE       GPIO_HIGH
812 #define LCD_EN_PIN         RK30_PIN6_PB4
813 #define LCD_EN_VALUE       GPIO_HIGH
814
815 static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
816 {
817         int ret = 0;
818         rk30_mux_api_set(LCD_CS_MUX_NAME, GPIO4C_GPIO4C7);
819         ret = gpio_request(LCD_CS_PIN, "lcd_CS");
820         if(ret!=0){
821            gpio_free(LCD_CS_PIN);
822            printk(KERN_ERR "request lcd cs pin fail!\n");
823         }
824         gpio_direction_output(LCD_CS_PIN, LCD_CS_VALUE);
825         gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE);
826
827         ret = gpio_request(LCD_EN_PIN, "lcd_en");
828         if (ret != 0)
829         {
830                 gpio_free(LCD_EN_PIN);
831                 printk(KERN_ERR "request lcd en pin fail!\n");
832                 return -1;
833         }
834         else
835         {
836                 gpio_direction_output(LCD_EN_PIN, LCD_EN_VALUE);
837                 gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
838         }
839         return 0;
840 }
841 static int rk_fb_io_disable(void)
842 {
843         gpio_set_value(LCD_EN_PIN, !LCD_EN_VALUE);
844         gpio_set_value(LCD_CS_PIN, !LCD_CS_VALUE);
845         return 0;
846 }
847 static int rk_fb_io_enable(void)
848 {
849         gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
850         gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE);
851         return 0;
852 }
853
854 #if defined(CONFIG_LCDC0_RK30)
855 struct rk29fb_info lcdc0_screen_info = {
856         .prop      = PRMRY,             //primary display device
857         .io_init   = rk_fb_io_init,
858         .io_disable = rk_fb_io_disable,
859         .io_enable = rk_fb_io_enable,
860         .set_screen_info = set_lcd_info,
861 };
862 #endif
863
864 #if defined(CONFIG_LCDC1_RK30)
865 struct rk29fb_info lcdc1_screen_info = {
866         #if defined(CONFIG_HDMI_RK30)
867         .prop           = EXTEND,       //extend display device
868         .lcd_info  = NULL,
869         .set_screen_info = hdmi_init_lcdc,
870         #endif
871 };
872 #endif
873
874 static struct resource resource_fb[] = {
875         [0] = {
876                 .name  = "fb0 buf",
877                 .start = 0,
878                 .end   = 0,//RK30_FB0_MEM_SIZE - 1,
879                 .flags = IORESOURCE_MEM,
880         },
881         [1] = {
882                 .name  = "ipp buf",  //for rotate
883                 .start = 0,
884                 .end   = 0,//RK30_FB0_MEM_SIZE - 1,
885                 .flags = IORESOURCE_MEM,
886         },
887         [2] = {
888                 .name  = "fb2 buf",
889                 .start = 0,
890                 .end   = 0,//RK30_FB0_MEM_SIZE - 1,
891                 .flags = IORESOURCE_MEM,
892         },
893 };
894
895 static struct platform_device device_fb = {
896         .name           = "rk-fb",
897         .id             = -1,
898         .num_resources  = ARRAY_SIZE(resource_fb),
899         .resource       = resource_fb,
900 };
901 #endif
902
903 #if defined(CONFIG_LCDC0_RK30)
904 static struct resource resource_lcdc0[] = {
905         [0] = {
906                 .name  = "lcdc0 reg",
907                 .start = RK30_LCDC0_PHYS,
908                 .end   = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
909                 .flags = IORESOURCE_MEM,
910         },
911         
912         [1] = {
913                 .name  = "lcdc0 irq",
914                 .start = IRQ_LCDC0,
915                 .end   = IRQ_LCDC0,
916                 .flags = IORESOURCE_IRQ,
917         },
918 };
919
920 static struct platform_device device_lcdc0 = {
921         .name             = "rk30-lcdc",
922         .id               = 0,
923         .num_resources    = ARRAY_SIZE(resource_lcdc0),
924         .resource         = resource_lcdc0,
925         .dev            = {
926                 .platform_data = &lcdc0_screen_info,
927         },
928 };
929 #endif
930
931 #if defined(CONFIG_LCDC1_RK30) 
932 extern struct rk29fb_info lcdc1_screen_info;
933 static struct resource resource_lcdc1[] = {
934         [0] = {
935                 .name  = "lcdc1 reg",
936                 .start = RK30_LCDC1_PHYS,
937                 .end   = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
938                 .flags = IORESOURCE_MEM,
939         },
940         [1] = {
941                 .name  = "lcdc1 irq",
942                 .start = IRQ_LCDC1,
943                 .end   = IRQ_LCDC1,
944                 .flags = IORESOURCE_IRQ,
945         },
946 };
947
948 static struct platform_device device_lcdc1 = {
949         .name             = "rk30-lcdc",
950         .id               = 1,
951         .num_resources    = ARRAY_SIZE(resource_lcdc1),
952         .resource         = resource_lcdc1,
953         .dev            = {
954                 .platform_data = &lcdc1_screen_info,
955         },
956 };
957 #endif
958
959 #ifdef CONFIG_ANDROID_TIMED_GPIO
960 static struct timed_gpio timed_gpios[] = {
961         {
962                 .name = "vibrator",
963                 .gpio = RK30_PIN0_PA4,
964                 .max_timeout = 1000,
965                 .active_low = 0,
966                 .adjust_time =20,      //adjust for diff product
967         },
968 };
969
970 static struct timed_gpio_platform_data rk29_vibrator_info = {
971         .num_gpios = 1,
972         .gpios = timed_gpios,
973 };
974
975 static struct platform_device rk29_device_vibrator = {
976         .name = "timed-gpio",
977         .id = -1,
978         .dev = {
979                 .platform_data = &rk29_vibrator_info,
980         },
981
982 };
983 #endif
984
985 #ifdef CONFIG_LEDS_GPIO_PLATFORM
986 static struct gpio_led rk29_leds[] = {
987         {
988                 .name = "button-backlight",
989                 .gpio = RK30_PIN4_PD7,
990                 .default_trigger = "timer",
991                 .active_low = 0,
992                 .retain_state_suspended = 0,
993                 .default_state = LEDS_GPIO_DEFSTATE_OFF,
994         },
995 };
996
997 static struct gpio_led_platform_data rk29_leds_pdata = {
998         .leds = rk29_leds,
999         .num_leds = ARRAY_SIZE(rk29_leds),
1000 };
1001
1002 static struct platform_device rk29_device_gpio_leds = {
1003         .name   = "leds-gpio",
1004         .id     = -1,
1005         .dev    = {
1006                 .platform_data  = &rk29_leds_pdata,
1007         },
1008 };
1009 #endif
1010
1011 #ifdef CONFIG_RK_IRDA
1012 #define IRDA_IRQ_PIN           RK30_PIN6_PA1
1013
1014 static int irda_iomux_init(void)
1015 {
1016         int ret = 0;
1017
1018         //irda irq pin
1019         ret = gpio_request(IRDA_IRQ_PIN, NULL);
1020         if (ret != 0) {
1021                 gpio_free(IRDA_IRQ_PIN);
1022                 printk(">>>>>> IRDA_IRQ_PIN gpio_request err \n ");
1023         }
1024         gpio_pull_updown(IRDA_IRQ_PIN, PullDisable);
1025         gpio_direction_input(IRDA_IRQ_PIN);
1026
1027         return 0;
1028 }
1029
1030 static int irda_iomux_deinit(void)
1031 {
1032         gpio_free(IRDA_IRQ_PIN);
1033         return 0;
1034 }
1035
1036 static struct irda_info rk29_irda_info = {
1037         .intr_pin = IRDA_IRQ_PIN,
1038         .iomux_init = irda_iomux_init,
1039         .iomux_deinit = irda_iomux_deinit,
1040         //.irda_pwr_ctl = bu92747guw_power_ctl,
1041 };
1042
1043 static struct platform_device irda_device = {
1044 #ifdef CONFIG_RK_IRDA_NET
1045         .name = "rk_irda",
1046 #else
1047         .name = "bu92747_irda",
1048 #endif
1049         .id = -1,
1050         .dev = {
1051                 .platform_data = &rk29_irda_info,
1052         }
1053 };
1054 #endif
1055
1056 #ifdef CONFIG_ION
1057 #define ION_RESERVE_SIZE        (80 * SZ_1M)
1058 static struct ion_platform_data rk30_ion_pdata = {
1059         .nr = 1,
1060         .heaps = {
1061                 {
1062                         .type = ION_HEAP_TYPE_CARVEOUT,
1063                         .id = ION_NOR_HEAP_ID,
1064                         .name = "norheap",
1065                         .size = ION_RESERVE_SIZE,
1066                 }
1067         },
1068 };
1069
1070 static struct platform_device device_ion = {
1071         .name = "ion-rockchip",
1072         .id = 0,
1073         .dev = {
1074                 .platform_data = &rk30_ion_pdata,
1075         },
1076 };
1077 #endif
1078
1079 /**************************************************************************************************
1080  * SDMMC devices,  include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
1081 **************************************************************************************************/
1082 #ifdef CONFIG_SDMMC_RK29
1083 #include "board-rk30-sdk-sdmmc.c"
1084
1085 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
1086 #define SDMMC0_WRITE_PROTECT_PIN        RK30_PIN3_PB7   //According to your own project to set the value of write-protect-pin.
1087 #endif
1088
1089 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
1090 #define SDMMC1_WRITE_PROTECT_PIN        RK30_PIN3_PC7   //According to your own project to set the value of write-protect-pin.
1091 #endif
1092
1093 #define RK29SDK_WIFI_SDIO_CARD_DETECT_N    RK30_PIN6_PB2
1094
1095 #endif //endif ---#ifdef CONFIG_SDMMC_RK29
1096
1097 #ifdef CONFIG_SDMMC0_RK29
1098 static int rk29_sdmmc0_cfg_gpio(void)
1099 {
1100 #ifdef CONFIG_SDMMC_RK29_OLD
1101         rk30_mux_api_set(GPIO3B1_SDMMC0CMD_NAME, GPIO3B_SDMMC0_CMD);
1102         rk30_mux_api_set(GPIO3B0_SDMMC0CLKOUT_NAME, GPIO3B_SDMMC0_CLKOUT);
1103         rk30_mux_api_set(GPIO3B2_SDMMC0DATA0_NAME, GPIO3B_SDMMC0_DATA0);
1104         rk30_mux_api_set(GPIO3B3_SDMMC0DATA1_NAME, GPIO3B_SDMMC0_DATA1);
1105         rk30_mux_api_set(GPIO3B4_SDMMC0DATA2_NAME, GPIO3B_SDMMC0_DATA2);
1106         rk30_mux_api_set(GPIO3B5_SDMMC0DATA3_NAME, GPIO3B_SDMMC0_DATA3);
1107
1108         rk30_mux_api_set(GPIO3B6_SDMMC0DETECTN_NAME, GPIO3B_GPIO3B6);
1109
1110         rk30_mux_api_set(GPIO3A7_SDMMC0PWREN_NAME, GPIO3A_GPIO3A7);
1111         gpio_request(RK30_PIN3_PA7, "sdmmc-power");
1112         gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);
1113
1114 #else
1115         rk29_sdmmc_set_iomux(0, 0xFFFF);
1116
1117         rk30_mux_api_set(GPIO3B6_SDMMC0DETECTN_NAME, GPIO3B_SDMMC0_DETECT_N);
1118
1119 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
1120         gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
1121         gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
1122 #endif
1123
1124 #endif
1125
1126         return 0;
1127 }
1128
1129 #define CONFIG_SDMMC0_USE_DMA
1130 struct rk29_sdmmc_platform_data default_sdmmc0_data = {
1131         .host_ocr_avail =
1132             (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
1133              MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
1134              MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36),
1135         .host_caps =
1136             (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1137         .io_init = rk29_sdmmc0_cfg_gpio,
1138
1139 #if !defined(CONFIG_SDMMC_RK29_OLD)
1140         .set_iomux = rk29_sdmmc_set_iomux,
1141 #endif
1142
1143         .dma_name = "sd_mmc",
1144 #ifdef CONFIG_SDMMC0_USE_DMA
1145         .use_dma = 1,
1146 #else
1147         .use_dma = 0,
1148 #endif
1149         .detect_irq = RK30_PIN3_PB6,    // INVALID_GPIO
1150         .enable_sd_wakeup = 0,
1151
1152 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
1153         .write_prt = SDMMC0_WRITE_PROTECT_PIN,
1154 #else
1155         .write_prt = INVALID_GPIO,
1156 #endif
1157 };
1158 #endif // CONFIG_SDMMC0_RK29
1159
1160 #ifdef CONFIG_SND_SOC_RK610
1161 static int rk610_codec_io_init(void)
1162 {
1163 //if need iomux.
1164 //Must not gpio_request
1165         return 0;
1166 }
1167
1168 static struct rk610_codec_platform_data rk610_codec_pdata = {
1169         .spk_ctl_io = RK30_PIN4_PC6,
1170         .io_init = rk610_codec_io_init,
1171 };
1172 #endif
1173
1174 #ifdef CONFIG_SDMMC1_RK29
1175 #define CONFIG_SDMMC1_USE_DMA
1176 static int rk29_sdmmc1_cfg_gpio(void)
1177 {
1178 #if defined(CONFIG_SDMMC_RK29_OLD)
1179         rk30_mux_api_set(GPIO3C0_SMMC1CMD_NAME, GPIO3C_SMMC1_CMD);
1180         rk30_mux_api_set(GPIO3C5_SDMMC1CLKOUT_NAME, GPIO3C_SDMMC1_CLKOUT);
1181         rk30_mux_api_set(GPIO3C1_SDMMC1DATA0_NAME, GPIO3C_SDMMC1_DATA0);
1182         rk30_mux_api_set(GPIO3C2_SDMMC1DATA1_NAME, GPIO3C_SDMMC1_DATA1);
1183         rk30_mux_api_set(GPIO3C3_SDMMC1DATA2_NAME, GPIO3C_SDMMC1_DATA2);
1184         rk30_mux_api_set(GPIO3C4_SDMMC1DATA3_NAME, GPIO3C_SDMMC1_DATA3);
1185         //rk30_mux_api_set(GPIO3C6_SDMMC1DETECTN_NAME, GPIO3C_SDMMC1_DETECT_N);
1186
1187 #else
1188
1189 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
1190         gpio_request(SDMMC1_WRITE_PROTECT_PIN, "sdio-wp");
1191         gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
1192 #endif
1193
1194 #endif
1195
1196         return 0;
1197 }
1198
1199 struct rk29_sdmmc_platform_data default_sdmmc1_data = {
1200         .host_ocr_avail =
1201             (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
1202              MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
1203              MMC_VDD_33_34),
1204
1205 #if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
1206         .host_caps = (MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
1207                       MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1208 #else
1209         .host_caps =
1210             (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1211 #endif
1212
1213         .io_init = rk29_sdmmc1_cfg_gpio,
1214
1215 #if !defined(CONFIG_SDMMC_RK29_OLD)
1216         .set_iomux = rk29_sdmmc_set_iomux,
1217 #endif
1218
1219         .dma_name = "sdio",
1220 #ifdef CONFIG_SDMMC1_USE_DMA
1221         .use_dma = 1,
1222 #else
1223         .use_dma = 0,
1224 #endif
1225
1226 #if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
1227 #ifdef CONFIG_WIFI_CONTROL_FUNC
1228         .status = rk29sdk_wifi_status,
1229         .register_status_notify = rk29sdk_wifi_status_register,
1230 #endif
1231 #if 0
1232         .detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N,
1233 #endif
1234
1235 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
1236         .write_prt = SDMMC1_WRITE_PROTECT_PIN,
1237 #else
1238         .write_prt = INVALID_GPIO,
1239 #endif
1240
1241 #else
1242         .detect_irq = INVALID_GPIO,
1243         .enable_sd_wakeup = 0,
1244 #endif
1245
1246 };
1247 #endif //endif--#ifdef CONFIG_SDMMC1_RK29
1248
1249 /**************************************************************************************************
1250  * the end of setting for SDMMC devices
1251 **************************************************************************************************/
1252
1253 /* bluetooth rfkill device */
1254 static struct platform_device rk29sdk_rfkill = {
1255         .name = "rk29sdk_rfkill",
1256         .id = -1,
1257 };
1258
1259 #ifdef CONFIG_BATTERY_RK30_ADC
1260 static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
1261         .dc_det_pin      = RK30_PIN6_PA5,
1262         .batt_low_pin    = RK30_PIN6_PA0,
1263         .charge_set_pin  = INVALID_GPIO,
1264         .charge_ok_pin   = RK30_PIN6_PA6,
1265         .dc_det_level    = GPIO_LOW,
1266         .charge_ok_level = GPIO_HIGH,
1267 };
1268
1269 static struct platform_device rk30_device_adc_battery = {
1270         .name   = "rk30-battery",
1271         .id     = -1,
1272         .dev = {
1273                 .platform_data = &rk30_adc_battery_platdata,
1274         },
1275 };
1276 #endif
1277
1278 #ifdef CONFIG_RK29_VMAC
1279 #define PHY_PWR_EN_GPIO RK30_PIN1_PD6
1280 #include "board-rk30-sdk-vmac.c"
1281 #endif
1282
1283 static struct platform_device *devices[] __initdata = {
1284 #ifdef CONFIG_FB_ROCKCHIP
1285         &device_fb,
1286 #endif
1287 #if defined(CONFIG_LCDC0_RK30)
1288         &device_lcdc0,
1289 #endif
1290 #if defined(CONFIG_LCDC1_RK30)
1291         &device_lcdc1,
1292 #endif
1293         
1294 #ifdef CONFIG_BACKLIGHT_RK29_BL
1295         &rk29_device_backlight,
1296 #endif
1297
1298 #ifdef CONFIG_ION
1299         &device_ion,
1300 #endif
1301 #ifdef CONFIG_ANDROID_TIMED_GPIO
1302         &rk29_device_vibrator,
1303 #endif
1304 #ifdef CONFIG_LEDS_GPIO_PLATFORM
1305         &rk29_device_gpio_leds,
1306 #endif
1307 #ifdef CONFIG_RK_IRDA
1308         &irda_device,
1309 #endif
1310 #ifdef CONFIG_WIFI_CONTROL_FUNC
1311         &rk29sdk_wifi_device,
1312 #endif
1313 #ifdef CONFIG_BT
1314     &rk29sdk_rfkill,
1315 #endif
1316 #ifdef CONFIG_RK29_SUPPORT_MODEM
1317     &rk30_device_modem,
1318 #endif
1319 #ifdef CONFIG_BATTERY_RK30_ADC
1320         &rk30_device_adc_battery,
1321 #endif
1322 };
1323
1324 // i2c
1325 #ifdef CONFIG_I2C0_RK30
1326 static struct i2c_board_info __initdata i2c0_info[] = {
1327 #if defined (CONFIG_GS_MMA8452)
1328         {
1329                 .type           = "gs_mma8452",
1330                 .addr           = 0x1d,
1331                 .flags          = 0,
1332                 .irq            = MMA8452_INT_PIN,
1333                 .platform_data = &mma8452_info,
1334         },
1335 #endif
1336 #if defined (CONFIG_COMPASS_AK8975)
1337         {
1338                 .type          = "ak8975",
1339                 .addr          = 0x0d,
1340                 .flags         = 0,
1341                 .irq           = RK30_PIN4_PC1,
1342                 .platform_data = &akm8975_info,
1343         },
1344 #endif
1345 #if defined (CONFIG_GYRO_L3G4200D)
1346         {
1347                 .type          = "l3g4200d_gryo",
1348                 .addr          = 0x69,
1349                 .flags         = 0,
1350                 .irq           = L3G4200D_INT_PIN,
1351                 .platform_data = &l3g4200d_info,
1352         },
1353 #endif
1354 #if defined (CONFIG_SND_SOC_RK1000)
1355         {
1356                 .type          = "rk1000_i2c_codec",
1357                 .addr          = 0x60,
1358                 .flags         = 0,
1359         },
1360         {
1361                 .type          = "rk1000_control",
1362                 .addr          = 0x40,
1363                 .flags         = 0,
1364         },
1365 #endif
1366 #if defined (CONFIG_SND_SOC_RT5631)
1367         {
1368                 .type                   = "rt5631",
1369                 .addr                   = 0x1a,
1370                 .flags                  = 0,
1371         },
1372 #endif
1373
1374 #ifdef CONFIG_MFD_RK610
1375                 {
1376                         .type                   = "rk610_ctl",
1377                         .addr                   = 0x40,
1378                         .flags                  = 0,
1379                 },
1380 #ifdef CONFIG_RK610_TVOUT
1381                 {
1382                         .type                   = "rk610_tvout",
1383                         .addr                   = 0x42,
1384                         .flags                  = 0,
1385                 },
1386 #endif
1387 #ifdef CONFIG_HDMI_RK610
1388                 {
1389                         .type                   = "rk610_hdmi",
1390                         .addr                   = 0x46,
1391                         .flags                  = 0,
1392                         .irq                    = RK29_PIN5_PA2,
1393                 },
1394 #endif
1395 #ifdef CONFIG_SND_SOC_RK610
1396                 {//RK610_CODEC addr  from 0x60 to 0x80 (0x60~0x80)
1397                         .type                   = "rk610_i2c_codec",
1398                         .addr                   = 0x60,
1399                         .flags                  = 0,
1400                         .platform_data          = &rk610_codec_pdata,                   
1401                 },
1402 #endif
1403 #endif
1404
1405 };
1406 #endif
1407
1408 #ifdef CONFIG_I2C1_RK30
1409 #include "board-rk30-ds1001b-wm8326.c"
1410
1411 static struct i2c_board_info __initdata i2c1_info[] = {
1412 #if defined (CONFIG_MFD_WM831X_I2C)
1413         {
1414                 .type          = "wm8326",
1415                 .addr          = 0x34,
1416                 .flags         = 0,
1417                 .irq           = RK30_PIN6_PA4,
1418                 .platform_data = &wm831x_platdata,
1419         },
1420 #endif
1421 };
1422 #endif
1423
1424 #ifdef CONFIG_I2C2_RK30
1425 static struct i2c_board_info __initdata i2c2_info[] = {
1426 #if defined (CONFIG_TOUCHSCREEN_GT8XX)
1427         {
1428                 .type          = "Goodix-TS",
1429                 .addr          = 0x55,
1430                 .flags         = 0,
1431                 .irq           = RK30_PIN4_PC2,
1432                 .platform_data = &goodix_info,
1433         },
1434 #endif
1435 #if defined (CONFIG_LS_CM3217)
1436         {
1437                 .type          = "lightsensor",
1438                 .addr          = 0x10,
1439                 .flags         = 0,
1440                 .irq           = CM3217_IRQ_PIN,
1441                 .platform_data = &cm3217_info,
1442         },
1443 #endif
1444 };
1445 #endif
1446
1447 #ifdef CONFIG_I2C3_RK30
1448 static struct i2c_board_info __initdata i2c3_info[] = {
1449 };
1450 #endif
1451
1452 #ifdef CONFIG_I2C4_RK30
1453 static struct i2c_board_info __initdata i2c4_info[] = {
1454 };
1455 #endif
1456
1457 #ifdef CONFIG_I2C_GPIO_RK30
1458 #define I2C_SDA_PIN     INVALID_GPIO// RK30_PIN2_PD6   //set sda_pin here
1459 #define I2C_SCL_PIN     INVALID_GPIO//RK30_PIN2_PD7   //set scl_pin here
1460 static int rk30_i2c_io_init(void)
1461 {
1462         //set iomux (gpio) here
1463         //rk30_mux_api_set(GPIO2D7_I2C1SCL_NAME, GPIO2D_GPIO2D7);
1464         //rk30_mux_api_set(GPIO2D6_I2C1SDA_NAME, GPIO2D_GPIO2D6);
1465
1466         return 0;
1467 }
1468 struct i2c_gpio_platform_data default_i2c_gpio_data = {
1469        .sda_pin = I2C_SDA_PIN,
1470        .scl_pin = I2C_SCL_PIN,
1471        .udelay = 5, // clk = 500/udelay = 100Khz
1472        .timeout = 100,//msecs_to_jiffies(100),
1473        .bus_num    = 5,
1474        .io_init = rk30_i2c_io_init,
1475 };
1476 static struct i2c_board_info __initdata i2c_gpio_info[] = {
1477 };
1478 #endif
1479
1480 static void __init rk30_i2c_register_board_info(void)
1481 {
1482 #ifdef CONFIG_I2C0_RK30
1483         i2c_register_board_info(0, i2c0_info, ARRAY_SIZE(i2c0_info));
1484 #endif
1485 #ifdef CONFIG_I2C1_RK30
1486         i2c_register_board_info(1, i2c1_info, ARRAY_SIZE(i2c1_info));
1487 #endif
1488 #ifdef CONFIG_I2C2_RK30
1489         i2c_register_board_info(2, i2c2_info, ARRAY_SIZE(i2c2_info));
1490 #endif
1491 #ifdef CONFIG_I2C3_RK30
1492         i2c_register_board_info(3, i2c3_info, ARRAY_SIZE(i2c3_info));
1493 #endif
1494 #ifdef CONFIG_I2C4_RK30
1495         i2c_register_board_info(4, i2c4_info, ARRAY_SIZE(i2c4_info));
1496 #endif
1497 #ifdef CONFIG_I2C_GPIO_RK30
1498         i2c_register_board_info(5, i2c_gpio_info, ARRAY_SIZE(i2c_gpio_info));
1499 #endif
1500 }
1501 //end of i2c
1502
1503 static void dcr_en_low(void)
1504 {
1505   int ret;
1506   ret=gpio_request(RK30_PIN4_PB7,"dcr_en");
1507   if(ret<0){
1508      printk("dcr_en_low request io error");
1509      gpio_free(RK30_PIN4_PB7);
1510      return;
1511   }
1512   gpio_direction_output(RK30_PIN4_PB7, GPIO_LOW);
1513 }
1514 #define POWER_ON_PIN RK30_PIN6_PB0   //power_hold
1515 static void rk30_pm_power_off(void)
1516 {
1517         printk(KERN_ERR "rk30_pm_power_off start...\n");
1518         gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
1519 #if defined(CONFIG_MFD_WM831X)
1520         wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000);  //set sys_pwr 0
1521         wm831x_device_shutdown(Wm831x);//wm8326 shutdown
1522 #endif
1523         while (1);
1524 }
1525 static void __init machine_rk30_board_init(void)
1526 {
1527         avs_init();
1528         gpio_request(POWER_ON_PIN, "poweronpin");
1529         gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
1530         
1531         pm_power_off = rk30_pm_power_off;
1532         
1533         rk30_i2c_register_board_info();
1534         spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
1535         platform_add_devices(devices, ARRAY_SIZE(devices));
1536         board_usb_detect_init(RK30_PIN6_PA3);
1537
1538 #ifdef CONFIG_WIFI_CONTROL_FUNC
1539         rk29sdk_wifi_bt_gpio_control_init();
1540 #endif
1541         dcr_en_low();
1542 }
1543
1544 static void __init rk30_reserve(void)
1545 {
1546 #ifdef CONFIG_ION
1547         rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion", ION_RESERVE_SIZE);
1548 #endif
1549 #ifdef CONFIG_FB_ROCKCHIP
1550         resource_fb[0].start = board_mem_reserve_add("fb0", RK30_FB0_MEM_SIZE);
1551         resource_fb[0].end = resource_fb[0].start + RK30_FB0_MEM_SIZE - 1;
1552         #if 0
1553         resource_fb[1].start = board_mem_reserve_add("ipp buf", RK30_FB0_MEM_SIZE);
1554         resource_fb[1].end = resource_fb[1].start + RK30_FB0_MEM_SIZE - 1;
1555         resource_fb[2].start = board_mem_reserve_add("fb2", RK30_FB0_MEM_SIZE);
1556         resource_fb[2].end = resource_fb[2].start + RK30_FB0_MEM_SIZE - 1;
1557         #endif
1558 #endif
1559 #ifdef CONFIG_VIDEO_RK29
1560         rk30_camera_request_reserve_mem();
1561 #endif
1562         board_mem_reserved();
1563 }
1564
1565 /**
1566  * dvfs_cpu_logic_table: table for arm and logic dvfs 
1567  * @frequency   : arm frequency
1568  * @cpu_volt    : arm voltage depend on frequency
1569  * @logic_volt  : logic voltage arm requests depend on frequency
1570  * comments     : min arm/logic voltage
1571  */
1572 static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
1573         {.frequency = 252 * 1000,       .cpu_volt = 1050 * 1000,        .logic_volt = 1050 * 1000},//0.975V/1.000V
1574         {.frequency = 504 * 1000,       .cpu_volt = 1050 * 1000,        .logic_volt = 1100 * 1000},//0.975V/1.000V
1575         {.frequency = 816 * 1000,       .cpu_volt = 1100 * 1000,        .logic_volt = 1150 * 1000},//1.000V/1.025V
1576         {.frequency = 1008 * 1000,      .cpu_volt = 1100 * 1000,        .logic_volt = 1150 * 1000},//1.025V/1.050V
1577         {.frequency = 1200 * 1000,      .cpu_volt = 1175 * 1000,        .logic_volt = 1200 * 1000},//1.100V/1.050V
1578         {.frequency = 1272 * 1000,      .cpu_volt = 1225 * 1000,        .logic_volt = 1200 * 1000},//1.150V/1.100V
1579         {.frequency = 1416 * 1000,      .cpu_volt = 1300 * 1000,        .logic_volt = 1200 * 1000},//1.225V/1.100V
1580         {.frequency = 1512 * 1000,      .cpu_volt = 1350 * 1000,        .logic_volt = 1250 * 1000},//1.300V/1.150V
1581         {.frequency = 1608 * 1000,      .cpu_volt = 1375 * 1000,        .logic_volt = 1275 * 1000},//1.325V/1.175V
1582         {.frequency = CPUFREQ_TABLE_END},
1583 };
1584 static struct cpufreq_frequency_table dvfs_gpu_table[] = {
1585         {.frequency = 266 * 1000,       .index = 1050 * 1000},
1586         {.frequency = 400 * 1000,       .index = 1275 * 1000},
1587         {.frequency = CPUFREQ_TABLE_END},
1588 };
1589
1590 static struct cpufreq_frequency_table dvfs_ddr_table[] = {
1591         {.frequency = 300 * 1000,       .index = 1050 * 1000},
1592         {.frequency = 400 * 1000,       .index = 1125 * 1000},
1593         {.frequency = CPUFREQ_TABLE_END},
1594 };
1595
1596 #define DVFS_CPU_TABLE_SIZE     (ARRAY_SIZE(dvfs_cpu_logic_table))
1597 static struct cpufreq_frequency_table cpu_dvfs_table[DVFS_CPU_TABLE_SIZE];
1598 static struct cpufreq_frequency_table dep_cpu2core_table[DVFS_CPU_TABLE_SIZE];
1599
1600 void __init board_clock_init(void)
1601 {
1602         rk30_clock_data_init(periph_pll_default, codec_pll_default, RK30_CLOCKS_DEFAULT_FLAGS);
1603         dvfs_set_arm_logic_volt(dvfs_cpu_logic_table, cpu_dvfs_table, dep_cpu2core_table);
1604         dvfs_set_freq_volt_table(clk_get(NULL, "gpu"), dvfs_gpu_table);
1605         dvfs_set_freq_volt_table(clk_get(NULL, "ddr"), dvfs_ddr_table);
1606 }
1607
1608 MACHINE_START(RK30, "RK30board")
1609         .boot_params    = PLAT_PHYS_OFFSET + 0x800,
1610         .fixup          = rk30_fixup,
1611         .reserve        = &rk30_reserve,
1612         .map_io         = rk30_map_io,
1613         .init_irq       = rk30_init_irq,
1614         .timer          = &rk30_timer,
1615         .init_machine   = machine_rk30_board_init,
1616 MACHINE_END