1 /* arch/arm/mach-rk30/board-rk30-sdk.c
3 * Copyright (C) 2012 ROCKCHIP, Inc.
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.
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.
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/input.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>
28 #include <asm/setup.h>
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
32 #include <asm/mach/flash.h>
33 #include <asm/hardware/gic.h>
35 #include <mach/board.h>
36 #include <mach/hardware.h>
38 #include <mach/gpio.h>
39 #include <mach/iomux.h>
40 /*set touchscreen different type header*/
41 #if defined(CONFIG_TOUCHSCREEN_XPT2046_NORMAL_SPI)
42 #include "../../../drivers/input/touchscreen/xpt2046_ts.h"
43 #elif defined(CONFIG_TOUCHSCREEN_XPT2046_TSLIB_SPI)
44 #include "../../../drivers/input/touchscreen/xpt2046_tslib_ts.h"
45 #elif defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI)
46 #include "../../../drivers/input/touchscreen/xpt2046_cbn_ts.h"
48 #if defined(CONFIG_SPIM_RK29)
49 #include "../../../drivers/spi/rk29_spim.h"
51 #if defined(CONFIG_ANDROID_TIMED_GPIO)
52 #include "../../../drivers/staging/android/timed_gpio.h"
55 #define RK30_FB0_MEM_SIZE 8*SZ_1M
57 #ifdef CONFIG_VIDEO_RK29
58 /*---------------- Camera Sensor Macro Define Begin ------------------------*/
59 /*---------------- Camera Sensor Configuration Macro Begin ------------------------*/
60 #define CONFIG_SENSOR_0 RK29_CAM_SENSOR_OV2659//RK_CAM_SENSOR_OV5642 /* back camera sensor */
61 #define CONFIG_SENSOR_IIC_ADDR_0 0x60//0x78
62 #define CONFIG_SENSOR_IIC_ADAPTER_ID_0 1
63 #define CONFIG_SENSOR_CIF_INDEX_0 0
64 #define CONFIG_SENSOR_ORIENTATION_0 90
65 #define CONFIG_SENSOR_POWER_PIN_0 INVALID_GPIO
66 #define CONFIG_SENSOR_RESET_PIN_0 INVALID_GPIO
67 #define CONFIG_SENSOR_POWERDN_PIN_0 INVALID_GPIO
68 #define CONFIG_SENSOR_FALSH_PIN_0 INVALID_GPIO
69 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_L
70 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_0 RK29_CAM_RESETACTIVE_L
71 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_0 RK29_CAM_POWERDNACTIVE_H
72 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_0 RK29_CAM_FLASHACTIVE_L
74 #define CONFIG_SENSOR_QCIF_FPS_FIXED_0 15000
75 #define CONFIG_SENSOR_QVGA_FPS_FIXED_0 15000
76 #define CONFIG_SENSOR_CIF_FPS_FIXED_0 15000
77 #define CONFIG_SENSOR_VGA_FPS_FIXED_0 15000
78 #define CONFIG_SENSOR_480P_FPS_FIXED_0 15000
79 #define CONFIG_SENSOR_SVGA_FPS_FIXED_0 15000
80 #define CONFIG_SENSOR_720P_FPS_FIXED_0 30000
82 #define CONFIG_SENSOR_1 RK29_CAM_SENSOR_OV2659 /* front camera sensor */
83 #define CONFIG_SENSOR_IIC_ADDR_1 0x60
84 #define CONFIG_SENSOR_IIC_ADAPTER_ID_1 1
85 #define CONFIG_SENSOR_CIF_INDEX_1 1
86 #define CONFIG_SENSOR_ORIENTATION_1 270
87 #define CONFIG_SENSOR_POWER_PIN_1 INVALID_GPIO
88 #define CONFIG_SENSOR_RESET_PIN_1 INVALID_GPIO
89 #define CONFIG_SENSOR_POWERDN_PIN_1 INVALID_GPIO
90 #define CONFIG_SENSOR_FALSH_PIN_1 INVALID_GPIO
91 #define CONFIG_SENSOR_POWERACTIVE_LEVEL_1 RK29_CAM_POWERACTIVE_L
92 #define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L
93 #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H
94 #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L
96 #define CONFIG_SENSOR_QCIF_FPS_FIXED_1 15000
97 #define CONFIG_SENSOR_QVGA_FPS_FIXED_1 15000
98 #define CONFIG_SENSOR_CIF_FPS_FIXED_1 15000
99 #define CONFIG_SENSOR_VGA_FPS_FIXED_1 15000
100 #define CONFIG_SENSOR_480P_FPS_FIXED_1 15000
101 #define CONFIG_SENSOR_SVGA_FPS_FIXED_1 15000
102 #define CONFIG_SENSOR_720P_FPS_FIXED_1 30000
104 #define CONFIG_USE_CIF_0 1
105 #define CONFIG_USE_CIF_1 0
106 #endif //#ifdef CONFIG_VIDEO_RK29
107 /*---------------- Camera Sensor Configuration Macro End------------------------*/
108 #include "../../../drivers/media/video/rk30_camera.c"
109 /*---------------- Camera Sensor Macro Define End ---------*/
111 #define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
112 #ifdef CONFIG_VIDEO_RK29_WORK_IPP
113 #define MEM_CAMIPP_SIZE PMEM_CAMIPP_NECESSARY
115 #define MEM_CAMIPP_SIZE 0
117 /*****************************************************************************************
119 * author: ddl@rock-chips.com
120 *****************************************************************************************/
121 #ifdef CONFIG_VIDEO_RK29
122 #define CONFIG_SENSOR_POWER_IOCTL_USR 0
123 #define CONFIG_SENSOR_RESET_IOCTL_USR 0
124 #define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0
125 #define CONFIG_SENSOR_FLASH_IOCTL_USR 0
127 #if CONFIG_SENSOR_POWER_IOCTL_USR
128 static int sensor_power_usr_cb (struct rk29camera_gpio_res *res,int on)
130 #error "CONFIG_SENSOR_POWER_IOCTL_USR is 1, sensor_power_usr_cb function must be writed!!";
134 #if CONFIG_SENSOR_RESET_IOCTL_USR
135 static int sensor_reset_usr_cb (struct rk29camera_gpio_res *res,int on)
137 #error "CONFIG_SENSOR_RESET_IOCTL_USR is 1, sensor_reset_usr_cb function must be writed!!";
141 #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
142 static int sensor_powerdown_usr_cb (struct rk29camera_gpio_res *res,int on)
144 #error "CONFIG_SENSOR_POWERDOWN_IOCTL_USR is 1, sensor_powerdown_usr_cb function must be writed!!";
148 #if CONFIG_SENSOR_FLASH_IOCTL_USR
149 static int sensor_flash_usr_cb (struct rk29camera_gpio_res *res,int on)
151 #error "CONFIG_SENSOR_FLASH_IOCTL_USR is 1, sensor_flash_usr_cb function must be writed!!";
155 static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = {
156 #if CONFIG_SENSOR_POWER_IOCTL_USR
157 .sensor_power_cb = sensor_power_usr_cb,
159 .sensor_power_cb = NULL,
162 #if CONFIG_SENSOR_RESET_IOCTL_USR
163 .sensor_reset_cb = sensor_reset_usr_cb,
165 .sensor_reset_cb = NULL,
168 #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
169 .sensor_powerdown_cb = sensor_powerdown_usr_cb,
171 .sensor_powerdown_cb = NULL,
174 #if CONFIG_SENSOR_FLASH_IOCTL_USR
175 .sensor_flash_cb = sensor_flash_usr_cb,
177 .sensor_flash_cb = NULL,
180 static struct reginfo_t rk_init_data_sensor_reg_0[] =
184 static struct reginfo_t rk_init_data_sensor_winseqreg_0[] ={
187 static rk_sensor_user_init_data_s rk_init_data_sensor_0 =
189 .rk_sensor_init_width = INVALID_VALUE,
190 .rk_sensor_init_height = INVALID_VALUE,
191 .rk_sensor_init_bus_param = INVALID_VALUE,
192 .rk_sensor_init_pixelcode = INVALID_VALUE,
193 .rk_sensor_init_data = rk_init_data_sensor_reg_0,
194 .rk_sensor_init_winseq = NULL,//rk_init_data_sensor_winseqreg_0,
195 .rk_sensor_winseq_size = sizeof(rk_init_data_sensor_winseqreg_0) / sizeof(struct reginfo_t),
198 static rk_sensor_user_init_data_s* rk_init_data_sensor_0_p = &rk_init_data_sensor_0;
199 static rk_sensor_user_init_data_s* rk_init_data_sensor_1_p = NULL;
200 #include "../../../drivers/media/video/rk30_camera.c"
204 #if defined(CONFIG_TOUCHSCREEN_GT8XX)
205 #define TOUCH_RESET_PIN RK30_PIN4_PD0
206 #define TOUCH_PWR_PIN INVALID_GPIO
207 int goodix_init_platform_hw(void)
210 printk("goodix_init_platform_hw\n");
211 if(TOUCH_PWR_PIN != INVALID_GPIO)
213 ret = gpio_request(TOUCH_PWR_PIN, "goodix power pin");
215 gpio_free(TOUCH_PWR_PIN);
216 printk("goodix power error\n");
219 gpio_direction_output(TOUCH_PWR_PIN, 0);
220 gpio_set_value(TOUCH_PWR_PIN,GPIO_LOW);
224 if(TOUCH_RESET_PIN != INVALID_GPIO)
226 ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
228 gpio_free(TOUCH_RESET_PIN);
229 printk("goodix gpio_request error\n");
232 gpio_direction_output(TOUCH_RESET_PIN, 0);
233 gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
235 gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
241 struct goodix_platform_data goodix_info = {
243 .irq_pin = RK30_PIN4_PC2,
244 .rest_pin = TOUCH_RESET_PIN,
245 .init_platform_hw = goodix_init_platform_hw,
250 /*****************************************************************************************
251 * xpt2046 touch panel
252 * author: hhb@rock-chips.com
253 *****************************************************************************************/
254 #if defined(CONFIG_TOUCHSCREEN_XPT2046_NORMAL_SPI) || defined(CONFIG_TOUCHSCREEN_XPT2046_TSLIB_SPI)
255 #define XPT2046_GPIO_INT RK30_PIN4_PC2
256 #define DEBOUNCE_REPTIME 3
259 static struct xpt2046_platform_data xpt2046_info = {
264 .debounce_rep = DEBOUNCE_REPTIME,
266 .gpio_pendown = XPT2046_GPIO_INT,
267 .pendown_iomux_name = GPIO4C2_SMCDATA2_TRACEDATA2_NAME,
268 .pendown_iomux_mode = GPIO4C_GPIO4C2,
269 .touch_virtualkey_length = 60,
270 .penirq_recheck_delay_usecs = 1,
271 #if defined(CONFIG_TOUCHSCREEN_480X800)
276 .touch_ad_top = 3940,
277 .touch_ad_bottom = 310,
278 .touch_ad_left = 3772,
279 .touch_ad_right = 340,
280 #elif defined(CONFIG_TOUCHSCREEN_800X480)
285 .touch_ad_top = 2447,
286 .touch_ad_bottom = 207,
287 .touch_ad_left = 5938,
288 .touch_ad_right = 153,
289 #elif defined(CONFIG_TOUCHSCREEN_320X480)
294 .touch_ad_top = 3166,
295 .touch_ad_bottom = 256,
296 .touch_ad_left = 3658,
297 .touch_ad_right = 380,
300 #elif defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI)
301 static struct xpt2046_platform_data xpt2046_info = {
306 .debounce_rep = DEBOUNCE_REPTIME,
308 .gpio_pendown = XPT2046_GPIO_INT,
309 .pendown_iomux_name = GPIO4C2_SMCDATA2_TRACEDATA2_NAME,
310 .pendown_iomux_mode = GPIO4C_GPIO4C2,
311 .touch_virtualkey_length = 60,
312 .penirq_recheck_delay_usecs = 1,
314 #if defined(CONFIG_TOUCHSCREEN_480X800)
319 .screen_x = { 70, 410, 70, 410, 240},
320 .screen_y = { 50, 50, 740, 740, 400},
321 .uncali_x_default = { 3267, 831, 3139, 715, 1845 },
322 .uncali_y_default = { 3638, 3664, 564, 591, 2087 },
323 #elif defined(CONFIG_TOUCHSCREEN_800X480)
328 .screen_x[5] = { 50, 750, 50, 750, 400};
329 .screen_y[5] = { 40, 40, 440, 440, 240};
330 .uncali_x_default[5] = { 438, 565, 3507, 3631, 2105 };
331 .uncali_y_default[5] = { 3756, 489, 3792, 534, 2159 };
332 #elif defined(CONFIG_TOUCHSCREEN_320X480)
337 .screen_x[5] = { 50, 270, 50, 270, 160};
338 .screen_y[5] = { 40, 40, 440, 440, 240};
339 .uncali_x_default[5] = { 812, 3341, 851, 3371, 2183 };
340 .uncali_y_default[5] = { 442, 435, 3193, 3195, 2004 };
344 #if defined(CONFIG_TOUCHSCREEN_XPT2046_SPI)
345 static struct rk29xx_spi_chip xpt2046_chip = {
350 static struct spi_board_info board_spi_devices[] = {
351 #if defined(CONFIG_TOUCHSCREEN_XPT2046_SPI)
353 .modalias = "xpt2046_ts",
354 .chip_select = 1,// 2,
355 .max_speed_hz = 1 * 1000 * 800,/* (max sample rate @ 3V) * (cmd + data + overhead) */
357 .irq = XPT2046_GPIO_INT,
358 .platform_data = &xpt2046_info,
359 .controller_data = &xpt2046_chip,
366 /***********************************************************
368 ************************************************************/
369 #ifdef CONFIG_BACKLIGHT_RK29_BL
371 #define PWM_MUX_NAME GPIO0A3_PWM0_NAME
372 #define PWM_MUX_MODE GPIO0A_PWM0
373 #define PWM_MUX_MODE_GPIO GPIO0A_GPIO0A3
374 #define PWM_GPIO RK30_PIN0_PA3
375 #define PWM_EFFECT_VALUE 1
377 #define LCD_DISP_ON_PIN
379 #ifdef LCD_DISP_ON_PIN
380 //#define BL_EN_MUX_NAME GPIOF34_UART3_SEL_NAME
381 //#define BL_EN_MUX_MODE IOMUXB_GPIO1_B34
383 #define BL_EN_PIN RK30_PIN6_PB3
384 #define BL_EN_VALUE GPIO_HIGH
386 static int rk29_backlight_io_init(void)
389 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
390 #ifdef LCD_DISP_ON_PIN
391 // rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
393 ret = gpio_request(BL_EN_PIN, NULL);
396 gpio_free(BL_EN_PIN);
399 gpio_direction_output(BL_EN_PIN, 0);
400 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
405 static int rk29_backlight_io_deinit(void)
408 #ifdef LCD_DISP_ON_PIN
409 gpio_free(BL_EN_PIN);
411 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
415 static int rk29_backlight_pwm_suspend(void)
418 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
419 if (gpio_request(PWM_GPIO, NULL)) {
420 printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
423 gpio_direction_output(PWM_GPIO, GPIO_LOW);
424 #ifdef LCD_DISP_ON_PIN
425 gpio_direction_output(BL_EN_PIN, 0);
426 gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
431 static int rk29_backlight_pwm_resume(void)
434 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
435 #ifdef LCD_DISP_ON_PIN
437 gpio_direction_output(BL_EN_PIN, 1);
438 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
443 static struct rk29_bl_info rk29_bl_info = {
445 .bl_ref = PWM_EFFECT_VALUE,
446 .io_init = rk29_backlight_io_init,
447 .io_deinit = rk29_backlight_io_deinit,
448 .pwm_suspend = rk29_backlight_pwm_suspend,
449 .pwm_resume = rk29_backlight_pwm_resume,
453 static struct platform_device rk29_device_backlight = {
454 .name = "rk29_backlight",
457 .platform_data = &rk29_bl_info,
464 #if defined (CONFIG_GS_MMA8452)
465 #define MMA8452_INT_PIN RK30_PIN4_PC0
467 static int mma8452_init_platform_hw(void)
469 rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
471 if(gpio_request(MMA8452_INT_PIN,NULL) != 0){
472 gpio_free(MMA8452_INT_PIN);
473 printk("mma8452_init_platform_hw gpio_request error\n");
476 gpio_pull_updown(MMA8452_INT_PIN, 1);
481 static struct mma8452_platform_data mma8452_info = {
485 .init_platform_hw= mma8452_init_platform_hw,
486 .orientation = { -1, 0, 0, 0, 0, 1, 0, -1, 0},
489 #if defined (CONFIG_COMPASS_AK8975)
490 static struct akm8975_platform_data akm8975_info =
523 #if defined(CONFIG_GYRO_L3G4200D)
525 #include <linux/l3g4200d.h>
526 #define L3G4200D_INT_PIN RK30_PIN4_PC3
528 static int l3g4200d_init_platform_hw(void)
530 if (gpio_request(L3G4200D_INT_PIN, NULL) != 0) {
531 gpio_free(L3G4200D_INT_PIN);
532 printk("%s: request l3g4200d int pin error\n", __func__);
535 gpio_pull_updown(L3G4200D_INT_PIN, 1);
539 static struct l3g4200d_platform_data l3g4200d_info = {
550 .init = l3g4200d_init_platform_hw,
555 #ifdef CONFIG_LS_CM3217
557 #define CM3217_POWER_PIN INVALID_GPIO
558 #define CM3217_IRQ_PIN INVALID_GPIO
559 static int cm3217_init_hw(void)
562 if (gpio_request(CM3217_POWER_PIN, NULL) != 0) {
563 gpio_free(CM3217_POWER_PIN);
564 printk("%s: request cm3217 power pin error\n", __func__);
567 gpio_pull_updown(CM3217_POWER_PIN, PullDisable);
569 if (gpio_request(CM3217_IRQ_PIN, NULL) != 0) {
570 gpio_free(CM3217_IRQ_PIN);
571 printk("%s: request cm3217 int pin error\n", __func__);
574 gpio_pull_updown(CM3217_IRQ_PIN, PullDisable);
579 static void cm3217_exit_hw(void)
582 gpio_free(CM3217_POWER_PIN);
583 gpio_free(CM3217_IRQ_PIN);
588 struct cm3217_platform_data cm3217_info = {
589 .irq_pin = CM3217_IRQ_PIN,
590 .power_pin = CM3217_POWER_PIN,
591 .init_platform_hw = cm3217_init_hw,
592 .exit_platform_hw = cm3217_exit_hw,
598 #ifdef CONFIG_FB_ROCKCHIP
599 static struct resource resource_fb[] = {
603 .end = 0,//RK30_FB0_MEM_SIZE - 1,
604 .flags = IORESOURCE_MEM,
607 .name = "ipp buf", //for rotate
609 .end = 0,//RK30_FB0_MEM_SIZE - 1,
610 .flags = IORESOURCE_MEM,
615 .end = 0,//RK30_FB0_MEM_SIZE - 1,
616 .flags = IORESOURCE_MEM,
620 static struct platform_device device_fb = {
623 .num_resources = ARRAY_SIZE(resource_fb),
624 .resource = resource_fb,
628 #ifdef CONFIG_ANDROID_TIMED_GPIO
629 static struct timed_gpio timed_gpios[] = {
632 .gpio = RK30_PIN0_PA4,
635 .adjust_time =20, //adjust for diff product
639 struct timed_gpio_platform_data rk29_vibrator_info = {
641 .gpios = timed_gpios,
644 struct platform_device rk29_device_vibrator ={
645 .name = "timed-gpio",
648 .platform_data = &rk29_vibrator_info,
654 #ifdef CONFIG_LEDS_GPIO_PLATFORM
655 struct gpio_led rk29_leds[] = {
657 .name = "button-backlight",
658 .gpio = RK30_PIN4_PD7,
659 .default_trigger = "timer",
661 .retain_state_suspended = 0,
662 .default_state = LEDS_GPIO_DEFSTATE_OFF,
666 struct gpio_led_platform_data rk29_leds_pdata = {
668 .num_leds = ARRAY_SIZE(rk29_leds),
671 struct platform_device rk29_device_gpio_leds = {
675 .platform_data = &rk29_leds_pdata,
680 #ifdef CONFIG_RK_IRDA
681 #define IRDA_IRQ_PIN RK30_PIN6_PA1
683 int irda_iomux_init(void)
688 ret = gpio_request(IRDA_IRQ_PIN, NULL);
691 gpio_free(IRDA_IRQ_PIN);
692 printk(">>>>>> IRDA_IRQ_PIN gpio_request err \n ");
694 gpio_pull_updown(IRDA_IRQ_PIN, PullDisable);
695 gpio_direction_input(IRDA_IRQ_PIN);
700 int irda_iomux_deinit(void)
702 gpio_free(IRDA_IRQ_PIN);
706 static struct irda_info rk29_irda_info = {
707 .intr_pin = IRDA_IRQ_PIN,
708 .iomux_init = irda_iomux_init,
709 .iomux_deinit = irda_iomux_deinit,
710 //.irda_pwr_ctl = bu92747guw_power_ctl,
713 static struct platform_device irda_device = {
714 #ifdef CONFIG_RK_IRDA_NET
717 .name = "bu92747_irda",
721 .platform_data = &rk29_irda_info,
727 #define ION_RESERVE_SIZE (80 * SZ_1M)
728 static struct ion_platform_data rk30_ion_pdata = {
732 .type = ION_HEAP_TYPE_CARVEOUT,
733 .id = ION_NOR_HEAP_ID,
735 .size = ION_RESERVE_SIZE,
740 static struct platform_device device_ion = {
741 .name = "ion-rockchip",
744 .platform_data = &rk30_ion_pdata,
749 static struct platform_device *devices[] __initdata = {
750 #ifdef CONFIG_BACKLIGHT_RK29_BL
751 &rk29_device_backlight,
753 #ifdef CONFIG_FB_ROCKCHIP
759 #ifdef CONFIG_ANDROID_TIMED_GPIO
760 &rk29_device_vibrator,
762 #ifdef CONFIG_LEDS_GPIO_PLATFORM
763 &rk29_device_gpio_leds,
765 #ifdef CONFIG_RK_IRDA
771 #ifdef CONFIG_I2C0_RK30
772 static struct i2c_board_info __initdata i2c0_info[] = {
773 #if defined (CONFIG_GS_MMA8452)
775 .type = "gs_mma8452",
778 .irq = MMA8452_INT_PIN,
779 .platform_data = &mma8452_info,
782 #if defined (CONFIG_COMPASS_AK8975)
787 .irq = RK30_PIN4_PC1,
788 .platform_data = &akm8975_info,
791 #if defined (CONFIG_GYRO_L3G4200D)
793 .type = "l3g4200d_gryo",
796 .irq = L3G4200D_INT_PIN,
797 .platform_data = &l3g4200d_info,
801 #if defined (CONFIG_SND_SOC_RK1000)
803 .type = "rk1000_i2c_codec",
808 .type = "rk1000_control",
816 #ifdef CONFIG_I2C1_RK30
817 static struct i2c_board_info __initdata i2c1_info[] = {
821 #ifdef CONFIG_I2C2_RK30
822 static struct i2c_board_info __initdata i2c2_info[] = {
823 #if defined (CONFIG_TOUCHSCREEN_GT8XX)
829 .platform_data = &goodix_info,
832 #if defined (CONFIG_LS_CM3217)
834 .type = "lightsensor",
837 .irq = CM3217_IRQ_PIN,
838 .platform_data = &cm3217_info,
845 #ifdef CONFIG_I2C3_RK30
846 static struct i2c_board_info __initdata i2c3_info[] = {
850 #ifdef CONFIG_I2C4_RK30
851 static struct i2c_board_info __initdata i2c4_info[] = {
855 static void __init rk30_i2c_register_board_info(void)
857 #ifdef CONFIG_I2C0_RK30
858 i2c_register_board_info(0, i2c0_info, ARRAY_SIZE(i2c0_info));
860 #ifdef CONFIG_I2C1_RK30
861 i2c_register_board_info(1, i2c1_info, ARRAY_SIZE(i2c1_info));
863 #ifdef CONFIG_I2C2_RK30
864 i2c_register_board_info(2, i2c2_info, ARRAY_SIZE(i2c2_info));
866 #ifdef CONFIG_I2C3_RK30
867 i2c_register_board_info(3, i2c3_info, ARRAY_SIZE(i2c3_info));
869 #ifdef CONFIG_I2C4_RK30
870 i2c_register_board_info(4, i2c4_info, ARRAY_SIZE(i2c4_info));
875 static void __init machine_rk30_board_init(void)
877 rk30_i2c_register_board_info();
878 spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
879 platform_add_devices(devices, ARRAY_SIZE(devices));
882 static void __init rk30_reserve(void)
885 rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion",ION_RESERVE_SIZE);
887 #ifdef CONFIG_FB_ROCKCHIP
888 resource_fb[0].start = board_mem_reserve_add("fb0",RK30_FB0_MEM_SIZE);
889 resource_fb[0].end = resource_fb[0].start + RK30_FB0_MEM_SIZE - 1;
890 resource_fb[1].start = board_mem_reserve_add("ipp buf",RK30_FB0_MEM_SIZE);
891 resource_fb[1].end = resource_fb[1].start + RK30_FB0_MEM_SIZE - 1;
892 resource_fb[2].start = board_mem_reserve_add("fb2",RK30_FB0_MEM_SIZE);
893 resource_fb[2].end = resource_fb[2].start + RK30_FB0_MEM_SIZE - 1;
896 #if (MEM_CAMIPP_SIZE != 0)
898 rk_camera_platform_data.meminfo.name = "camera_ipp_mem_0";
899 rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem_0",MEM_CAMIPP_SIZE);
900 rk_camera_platform_data.meminfo.size= MEM_CAMIPP_SIZE;
903 rk_camera_platform_data.meminfo_cif1.name = "camera_ipp_mem_1";
904 rk_camera_platform_data.meminfo_cif1.start =board_mem_reserve_add("camera_ipp_mem_1",MEM_CAMIPP_SIZE);
905 rk_camera_platform_data.meminfo_cif1.size= MEM_CAMIPP_SIZE;
909 #if (PMEM_CAM_SIZE != 0)
910 android_pmem_cam_pdata.start = board_mem_reserve_add("camera_pmem",PMEM_CAM_SIZE);
911 android_pmem_cam_pdata.size = PMEM_CAM_SIZE;
914 board_mem_reserved();
917 MACHINE_START(RK30, "RK30board")
918 .boot_params = PLAT_PHYS_OFFSET + 0x800,
920 .reserve = &rk30_reserve,
921 .map_io = rk30_map_io,
922 .init_irq = rk30_init_irq,
923 .timer = &rk30_timer,
924 .init_machine = machine_rk30_board_init,