summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAlejandro Gonzalez <alex.gonzalez@digi.com>2010-11-04 12:32:12 +0100
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2011-01-21 15:12:25 +0100
commit2eafa12c1c7a489f8ea0ece0e3371ebaaf38ffde (patch)
treeb032f7147679d315ab09fe0cb8bf43da30581ff3 /drivers/media
parentfa744a1beac9a7740ea712721757e18cbd122acb (diff)
Implement VIDIOC_INT_INIT
It's used by some applications to set reasonable default values to the sensor. Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mxc/capture/mt9v111.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/media/video/mxc/capture/mt9v111.c b/drivers/media/video/mxc/capture/mt9v111.c
index 567261c7c838..3ffcdf64bd01 100644
--- a/drivers/media/video/mxc/capture/mt9v111.c
+++ b/drivers/media/video/mxc/capture/mt9v111.c
@@ -1112,19 +1112,6 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc)
return retval;
}
-/*!
- * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT
- * @s: pointer to standard V4L2 device structure
- */
-static int ioctl_init(struct v4l2_int_device *s)
-{
- int sensorid = mt9v111_id_from_name(((struct sensor *)s->priv)->v4l2_int_device->name);
-
- pr_debug("In mt9v111:ioctl_init for sensor %d\n",sensorid);
-
- return 0;
-}
-
static void mt9v111_ifp_reset ( int sensorid )
{
mt9v111_write_reg(sensorid,MT9V111S_ADDR_SPACE_SEL, 0x0001);
@@ -1144,6 +1131,27 @@ static void mt9v111_sensor_reset ( int sensorid )
}
/*!
+ * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT
+ * @s: pointer to standard V4L2 device structure
+ */
+static int ioctl_init(struct v4l2_int_device *s)
+{
+ int sensorid = 0;
+
+ sensorid = mt9v111_id_from_name(((struct sensor *)s->priv)->v4l2_int_device->name);
+ if( sensorid < 0 )
+ return 0;
+
+ pr_debug("In mt9v111:ioctl_init for sensor %d\n",sensorid);
+
+ mt9v111_sensor_reset(sensorid);
+ mt9v111_ifp_reset(sensorid);
+ mt9v111_sensor_lib_datasheet(sensorid,mt9v111_device.coreReg, mt9v111_device.ifpReg);
+
+ return 0;
+}
+
+/*!
* ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num
* @s: pointer to standard V4L2 device structure
*