From b9f9a47e704386b9a594615dc64bde89148e3254 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 15 Mar 2012 18:10:23 +0800 Subject: [PATCH] camera rk30:two cif controls use different ipp mem size. --- arch/arm/mach-rk29/include/mach/rk29_camera.h | 183 +----------------- arch/arm/mach-rk30/board-rk30-sdk.c | 8 +- drivers/media/video/rk30_camera.c | 2 +- drivers/media/video/rk30_camera_oneframe.c | 10 +- 4 files changed, 14 insertions(+), 189 deletions(-) diff --git a/arch/arm/mach-rk29/include/mach/rk29_camera.h b/arch/arm/mach-rk29/include/mach/rk29_camera.h index 2d78c35cda2b..45fbc3bd11e7 100755 --- a/arch/arm/mach-rk29/include/mach/rk29_camera.h +++ b/arch/arm/mach-rk29/include/mach/rk29_camera.h @@ -19,185 +19,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef __ASM_ARCH_CAMERA_H_ -#define __ASM_ARCH_CAMERA_H_ - -#include - -#define RK29_CAM_DRV_NAME "rk29xx-camera" -#define RK29_CAM_PLATFORM_DEV_ID 33 - -#define INVALID_GPIO -1 - -#define RK29_CAM_IO_SUCCESS 0 -#define RK29_CAM_EIO_INVALID -1 -#define RK29_CAM_EIO_REQUESTFAIL -2 - -/*---------------- Camera Sensor Must Define Macro Begin ------------------------*/ -#define RK29_CAM_SENSOR_OV7675 ov7675 -#define RK29_CAM_SENSOR_OV9650 ov9650 -#define RK29_CAM_SENSOR_OV2640 ov2640 -#define RK29_CAM_SENSOR_OV2655 ov2655 -#define RK29_CAM_SENSOR_OV2659 ov2659 -#define RK29_CAM_SENSOR_OV7690 ov7690 -#define RK29_CAM_SENSOR_OV3640 ov3640 -#define RK29_CAM_SENSOR_OV5640 ov5640 -#define RK29_CAM_SENSOR_OV5642 ov5642 -#define RK29_CAM_SENSOR_S5K6AA s5k6aa -#define RK29_CAM_SENSOR_MT9D112 mt9d112 -#define RK29_CAM_SENSOR_MT9D113 mt9d113 -#define RK29_CAM_SENSOR_MT9P111 mt9p111 -#define RK29_CAM_SENSOR_MT9T111 mt9t111 -#define RK29_CAM_SENSOR_GT2005 gt2005 -#define RK29_CAM_SENSOR_GC0307 gc0307 -#define RK29_CAM_SENSOR_GC0308 gc0308 -#define RK29_CAM_SENSOR_GC0309 gc0309 -#define RK29_CAM_SENSOR_GC2015 gc2015 -#define RK29_CAM_SENSOR_SIV120B siv120b -#define RK29_CAM_SENSOR_SID130B sid130B -#define RK29_CAM_SENSOR_HI253 hi253 -#define RK29_CAM_SENSOR_HI704 hi704 -#define RK29_CAM_SENSOR_NT99250 nt99250 - -#define RK29_CAM_SENSOR_NAME_OV7675 "ov7675" -#define RK29_CAM_SENSOR_NAME_OV9650 "ov9650" -#define RK29_CAM_SENSOR_NAME_OV2640 "ov2640" -#define RK29_CAM_SENSOR_NAME_OV2655 "ov2655" -#define RK29_CAM_SENSOR_NAME_OV2659 "ov2659" -#define RK29_CAM_SENSOR_NAME_OV7690 "ov7690" -#define RK29_CAM_SENSOR_NAME_OV3640 "ov3640" -#define RK29_CAM_SENSOR_NAME_OV5640 "ov5640" -#define RK29_CAM_SENSOR_NAME_OV5642 "ov5642" -#define RK29_CAM_SENSOR_NAME_S5K6AA "s5k6aa" -#define RK29_CAM_SENSOR_NAME_MT9D112 "mt9d112" -#define RK29_CAM_SENSOR_NAME_MT9D113 "mt9d113" -#define RK29_CAM_SENSOR_NAME_MT9P111 "mt9p111" -#define RK29_CAM_SENSOR_NAME_MT9T111 "mt9t111" -#define RK29_CAM_SENSOR_NAME_GT2005 "gt2005" -#define RK29_CAM_SENSOR_NAME_GC0307 "gc0307" -#define RK29_CAM_SENSOR_NAME_GC0308 "gc0308" -#define RK29_CAM_SENSOR_NAME_GC0309 "gc0309" -#define RK29_CAM_SENSOR_NAME_GC2015 "gc2015" -#define RK29_CAM_SENSOR_NAME_SIV120B "siv120b" -#define RK29_CAM_SENSOR_NAME_SID130B "sid130B" -#define RK29_CAM_SENSOR_NAME_HI253 "hi253" -#define RK29_CAM_SENSOR_NAME_HI704 "hi704" -#define RK29_CAM_SENSOR_NAME_NT99250 "nt99250" - -#define ov7675_FULL_RESOLUTION 0x30000 // 0.3 megapixel -#define ov9650_FULL_RESOLUTION 0x130000 // 1.3 megapixel -#define ov2640_FULL_RESOLUTION 0x200000 // 2 megapixel -#define ov2655_FULL_RESOLUTION 0x200000 // 2 megapixel -#define ov2659_FULL_RESOLUTION 0x200000 // 2 megapixel -#define ov7690_FULL_RESOLUTION 0x300000 // 2 megapixel -#define ov3640_FULL_RESOLUTION 0x300000 // 3 megapixel -#define ov5640_FULL_RESOLUTION 0x500000 // 5 megapixel -#define ov5642_FULL_RESOLUTION 0x500000 // 5 megapixel -#define s5k6aa_FULL_RESOLUTION 0x130000 // 1.3 megapixel -#define mt9d112_FULL_RESOLUTION 0x200000 // 2 megapixel -#define mt9d113_FULL_RESOLUTION 0x200000 // 2 megapixel -#define mt9t111_FULL_RESOLUTION 0x300000 // 3 megapixel -#define mt9p111_FULL_RESOLUTION 0x500000 // 5 megapixel -#define gt2005_FULL_RESOLUTION 0x200000 // 2 megapixel -#define gc0308_FULL_RESOLUTION 0x30000 // 0.3 megapixel -#define gc0309_FULL_RESOLUTION 0x30000 // 0.3 megapixel -#define gc2015_FULL_RESOLUTION 0x200000 // 2 megapixel -#define siv120b_FULL_RESOLUTION 0x30000 // 0.3 megapixel -#define sid130B_FULL_RESOLUTION 0x200000 // 2 megapixel -#define hi253_FULL_RESOLUTION 0x200000 // 2 megapixel -#define hi704_FULL_RESOLUTION 0x30000 // 0.3 megapixel -#define nt99250_FULL_RESOLUTION 0x200000 // 2 megapixel -/*---------------- Camera Sensor Must Define Macro End ------------------------*/ - - -#define RK29_CAM_POWERACTIVE_BITPOS 0x00 -#define RK29_CAM_POWERACTIVE_MASK (1< diff --git a/arch/arm/mach-rk30/board-rk30-sdk.c b/arch/arm/mach-rk30/board-rk30-sdk.c index ca0f8a12e055..f94ba5be19cb 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk.c +++ b/arch/arm/mach-rk30/board-rk30-sdk.c @@ -57,8 +57,8 @@ #ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Macro Define Begin ------------------------*/ /*---------------- Camera Sensor Configuration Macro Begin ------------------------*/ -#define CONFIG_SENSOR_0 RK29_CAM_SENSOR_OV2659//RK_CAM_SENSOR_OV5642 /* back camera sensor */ -#define CONFIG_SENSOR_IIC_ADDR_0 0x60//0x78 +#define CONFIG_SENSOR_0 RK29_CAM_SENSOR_OV5642 /* back camera sensor */ +#define CONFIG_SENSOR_IIC_ADDR_0 0x78 #define CONFIG_SENSOR_IIC_ADAPTER_ID_0 1 #define CONFIG_SENSOR_CIF_INDEX_0 0 #define CONFIG_SENSOR_ORIENTATION_0 90 @@ -102,7 +102,7 @@ #define CONFIG_SENSOR_720P_FPS_FIXED_1 30000 #define CONFIG_USE_CIF_0 1 -#define CONFIG_USE_CIF_1 0 +#define CONFIG_USE_CIF_1 1 #endif //#ifdef CONFIG_VIDEO_RK29 /*---------------- Camera Sensor Configuration Macro End------------------------*/ #include "../../../drivers/media/video/rk30_camera.c" @@ -1065,7 +1065,7 @@ static void __init rk30_reserve(void) resource_fb[2].start = board_mem_reserve_add("fb2",RK30_FB0_MEM_SIZE); resource_fb[2].end = resource_fb[2].start + RK30_FB0_MEM_SIZE - 1; #endif -#ifdef CONFIG_VIDEO_RK +#ifdef CONFIG_VIDEO_RK29 rk30_camera_request_reserve_mem(); #endif board_mem_reserved(); diff --git a/drivers/media/video/rk30_camera.c b/drivers/media/video/rk30_camera.c index 6e22525de6f2..f9cb9ba5869c 100755 --- a/drivers/media/video/rk30_camera.c +++ b/drivers/media/video/rk30_camera.c @@ -834,7 +834,7 @@ static int rk_sensor_iomux(int pin) } case RK30_PIN3_PA7: { - rk30_mux_api_set(GPIO3A7_SDMMC0WRITEPRT_NAME,0); + rk30_mux_api_set(GPIO3A7_SDMMC0PWREN_NAME,0); break; } case RK30_PIN3_PB0: diff --git a/drivers/media/video/rk30_camera_oneframe.c b/drivers/media/video/rk30_camera_oneframe.c index 41f479ef793a..d568022b2315 100755 --- a/drivers/media/video/rk30_camera_oneframe.c +++ b/drivers/media/video/rk30_camera_oneframe.c @@ -2130,11 +2130,17 @@ static int rk_camera_probe(struct platform_device *pdev) pcdev->pdata->io_init(); } #ifdef CONFIG_VIDEO_RK29_WORK_IPP - if (pcdev->pdata && (strcmp(pcdev->pdata->meminfo.name,"camera_ipp_mem")==0)) { + if (pcdev->pdata && IS_CIF0()) { pcdev->vipmem_phybase = pcdev->pdata->meminfo.start; pcdev->vipmem_size = pcdev->pdata->meminfo.size; RKCAMERA_DG("\n%s Memory(start:0x%x size:0x%x) for IPP obtain \n",__FUNCTION__, pcdev->pdata->meminfo.start,pcdev->pdata->meminfo.size); - } else { + } + else if (pcdev->pdata){ + pcdev->vipmem_phybase = pcdev->pdata->meminfo_cif1.start; + pcdev->vipmem_size = pcdev->pdata->meminfo_cif1.size; + RKCAMERA_DG("\n%s Memory(start:0x%x size:0x%x) for IPP obtain \n",__FUNCTION__, pcdev->pdata->meminfo.start,pcdev->pdata->meminfo.size); + } + else{ RKCAMERA_TR("\n%s Memory for IPP have not obtain! IPP Function is fail\n",__FUNCTION__); pcdev->vipmem_phybase = 0; pcdev->vipmem_size = 0; -- 2.34.1