From: Hans Verkuil hans.verk...@cisco.com
Replace all calls to g/s_crop and cropcap by calls to the
get/set_selection pad ops.
Remove the old g/s_crop and cropcap video ops since they are now no
longer used.
Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
drivers/media/i2c/ak881x.c | 28 +++--
drivers/media/i2c/soc_camera/imx074.c | 42 +++
drivers/media/i2c/soc_camera/mt9m001.c | 70 ++-
drivers/media/i2c/soc_camera/mt9m111.c | 57 -
drivers/media/i2c/soc_camera/mt9t031.c | 52 +
drivers/media/i2c/soc_camera/mt9t112.c | 60 +-
drivers/media/i2c/soc_camera/mt9v022.c | 68 ++-
drivers/media/i2c/soc_camera/ov2640.c | 41 +++
drivers/media/i2c/soc_camera/ov5642.c | 53 +
drivers/media/i2c/soc_camera/ov6650.c | 74 ++--
drivers/media/i2c/soc_camera/ov772x.c | 44 ---
drivers/media/i2c/soc_camera/ov9640.c | 41 +++
drivers/media/i2c/soc_camera/ov9740.c | 41 +++
drivers/media/i2c/soc_camera/rj54n1cb0c.c | 52 +
drivers/media/i2c/soc_camera/tw9910.c | 47 +++-
drivers/media/i2c/tvp5150.c| 81 +++--
drivers/media/platform/omap3isp/ispvideo.c | 88 +-
drivers/media/platform/sh_vou.c| 13 ++-
drivers/media/platform/soc_camera/mx2_camera.c | 18 ++-
drivers/media/platform/soc_camera/mx3_camera.c | 18 ++-
drivers/media/platform/soc_camera/omap1_camera.c | 23 ++--
drivers/media/platform/soc_camera/pxa_camera.c | 17 ++-
drivers/media/platform/soc_camera/rcar_vin.c | 26 ++---
.../platform/soc_camera/sh_mobile_ceu_camera.c | 32 +++--
drivers/media/platform/soc_camera/soc_camera.c | 130 ++---
.../platform/soc_camera/soc_camera_platform.c | 45 +++
drivers/media/platform/soc_camera/soc_scale_crop.c | 85 --
drivers/media/platform/soc_camera/soc_scale_crop.h | 6 +-
drivers/staging/media/omap4iss/iss_video.c | 88 +-
include/media/soc_camera.h | 7 +-
include/media/v4l2-subdev.h| 3 -
31 files changed, 735 insertions(+), 715 deletions(-)
diff --git a/drivers/media/i2c/ak881x.c b/drivers/media/i2c/ak881x.c
index 2984624..a87b3b5 100644
--- a/drivers/media/i2c/ak881x.c
+++ b/drivers/media/i2c/ak881x.c
@@ -124,21 +124,27 @@ static int ak881x_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
}
-static int ak881x_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a)
+static int ak881x_get_selection(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ struct v4l2_subdev_selection *sel)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ak881x *ak881x = to_ak881x(client);
- a-bounds.left = 0;
- a-bounds.top = 0;
- a-bounds.width = 720;
- a-bounds.height= ak881x-lines;
- a-defrect = a-bounds;
- a-type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
- a-pixelaspect.numerator= 1;
- a-pixelaspect.denominator = 1;
+ if (sel-which != V4L2_SUBDEV_FORMAT_ACTIVE)
+ return -EINVAL;
- return 0;
+ switch (sel-target) {
+ case V4L2_SEL_TGT_CROP_BOUNDS:
+ case V4L2_SEL_TGT_CROP_DEFAULT:
+ sel-r.left = 0;
+ sel-r.top = 0;
+ sel-r.width = 720;
+ sel-r.height = ak881x-lines;
+ return 0;
+ default:
+ return -EINVAL;
+ }
}
static int ak881x_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
@@ -207,13 +213,13 @@ static struct v4l2_subdev_core_ops ak881x_subdev_core_ops
= {
};
static struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {
- .cropcap= ak881x_cropcap,
.s_std_output = ak881x_s_std_output,
.s_stream = ak881x_s_stream,
};
static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = {
.enum_mbus_code = ak881x_enum_mbus_code,
+ .get_selection = ak881x_get_selection,
.set_fmt= ak881x_fill_fmt,
.get_fmt= ak881x_fill_fmt,
};
diff --git a/drivers/media/i2c/soc_camera/imx074.c
b/drivers/media/i2c/soc_camera/imx074.c
index f68c235..05b55cf 100644
--- a/drivers/media/i2c/soc_camera/imx074.c
+++ b/drivers/media/i2c/soc_camera/imx074.c
@@ -209,31 +209,26 @@ static int imx074_get_fmt(struct v4l2_subdev *sd,
return 0;
}
-static int imx074_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
+static int