summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorYuxi Sun <b36102@freescale.com>2012-03-26 17:57:45 +0800
committerYuxi Sun <b36102@freescale.com>2012-03-26 18:33:27 +0800
commitdfbba173c68f8a78ab60433e9276a7e9c8a331e3 (patch)
tree34bad213bad4f82053b782bb32652457d2881f2b /drivers/media
parent2db9918b030253a6717ca053c91372d453c3d0b8 (diff)
ENGR00177944 v4l2 capture: enable mclk and power up when open camera
Set mclk enable and power up camera when open camera, and disable mclk, powerdown camera when close. Signed-off-by: Yuxi Sun <b36102@freescale.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mxc/capture/mxc_v4l2_capture.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
index 03864a819201..e3af2f817990 100644
--- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
+++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
@@ -1666,7 +1666,9 @@ static int mxc_v4l_open(struct file *file)
ipu_csi_enable_mclk_if(cam->ipu, CSI_MCLK_I2C, cam->csi,
true, true);
+ vidioc_int_s_power(cam->sensor, 1);
vidioc_int_init(cam->sensor);
+ vidioc_int_dev_init(cam->sensor);
}
file->private_data = dev;
@@ -1708,6 +1710,7 @@ static int mxc_v4l_close(struct file *file)
}
if (--cam->open_count == 0) {
+ vidioc_int_s_power(cam->sensor, 0);
ipu_csi_enable_mclk_if(cam->ipu, CSI_MCLK_I2C, cam->csi,
false, false);
@@ -2840,15 +2843,11 @@ static int mxc_v4l2_master_attach(struct v4l2_int_device *slave)
return -1;
}
- for (i = 0; i < sensor_index - 1; i++) {
+ for (i = 0; i < sensor_index; i++) {
vidioc_int_dev_exit(cam->all_sensors[i]);
vidioc_int_s_power(cam->all_sensors[i], 0);
}
- ipu_csi_enable_mclk_if(cam->ipu, CSI_MCLK_I2C, cam->csi, true, true);
- vidioc_int_s_power(cam->sensor, 1);
- vidioc_int_dev_init(slave);
- ipu_csi_enable_mclk_if(cam->ipu, CSI_MCLK_I2C, cam->csi, false, false);
cam_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
vidioc_int_g_fmt_cap(cam->sensor, &cam_fmt);