From 6da33d17be6bd1615e9489d11a0237bf34c1c4d8 Mon Sep 17 00:00:00 2001 From: ddl Date: Sun, 22 Sep 2013 16:42:23 +0800 Subject: [PATCH] camera: rk_cam_io:v0.1.5 --- arch/arm/plat-rk/include/plat/rk_camera.h | 2 +- arch/arm/plat-rk/rk_camera.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm/plat-rk/include/plat/rk_camera.h b/arch/arm/plat-rk/include/plat/rk_camera.h index b0a3b88696c4..5db427ae4209 100755 --- a/arch/arm/plat-rk/include/plat/rk_camera.h +++ b/arch/arm/plat-rk/include/plat/rk_camera.h @@ -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 diff --git a/arch/arm/plat-rk/rk_camera.c b/arch/arm/plat-rk/rk_camera.c index 496accc83aa9..c301bae3e35d 100755 --- a/arch/arm/plat-rk/rk_camera.c +++ b/arch/arm/plat-rk/rk_camera.c @@ -269,8 +269,10 @@ *v0.1.3: * 1. this version support fov configuration in new_camera_device; * 2. Reduce delay time after power off or power down camera; +*v0.1.5: +* 1. if sensor power callback failed, power down sensor; */ -static int camio_version = KERNEL_VERSION(0,1,3); +static int camio_version = KERNEL_VERSION(0,1,5); module_param(camio_version, int, S_IRUGO); @@ -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"); WARN_ON(1); } + + printk("ret: %d\n",ret); break; } case Cam_Reset: @@ -1596,7 +1600,8 @@ static int rk_sensor_power(struct device *dev, int on) rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate); } else { if (real_pwroff) { - rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate); + if (rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate)<0) /* ddl@rock-chips.com: v0.1.5 */ + goto PowerDown; /*ddl@rock-chips.com: all power down switch to Hi-Z after power off*/ for(i = 0;i < RK_CAM_NUM; i++) { @@ -1615,7 +1620,8 @@ static int rk_sensor_power(struct device *dev, int on) new_camera->pwdn_info |= 0x01; new_camera++; } - } else { + } else { +PowerDown: rk_sensor_ioctrl(dev,Cam_PowerDown, !on); rk_sensor_ioctrl(dev,Cam_Mclk, 0); -- 2.34.1