summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9t031.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 11:46:54 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-19 00:19:06 -0300
commit08590b9613f7f624fe3a052586eea2dbb3584b38 (patch)
treea893d250a4edf84e93794be59e2b1d859314c972 /drivers/media/video/mt9t031.c
parent961801bbb3448a86f0cc93747cecbfae686d81d1 (diff)
downloadop-kernel-dev-08590b9613f7f624fe3a052586eea2dbb3584b38.zip
op-kernel-dev-08590b9613f7f624fe3a052586eea2dbb3584b38.tar.gz
V4L/DVB (12529): soc-camera: switch to s_crop v4l2-subdev video operation
Remove set_crop soc-camera device method and switch to s_crop from v4l2-subdev video operations. Also extend non-i2c drivers to also hold a pointer to their v4l2-subdev instance in control device driver-data, i.e., in dev_get_drvdata((struct device *)to_soc_camera_control(icd)) Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mt9t031.c')
-rw-r--r--drivers/media/video/mt9t031.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c
index 125973b..3fa87be 100644
--- a/drivers/media/video/mt9t031.c
+++ b/drivers/media/video/mt9t031.c
@@ -321,11 +321,12 @@ static int mt9t031_set_params(struct soc_camera_device *icd,
return ret < 0 ? ret : 0;
}
-static int mt9t031_set_crop(struct soc_camera_device *icd,
- struct v4l2_rect *rect)
+static int mt9t031_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
{
- struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
+ struct v4l2_rect *rect = &a->c;
+ struct i2c_client *client = sd->priv;
struct mt9t031 *mt9t031 = to_mt9t031(client);
+ struct soc_camera_device *icd = client->dev.platform_data;
/* Make sure we don't exceed sensor limits */
if (rect->left + rect->width > icd->rect_max.left + icd->rect_max.width)
@@ -495,7 +496,6 @@ static const struct v4l2_queryctrl mt9t031_controls[] = {
static struct soc_camera_ops mt9t031_ops = {
.init = mt9t031_init,
.release = mt9t031_release,
- .set_crop = mt9t031_set_crop,
.set_bus_param = mt9t031_set_bus_param,
.query_bus_param = mt9t031_query_bus_param,
.controls = mt9t031_controls,
@@ -689,6 +689,7 @@ static struct v4l2_subdev_video_ops mt9t031_subdev_video_ops = {
.s_stream = mt9t031_s_stream,
.s_fmt = mt9t031_s_fmt,
.try_fmt = mt9t031_try_fmt,
+ .s_crop = mt9t031_s_crop,
};
static struct v4l2_subdev_ops mt9t031_subdev_ops = {
OpenPOWER on IntegriCloud