summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/ak881x.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-04-09 04:02:34 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-01 08:36:17 -0300
commitda298c6d98d531de778ba8dd6657b1093ef855d0 (patch)
tree55a80a5affa0669aae9834e94f536f7786401309 /drivers/media/i2c/ak881x.c
parentebcff5fce6b189306756b0cb06779e15f1c93848 (diff)
downloadlinux-stable-da298c6d98d531de778ba8dd6657b1093ef855d0.tar.gz
linux-stable-da298c6d98d531de778ba8dd6657b1093ef855d0.tar.bz2
linux-stable-da298c6d98d531de778ba8dd6657b1093ef855d0.zip
[media] v4l2: replace video op g_mbus_fmt by pad op get_fmt
The g_mbus_fmt video op is a duplicate of the pad op. Replace all uses by the get_fmt pad op and remove the video op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Cc: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/ak881x.c')
-rw-r--r--drivers/media/i2c/ak881x.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/media/i2c/ak881x.c b/drivers/media/i2c/ak881x.c
index 4428fb95d033..29846245aa3b 100644
--- a/drivers/media/i2c/ak881x.c
+++ b/drivers/media/i2c/ak881x.c
@@ -93,12 +93,17 @@ static int ak881x_s_register(struct v4l2_subdev *sd,
}
#endif
-static int ak881x_try_g_mbus_fmt(struct v4l2_subdev *sd,
- struct v4l2_mbus_framefmt *mf)
+static int ak881x_fill_fmt(struct v4l2_subdev *sd,
+ struct v4l2_subdev_pad_config *cfg,
+ struct v4l2_subdev_format *format)
{
+ struct v4l2_mbus_framefmt *mf = &format->format;
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ak881x *ak881x = to_ak881x(client);
+ if (format->pad)
+ return -EINVAL;
+
v4l_bound_align_image(&mf->width, 0, 720, 2,
&mf->height, 0, ak881x->lines, 1, 0);
mf->field = V4L2_FIELD_INTERLACED;
@@ -108,16 +113,6 @@ static int ak881x_try_g_mbus_fmt(struct v4l2_subdev *sd,
return 0;
}
-static int ak881x_s_mbus_fmt(struct v4l2_subdev *sd,
- struct v4l2_mbus_framefmt *mf)
-{
- if (mf->field != V4L2_FIELD_INTERLACED ||
- mf->code != MEDIA_BUS_FMT_YUYV8_2X8)
- return -EINVAL;
-
- return ak881x_try_g_mbus_fmt(sd, mf);
-}
-
static int ak881x_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
@@ -212,9 +207,6 @@ static struct v4l2_subdev_core_ops ak881x_subdev_core_ops = {
};
static struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {
- .s_mbus_fmt = ak881x_s_mbus_fmt,
- .g_mbus_fmt = ak881x_try_g_mbus_fmt,
- .try_mbus_fmt = ak881x_try_g_mbus_fmt,
.cropcap = ak881x_cropcap,
.s_std_output = ak881x_s_std_output,
.s_stream = ak881x_s_stream,
@@ -222,6 +214,8 @@ static struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {
static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = {
.enum_mbus_code = ak881x_enum_mbus_code,
+ .set_fmt = ak881x_fill_fmt,
+ .get_fmt = ak881x_fill_fmt,
};
static struct v4l2_subdev_ops ak881x_subdev_ops = {