summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2015-03-30 16:21:57 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2015-05-08 17:24:32 +0800
commit6572a321dc77645e0560dc20d81782c5e29c7228 (patch)
treea3ae7a6a6282c571d587da268a15a521fcdd830a /drivers
parent723cdd5318e7286e07f2bfe8dc68422ec2045486 (diff)
MLK-10434-2: ov5640: Fix first frame black issue
The issue is caused by csi begin to work when ov5640 still in unstable state. Adjust ov5640 power up sequence: -Enable ov5640 power when device probe. -Remove ov5640 clock and power function from s_parm. -Remove s_stream function. -Remove regulator poweron/off from s_power function and only keep clk_enable/disable function in s_power. s_power will been called when v4l2 capture driver open/close. Signed-off-by: Sandor Yu <R01008@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/mxc/subdev/ov5640.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/drivers/media/platform/mxc/subdev/ov5640.c b/drivers/media/platform/mxc/subdev/ov5640.c
index 34f3440a54b4..dcae1ed1cad9 100644
--- a/drivers/media/platform/mxc/subdev/ov5640.c
+++ b/drivers/media/platform/mxc/subdev/ov5640.c
@@ -1391,46 +1391,11 @@ static int ov5640_s_power(struct v4l2_subdev *sd, int on)
else
clk_disable(ov5640_data.sensor_clk);
- if (on && !sensor->on) {
- if (io_regulator)
- if (regulator_enable(io_regulator) != 0)
- return -EIO;
- if (core_regulator)
- if (regulator_enable(core_regulator) != 0)
- return -EIO;
- if (analog_regulator)
- if (regulator_enable(analog_regulator) != 0)
- return -EIO;
- /* Make sure power on */
- ov5640_power_down(0);
- } else if (!on && sensor->on) {
- if (analog_regulator)
- regulator_disable(analog_regulator);
- if (core_regulator)
- regulator_disable(core_regulator);
- if (io_regulator)
- regulator_disable(io_regulator);
-
- ov5640_power_down(1);
- }
-
sensor->on = on;
return 0;
}
-static int ov5640_s_stream(struct v4l2_subdev *sd, int enable)
-{
- if (enable) {
- clk_enable(ov5640_data.sensor_clk);
- ov5640_power_down(0);
- } else {
- ov5640_power_down(1);
- clk_disable(ov5640_data.sensor_clk);
- }
- return 0;
-}
-
/*!
* ov5640_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl
* @s: pointer to standard V4L2 sub device structure
@@ -1493,10 +1458,6 @@ static int ov5640_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
enum ov5640_frame_rate frame_rate;
int ret = 0;
- /* Make sure power on */
- clk_enable(ov5640_data.sensor_clk);
- ov5640_power_down(0);
-
switch (a->type) {
/* This is the only case currently handled. */
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
@@ -1561,8 +1522,6 @@ static int ov5640_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
}
error:
- ov5640_power_down(1);
- clk_disable(ov5640_data.sensor_clk);
return ret;
}
@@ -1731,7 +1690,6 @@ static int init_device(void)
}
static struct v4l2_subdev_video_ops ov5640_subdev_video_ops = {
- .s_stream = ov5640_s_stream,
.g_parm = ov5640_g_parm,
.s_parm = ov5640_s_parm,
@@ -1868,8 +1826,6 @@ static int ov5640_probe(struct i2c_client *client,
return retval;
}
- ov5640_power_down(1);
-
clk_disable(ov5640_data.sensor_clk);
v4l2_i2c_subdev_init(&ov5640_data.subdev, client, &ov5640_subdev_ops);
@@ -1897,6 +1853,8 @@ static int ov5640_remove(struct i2c_client *client)
clk_unprepare(ov5640_data.sensor_clk);
+ ov5640_power_down(1);
+
if (analog_regulator)
regulator_disable(analog_regulator);