MLK-11832: MIPI CSI: Adjust mipi csi sensor power up process

Add s_stream interface for MIPI CSI and ov5647/ov5640 drivers.
Enable MIPI CSI sensor after MIPI CSI DPHY CLK enable
in case MIPI DPHY miss MIPI CSI sensor signal.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit 26d81b416be6e3af203d1254a3116dbcf39a5605)
This commit is contained in:
Sandor Yu 2015-11-18 11:43:59 +08:00 committed by Nitin Garg
parent a798e63e95
commit 04232d021f
3 changed files with 22 additions and 9 deletions

View File

@ -664,8 +664,10 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable)
goto unlock;
}
mipi_csis_start_stream(state);
v4l2_subdev_call(state->sensor_sd, video, s_stream, true);
state->flags |= ST_STREAMING;
} else {
v4l2_subdev_call(state->sensor_sd, video, s_stream, false);
mipi_csis_stop_stream(state);
state->flags &= ~ST_STREAMING;
if (debug > 0)

View File

@ -871,7 +871,6 @@ static void OV5640_stream_off(void)
ov5640_write_reg(0x4202, 0x0f);
}
static int OV5640_get_sysclk(void)
{
/* calculate sysclk */
@ -1304,8 +1303,6 @@ static int ov5640_change_mode_exposure_calc(enum ov5640_frame_rate frame_rate,
}
OV5640_set_shutter(cap_shutter);
OV5640_stream_on();
err:
return retval;
}
@ -1345,8 +1342,6 @@ static int ov5640_change_mode_direct(enum ov5640_frame_rate frame_rate,
if (retval < 0)
goto err;
OV5640_stream_on();
OV5640_turn_on_AE_AG(1);
err:
@ -1757,9 +1752,19 @@ static int init_device(void)
return ret;
}
static int ov5640_s_stream(struct v4l2_subdev *sd, int enable)
{
if (enable)
OV5640_stream_on();
else
OV5640_stream_off();
return 0;
}
static struct v4l2_subdev_video_ops ov5640_subdev_video_ops = {
.g_parm = ov5640_g_parm,
.s_parm = ov5640_s_parm,
.s_stream = ov5640_s_stream,
.s_mbus_fmt = ov5640_s_fmt,
.g_mbus_fmt = ov5640_g_fmt,

View File

@ -1047,8 +1047,6 @@ static int ov5647_change_mode_exposure_calc(enum ov5647_frame_rate frame_rate,
}
ov5647_set_shutter(cap_shutter);
ov5647_stream_on();
err:
return retval;
}
@ -1088,8 +1086,6 @@ static int ov5647_change_mode_direct(enum ov5647_frame_rate frame_rate,
if (retval < 0)
goto err;
ov5647_stream_on();
ov5647_turn_on_AE_AG(1);
err:
@ -1503,9 +1499,19 @@ static int init_device(void)
return ret;
}
static int ov5647_s_stream(struct v4l2_subdev *sd, int enable)
{
if (enable)
ov5647_stream_on();
else
ov5647_stream_off();
return 0;
}
static struct v4l2_subdev_video_ops ov5647_subdev_video_ops = {
.g_parm = ov5647_g_parm,
.s_parm = ov5647_s_parm,
.s_stream = ov5647_s_stream,
.s_mbus_fmt = ov5647_s_fmt,
.g_mbus_fmt = ov5647_g_fmt,