summaryrefslogtreecommitdiff
path: root/drivers/media/video/tw9910.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 14:46:54 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-19 03:19:06 (GMT)
commit08590b9613f7f624fe3a052586eea2dbb3584b38 (patch)
treea893d250a4edf84e93794be59e2b1d859314c972 /drivers/media/video/tw9910.c
parent961801bbb3448a86f0cc93747cecbfae686d81d1 (diff)
downloadlinux-fsl-qoriq-08590b9613f7f624fe3a052586eea2dbb3584b38.tar.xz
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/tw9910.c')
-rw-r--r--drivers/media/video/tw9910.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index 735d0bd..b6b1546 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -616,11 +616,12 @@ static int tw9910_s_register(struct v4l2_subdev *sd,
}
#endif
-static int tw9910_set_crop(struct soc_camera_device *icd,
- struct v4l2_rect *rect)
+static int tw9910_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 tw9910_priv *priv = to_tw9910(client);
+ struct soc_camera_device *icd = client->dev.platform_data;
int ret = -EINVAL;
u8 val;
@@ -716,15 +717,15 @@ tw9910_set_fmt_error:
static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
{
- struct i2c_client *client = sd->priv;
- struct soc_camera_device *icd = client->dev.platform_data;
struct v4l2_pix_format *pix = &f->fmt.pix;
- /* See tw9910_set_crop() - no proper cropping support */
- struct v4l2_rect rect = {
- .left = 0,
- .top = 0,
- .width = pix->width,
- .height = pix->height,
+ /* See tw9910_s_crop() - no proper cropping support */
+ struct v4l2_crop a = {
+ .c = {
+ .left = 0,
+ .top = 0,
+ .width = pix->width,
+ .height = pix->height,
+ },
};
int i, ret;
@@ -738,10 +739,10 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
if (i == ARRAY_SIZE(tw9910_color_fmt))
return -EINVAL;
- ret = tw9910_set_crop(icd, &rect);
+ ret = tw9910_s_crop(sd, &a);
if (!ret) {
- pix->width = rect.width;
- pix->height = rect.height;
+ pix->width = a.c.width;
+ pix->height = a.c.height;
}
return ret;
}
@@ -821,7 +822,6 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
}
static struct soc_camera_ops tw9910_ops = {
- .set_crop = tw9910_set_crop,
.set_bus_param = tw9910_set_bus_param,
.query_bus_param = tw9910_query_bus_param,
.enum_input = tw9910_enum_input,
@@ -840,6 +840,7 @@ static struct v4l2_subdev_video_ops tw9910_subdev_video_ops = {
.s_stream = tw9910_s_stream,
.s_fmt = tw9910_s_fmt,
.try_fmt = tw9910_try_fmt,
+ .s_crop = tw9910_s_crop,
};
static struct v4l2_subdev_ops tw9910_subdev_ops = {