camera: rk_cam_io:v0.1.5
authorddl <ddl@rock-chips.com>
Sun, 22 Sep 2013 08:42:23 +0000 (16:42 +0800)
committerddl <ddl@rock-chips.com>
Sun, 22 Sep 2013 08:43:35 +0000 (16:43 +0800)
arch/arm/plat-rk/include/plat/rk_camera.h
arch/arm/plat-rk/rk_camera.c

index b0a3b88696c4be8eea14211fdfcaab4c8284c8c8..5db427ae4209f4b65ab60a3f4ecf7555890fd095 100755 (executable)
@@ -34,7 +34,7 @@
 #define INVALID_GPIO INVALID_VALUE
 #endif
 #define RK29_CAM_IO_SUCCESS 0
-#define RK29_CAM_EIO_INVALID -1
+#define RK29_CAM_EIO_INVALID -3
 #define RK29_CAM_EIO_REQUESTFAIL -2
 
 #define RK29_CAM_POWERACTIVE_BITPOS    0x00
index 496accc83aa93b26121b063b7000468fee4248b1..c301bae3e35d9f32c621f72568a3ef954961d939 100755 (executable)
 *v0.1.3:\r
 *        1. this version support fov configuration in new_camera_device;\r
 *        2. Reduce delay time after power off or power down camera;\r
+*v0.1.5:\r
+*        1. if sensor power callback failed, power down sensor;\r
 */\r
-static int camio_version = KERNEL_VERSION(0,1,3);\r
+static int camio_version = KERNEL_VERSION(0,1,5);\r
 module_param(camio_version, int, S_IRUGO);\r
 \r
 \r
@@ -1398,6 +1400,8 @@ static int rk_sensor_ioctrl(struct device *dev,enum rk29camera_ioctrl_cmd cmd, i
                 eprintk("sensor_ioctl_cb.sensor_power_cb is NULL");\r
                 WARN_ON(1);\r
                        }\r
+\r
+                       printk("ret: %d\n",ret);\r
                        break;\r
                }\r
                case Cam_Reset:\r
@@ -1596,7 +1600,8 @@ static int rk_sensor_power(struct device *dev, int on)
         rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate);  \r
     } else {\r
         if (real_pwroff) {\r
-            rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate);\r
+            if (rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate)<0)    /* ddl@rock-chips.com: v0.1.5 */\r
+                goto PowerDown;\r
             \r
             /*ddl@rock-chips.com: all power down switch to Hi-Z after power off*/\r
             for(i = 0;i < RK_CAM_NUM; i++) {\r
@@ -1615,7 +1620,8 @@ static int rk_sensor_power(struct device *dev, int on)
                 new_camera->pwdn_info |= 0x01;\r
                 new_camera++;\r
             }\r
-        } else {            \r
+        } else {  \r
+PowerDown:\r
             rk_sensor_ioctrl(dev,Cam_PowerDown, !on);\r
 \r
             rk_sensor_ioctrl(dev,Cam_Mclk, 0);\r