From fd9724d680a3e1b9e16f5482d46f436cf11597e3 Mon Sep 17 00:00:00 2001 From: ddl Date: Thu, 2 Jun 2011 10:02:57 +0800 Subject: [PATCH] camera: fix camera pmem also allocate when camera driver have not compile --- arch/arm/mach-rk29/board-rk29-ddr3sdk.c | 5 +++-- arch/arm/mach-rk29/board-rk29-phonesdk.c | 5 ++++- arch/arm/mach-rk29/board-rk29phonepadsdk.c | 6 ++++-- arch/arm/mach-rk29/board-rk29sdk.c | 6 ++++-- drivers/media/video/rk29_camera.c | 9 +++++---- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-rk29/board-rk29-ddr3sdk.c b/arch/arm/mach-rk29/board-rk29-ddr3sdk.c index 9fa485a32884..84fbbec17a03 100755 --- a/arch/arm/mach-rk29/board-rk29-ddr3sdk.c +++ b/arch/arm/mach-rk29/board-rk29-ddr3sdk.c @@ -80,10 +80,10 @@ #define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L +#endif //#ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Configuration Macro End------------------------*/ #include "../../../drivers/media/video/rk29_camera.c" /*---------------- Camera Sensor Macro Define End ------------------------*/ -#endif //#ifdef CONFIG_VIDEO_RK29 /* Set memory size of pmem */ #ifdef CONFIG_RK29_MEM_SIZE_M @@ -722,6 +722,7 @@ static struct i2c_board_info __initdata board_i2c3_devices[] = { * camera devices * author: ddl@rock-chips.com *****************************************************************************************/ +#ifdef CONFIG_VIDEO_RK29 #define CONFIG_SENSOR_POWER_IOCTL_USR 0 #define CONFIG_SENSOR_RESET_IOCTL_USR 0 #define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0 @@ -782,7 +783,7 @@ static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = { }; #include "../../../drivers/media/video/rk29_camera.c" - +#endif /***************************************************************************************** * backlight devices * author: nzy@rock-chips.com diff --git a/arch/arm/mach-rk29/board-rk29-phonesdk.c b/arch/arm/mach-rk29/board-rk29-phonesdk.c index 105291e971f1..ac4faccb9511 100755 --- a/arch/arm/mach-rk29/board-rk29-phonesdk.c +++ b/arch/arm/mach-rk29/board-rk29-phonesdk.c @@ -103,10 +103,11 @@ #define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L +#endif //#ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Configuration Macro End------------------------*/ #include "../../../drivers/media/video/rk29_camera.c" /*---------------- Camera Sensor Macro Define End ------------------------*/ -#endif //#ifdef CONFIG_VIDEO_RK29 + /* Set memory size of pmem */ #ifdef CONFIG_RK29_MEM_SIZE_M @@ -1780,6 +1781,7 @@ static struct i2c_board_info __initdata board_i2c3_devices[] = { * camera devices * author: ddl@rock-chips.com *****************************************************************************************/ +#ifdef CONFIG_VIDEO_RK29 #define CONFIG_SENSOR_POWER_IOCTL_USR 0 #define CONFIG_SENSOR_RESET_IOCTL_USR 0 #define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0 @@ -1839,6 +1841,7 @@ static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = { #endif }; #include "../../../drivers/media/video/rk29_camera.c" +#endif /***************************************************************************************** * backlight devices diff --git a/arch/arm/mach-rk29/board-rk29phonepadsdk.c b/arch/arm/mach-rk29/board-rk29phonepadsdk.c index 390110d0dbf0..97345b2f3ad1 100644 --- a/arch/arm/mach-rk29/board-rk29phonepadsdk.c +++ b/arch/arm/mach-rk29/board-rk29phonepadsdk.c @@ -83,10 +83,11 @@ #define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L +#endif //#ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Configuration Macro End------------------------*/ #include "../../../drivers/media/video/rk29_camera.c" /*---------------- Camera Sensor Macro Define End ------------------------*/ -#endif //#ifdef CONFIG_VIDEO_RK29 + /* Set memory size of pmem */ #ifdef CONFIG_RK29_MEM_SIZE_M @@ -710,6 +711,7 @@ static struct i2c_board_info __initdata board_i2c3_devices[] = { * camera devices * author: ddl@rock-chips.com *****************************************************************************************/ +#ifdef CONFIG_VIDEO_RK29 #define CONFIG_SENSOR_POWER_IOCTL_USR 0 #define CONFIG_SENSOR_RESET_IOCTL_USR 0 #define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0 @@ -769,7 +771,7 @@ static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = { #endif }; #include "../../../drivers/media/video/rk29_camera.c" - +#endif /***************************************************************************************** * backlight devices * author: nzy@rock-chips.com diff --git a/arch/arm/mach-rk29/board-rk29sdk.c b/arch/arm/mach-rk29/board-rk29sdk.c index 66757bbd4d61..37d7e6222bdc 100755 --- a/arch/arm/mach-rk29/board-rk29sdk.c +++ b/arch/arm/mach-rk29/board-rk29sdk.c @@ -80,10 +80,11 @@ #define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L #define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H #define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L +#endif //#ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Configuration Macro End------------------------*/ #include "../../../drivers/media/video/rk29_camera.c" /*---------------- Camera Sensor Macro Define End ------------------------*/ -#endif //#ifdef CONFIG_VIDEO_RK29 + /* Set memory size of pmem */ #ifdef CONFIG_RK29_MEM_SIZE_M @@ -727,6 +728,7 @@ static struct i2c_board_info __initdata board_i2c3_devices[] = { * camera devices * author: ddl@rock-chips.com *****************************************************************************************/ +#ifdef CONFIG_VIDEO_RK29 #define CONFIG_SENSOR_POWER_IOCTL_USR 0 #define CONFIG_SENSOR_RESET_IOCTL_USR 0 #define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0 @@ -786,7 +788,7 @@ static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = { #endif }; #include "../../../drivers/media/video/rk29_camera.c" - +#endif /***************************************************************************************** * backlight devices * author: nzy@rock-chips.com diff --git a/drivers/media/video/rk29_camera.c b/drivers/media/video/rk29_camera.c index 7a17f7fa513c..d55043daba2f 100755 --- a/drivers/media/video/rk29_camera.c +++ b/drivers/media/video/rk29_camera.c @@ -1,9 +1,7 @@ #include -#ifdef CONFIG_VIDEO_RK29 - #ifndef PMEM_CAM_SIZE - +#ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Fixed Macro Begin ------------------------*/ // Below Macro is fixed, programer don't change it!!!!!! #define _CONS(a,b) a##b @@ -49,13 +47,16 @@ #define PMEM_CAM_NECESSARY 0x800000 /* 800*600*1.5*4(preview) + 2M(capture raw) + 2M(jpeg encode output) */ #endif /*---------------- Camera Sensor Fixed Macro End ------------------------*/ - +#else //#ifdef CONFIG_VIDEO_RK29 +#define PMEM_CAM_NECESSARY 0x00000000 +#endif #else // #ifdef PMEM_CAM_SIZE /***************************************************************************************** * camera devices * author: ddl@rock-chips.com *****************************************************************************************/ +#ifdef CONFIG_VIDEO_RK29 static int camera_debug; module_param(camera_debug, int, S_IRUGO|S_IWUSR); -- 2.34.1