From c3ae7993f4293da5f7da5e9c8d6455a1ee9dd81b Mon Sep 17 00:00:00 2001 From: zyc Date: Tue, 15 Jan 2013 18:43:52 +0800 Subject: [PATCH] camera rk2928:add cif reset and power control --- arch/arm/mach-rk2928/board-rk2928-camera.c | 8 +++++--- drivers/media/video/rk30_camera_oneframe.c | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rk2928/board-rk2928-camera.c b/arch/arm/mach-rk2928/board-rk2928-camera.c index 0ffe64dd0bbc..2d182b1edb0f 100755 --- a/arch/arm/mach-rk2928/board-rk2928-camera.c +++ b/arch/arm/mach-rk2928/board-rk2928-camera.c @@ -166,10 +166,12 @@ static void rk_cif_power(int on) printk("get cif ldo failed!\n"); return; } - if(on == 0){ - regulator_disable(ldo_28); + if(on == 0){ + while(regulator_is_enabled(ldo_28)>0) + regulator_disable(ldo_28); regulator_put(ldo_28); - regulator_disable(ldo_18); + while(regulator_is_enabled(ldo_18)>0) + regulator_disable(ldo_18); regulator_put(ldo_18); mdelay(500); } diff --git a/drivers/media/video/rk30_camera_oneframe.c b/drivers/media/video/rk30_camera_oneframe.c index a49388bad11b..385fdfe4484e 100755 --- a/drivers/media/video/rk30_camera_oneframe.c +++ b/drivers/media/video/rk30_camera_oneframe.c @@ -48,6 +48,9 @@ #if defined(CONFIG_ARCH_RK2928) #include +#include +#include +#define SOFT_RST_CIF1 (SOFT_RST_MAX+1) #endif #include static int debug; @@ -1795,7 +1798,7 @@ static void rk_camera_setup_format(struct soc_camera_device *icd, __u32 host_pix } #if 1 { -#ifdef CONFIG_ARCH_RK30 +#if (defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK2928)) mdelay(100); if(IS_CIF0()){ // pmu_set_idle_request(IDLE_REQ_VIO, true); -- 2.34.1