From 51eaecbb3b508acacf556ed21a243f00e7847d1e Mon Sep 17 00:00:00 2001 From: ddl Date: Thu, 4 Aug 2011 17:38:02 +0800 Subject: [PATCH] camera:fix camera power gpio request may be failed --- drivers/media/video/rk29_camera.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/rk29_camera.c b/drivers/media/video/rk29_camera.c index 04e6df1d3a1e..3e19731fe08c 100755 --- a/drivers/media/video/rk29_camera.c +++ b/drivers/media/video/rk29_camera.c @@ -270,8 +270,14 @@ static int rk29_sensor_io_init(void) if (camera_power != INVALID_GPIO) { ret = gpio_request(camera_power, "camera power"); - if (ret) - goto sensor_io_int_loop_end; + if (ret) { + if (i == 0) { + goto sensor_io_int_loop_end; + } else { + if (camera_power != rk29_camera_platform_data.gpio_res[0].gpio_power) + goto sensor_io_int_loop_end; + } + } rk29_camera_platform_data.gpio_res[i].gpio_init |= RK29_CAM_POWERACTIVE_MASK; gpio_set_value(camera_reset, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS)); gpio_direction_output(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS)); -- 2.34.1