From 32a1b715f9a2212d3239ad2410b624feea742269 Mon Sep 17 00:00:00 2001 From: ddl Date: Sat, 24 Mar 2012 17:54:53 +0800 Subject: [PATCH] camera: sensor platform device register in rk29_camera.c --- arch/arm/mach-rk29/board-rk29-ddr3sdk.c | 22 ---------------- arch/arm/mach-rk29/board-rk29-k97.c | 22 +--------------- drivers/media/video/rk29_camera.c | 34 ++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 44 deletions(-) diff --git a/arch/arm/mach-rk29/board-rk29-ddr3sdk.c b/arch/arm/mach-rk29/board-rk29-ddr3sdk.c index e2aa684824d9..6f8d695a0314 100755 --- a/arch/arm/mach-rk29/board-rk29-ddr3sdk.c +++ b/arch/arm/mach-rk29/board-rk29-ddr3sdk.c @@ -2818,31 +2818,9 @@ static struct platform_device *devices[] __initdata = { #if (CONFIG_SENSOR_IIC_ADDR_1 != 0x00) &rk29_soc_camera_pdrv_1, #endif - #ifdef CONFIG_SENSOR_01 - #if (CONFIG_SENSOR_IIC_ADDR_01 != 0x00) - &rk29_soc_camera_pdrv_01, - #endif - #endif - #ifdef CONFIG_SENSOR_02 - #if (CONFIG_SENSOR_IIC_ADDR_02 != 0x00) - &rk29_soc_camera_pdrv_02, - #endif - #endif - #ifdef CONFIG_SENSOR_11 - #if (CONFIG_SENSOR_IIC_ADDR_11 != 0x00) - &rk29_soc_camera_pdrv_11, - #endif - #endif - #ifdef CONFIG_SENSOR_12 - #if (CONFIG_SENSOR_IIC_ADDR_12 != 0x00) - &rk29_soc_camera_pdrv_12, - #endif - #endif - #if (PMEM_CAM_SIZE > 0) &android_pmem_cam_device, #endif - #endif #if PMEM_SKYPE_SIZE > 0 &android_pmem_skype_device, diff --git a/arch/arm/mach-rk29/board-rk29-k97.c b/arch/arm/mach-rk29/board-rk29-k97.c index 619d810b8fcb..ab32e956dc62 100755 --- a/arch/arm/mach-rk29/board-rk29-k97.c +++ b/arch/arm/mach-rk29/board-rk29-k97.c @@ -2785,27 +2785,7 @@ static struct platform_device *devices[] __initdata = { #endif #if (CONFIG_SENSOR_IIC_ADDR_1 != 0x00) &rk29_soc_camera_pdrv_1, - #endif - #ifdef CONFIG_SENSOR_01 - #if (CONFIG_SENSOR_IIC_ADDR_01 != 0x00) - &rk29_soc_camera_pdrv_01, - #endif - #endif - #ifdef CONFIG_SENSOR_02 - #if (CONFIG_SENSOR_IIC_ADDR_02 != 0x00) - &rk29_soc_camera_pdrv_02, - #endif - #endif - #ifdef CONFIG_SENSOR_11 - #if (CONFIG_SENSOR_IIC_ADDR_11 != 0x00) - &rk29_soc_camera_pdrv_11, - #endif - #endif - #ifdef CONFIG_SENSOR_12 - #if (CONFIG_SENSOR_IIC_ADDR_12 != 0x00) - &rk29_soc_camera_pdrv_12, - #endif - #endif + #endif #if (PMEM_CAM_SIZE > 0) &android_pmem_cam_device, diff --git a/drivers/media/video/rk29_camera.c b/drivers/media/video/rk29_camera.c index 91ff7836ebc8..9fbd3037d164 100755 --- a/drivers/media/video/rk29_camera.c +++ b/drivers/media/video/rk29_camera.c @@ -57,7 +57,7 @@ #define PMEM_CAMIPP_NECESSARY 0x800000 #endif -#if CONFIG_VIDEO_RK29_CAMMEM_ION +#ifdef CONFIG_VIDEO_RK29_CAMMEM_ION #undef PMEM_CAM_NECESSARY #define PMEM_CAM_NECESSARY 0x00000000 #endif @@ -2093,6 +2093,38 @@ static struct platform_device android_pmem_cam_device = { }, }; #endif + +static int rk_register_camera_devices(void) +{ +#ifdef CONFIG_SENSOR_IIC_ADDR_01 +#if CONFIG_SENSOR_IIC_ADDR_01 + platform_device_register(&rk29_soc_camera_pdrv_01); +#endif +#endif + +#ifdef CONFIG_SENSOR_IIC_ADDR_02 +#if CONFIG_SENSOR_IIC_ADDR_02 + platform_device_register(&rk29_soc_camera_pdrv_02); +#endif +#endif + +#ifdef CONFIG_SENSOR_IIC_ADDR_11 +#if CONFIG_SENSOR_IIC_ADDR_11 + platform_device_register(&rk29_soc_camera_pdrv_11); +#endif +#endif + +#ifdef CONFIG_SENSOR_IIC_ADDR_12 +#if CONFIG_SENSOR_IIC_ADDR_12 + platform_device_register(&rk29_soc_camera_pdrv_12); +#endif +#endif + return 0; +} + +module_init(rk_register_camera_devices); + + #endif #endif //#ifdef CONFIG_VIDEO_RK29 -- 2.34.1