camera rk2928:add cif reset and power control
authorzyc <zyc@rock-chips.com>
Tue, 15 Jan 2013 10:43:52 +0000 (18:43 +0800)
committerzyc <zyc@rock-chips.com>
Tue, 15 Jan 2013 10:43:52 +0000 (18:43 +0800)
arch/arm/mach-rk2928/board-rk2928-camera.c
drivers/media/video/rk30_camera_oneframe.c

index 0ffe64dd0bbcc89505601764712cb6dd12062047..2d182b1edb0fffb156e8355e6bcd72f0b8aa4e64 100755 (executable)
@@ -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);
         }
index a49388bad11b46ce1096d7228acaac229c3b081e..385fdfe4484e324e512118d37159e3ff60486683 100755 (executable)
@@ -48,6 +48,9 @@
 
 #if defined(CONFIG_ARCH_RK2928)
 #include <mach/rk2928_camera.h>
+#include <mach/cru.h>
+#include <mach/pmu.h>
+#define SOFT_RST_CIF1 (SOFT_RST_MAX+1)
 #endif
 #include <asm/cacheflush.h>
 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);