diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-08-25 10:46:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:19:06 -0400 |
commit | 08590b9613f7f624fe3a052586eea2dbb3584b38 (patch) | |
tree | a893d250a4edf84e93794be59e2b1d859314c972 /drivers/media/video/tw9910.c | |
parent | 961801bbb3448a86f0cc93747cecbfae686d81d1 (diff) |
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.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index 735d0bd4bb10..b6b15468b40a 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, | |||
616 | } | 616 | } |
617 | #endif | 617 | #endif |
618 | 618 | ||
619 | static int tw9910_set_crop(struct soc_camera_device *icd, | 619 | static int tw9910_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) |
620 | struct v4l2_rect *rect) | ||
621 | { | 620 | { |
622 | struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); | 621 | struct v4l2_rect *rect = &a->c; |
622 | struct i2c_client *client = sd->priv; | ||
623 | struct tw9910_priv *priv = to_tw9910(client); | 623 | struct tw9910_priv *priv = to_tw9910(client); |
624 | struct soc_camera_device *icd = client->dev.platform_data; | ||
624 | int ret = -EINVAL; | 625 | int ret = -EINVAL; |
625 | u8 val; | 626 | u8 val; |
626 | 627 | ||
@@ -716,15 +717,15 @@ tw9910_set_fmt_error: | |||
716 | 717 | ||
717 | static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) | 718 | static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) |
718 | { | 719 | { |
719 | struct i2c_client *client = sd->priv; | ||
720 | struct soc_camera_device *icd = client->dev.platform_data; | ||
721 | struct v4l2_pix_format *pix = &f->fmt.pix; | 720 | struct v4l2_pix_format *pix = &f->fmt.pix; |
722 | /* See tw9910_set_crop() - no proper cropping support */ | 721 | /* See tw9910_s_crop() - no proper cropping support */ |
723 | struct v4l2_rect rect = { | 722 | struct v4l2_crop a = { |
724 | .left = 0, | 723 | .c = { |
725 | .top = 0, | 724 | .left = 0, |
726 | .width = pix->width, | 725 | .top = 0, |
727 | .height = pix->height, | 726 | .width = pix->width, |
727 | .height = pix->height, | ||
728 | }, | ||
728 | }; | 729 | }; |
729 | int i, ret; | 730 | int i, ret; |
730 | 731 | ||
@@ -738,10 +739,10 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) | |||
738 | if (i == ARRAY_SIZE(tw9910_color_fmt)) | 739 | if (i == ARRAY_SIZE(tw9910_color_fmt)) |
739 | return -EINVAL; | 740 | return -EINVAL; |
740 | 741 | ||
741 | ret = tw9910_set_crop(icd, &rect); | 742 | ret = tw9910_s_crop(sd, &a); |
742 | if (!ret) { | 743 | if (!ret) { |
743 | pix->width = rect.width; | 744 | pix->width = a.c.width; |
744 | pix->height = rect.height; | 745 | pix->height = a.c.height; |
745 | } | 746 | } |
746 | return ret; | 747 | return ret; |
747 | } | 748 | } |
@@ -821,7 +822,6 @@ static int tw9910_video_probe(struct soc_camera_device *icd, | |||
821 | } | 822 | } |
822 | 823 | ||
823 | static struct soc_camera_ops tw9910_ops = { | 824 | static struct soc_camera_ops tw9910_ops = { |
824 | .set_crop = tw9910_set_crop, | ||
825 | .set_bus_param = tw9910_set_bus_param, | 825 | .set_bus_param = tw9910_set_bus_param, |
826 | .query_bus_param = tw9910_query_bus_param, | 826 | .query_bus_param = tw9910_query_bus_param, |
827 | .enum_input = tw9910_enum_input, | 827 | .enum_input = tw9910_enum_input, |
@@ -840,6 +840,7 @@ static struct v4l2_subdev_video_ops tw9910_subdev_video_ops = { | |||
840 | .s_stream = tw9910_s_stream, | 840 | .s_stream = tw9910_s_stream, |
841 | .s_fmt = tw9910_s_fmt, | 841 | .s_fmt = tw9910_s_fmt, |
842 | .try_fmt = tw9910_try_fmt, | 842 | .try_fmt = tw9910_try_fmt, |
843 | .s_crop = tw9910_s_crop, | ||
843 | }; | 844 | }; |
844 | 845 | ||
845 | static struct v4l2_subdev_ops tw9910_subdev_ops = { | 846 | static struct v4l2_subdev_ops tw9910_subdev_ops = { |