From 6e80c4738aa12701a5714cb3e4a685f95c1ffe5f Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 21 Mar 2015 09:39:09 -0300 Subject: [media] v4l2: replace s_mbus_fmt by set_fmt The s_mbus_fmt video op is a duplicate of the pad op. Replace all uses in sub-devices by the set_fmt() pad op. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/adv7175.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'drivers/media/i2c/adv7175.c') diff --git a/drivers/media/i2c/adv7175.c b/drivers/media/i2c/adv7175.c index f7443454f682..321834ba8f57 100644 --- a/drivers/media/i2c/adv7175.c +++ b/drivers/media/i2c/adv7175.c @@ -334,11 +334,16 @@ static int adv7175_get_fmt(struct v4l2_subdev *sd, return 0; } -static int adv7175_s_fmt(struct v4l2_subdev *sd, - struct v4l2_mbus_framefmt *mf) +static int adv7175_set_fmt(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_format *format) { + struct v4l2_mbus_framefmt *mf = &format->format; u8 val = adv7175_read(sd, 0x7); - int ret; + int ret = 0; + + if (format->pad) + return -EINVAL; switch (mf->code) { case MEDIA_BUS_FMT_UYVY8_2X8: @@ -355,7 +360,8 @@ static int adv7175_s_fmt(struct v4l2_subdev *sd, return -EINVAL; } - ret = adv7175_write(sd, 0x7, val); + if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) + ret = adv7175_write(sd, 0x7, val); return ret; } @@ -380,12 +386,12 @@ static const struct v4l2_subdev_core_ops adv7175_core_ops = { static const struct v4l2_subdev_video_ops adv7175_video_ops = { .s_std_output = adv7175_s_std_output, .s_routing = adv7175_s_routing, - .s_mbus_fmt = adv7175_s_fmt, }; static const struct v4l2_subdev_pad_ops adv7175_pad_ops = { .enum_mbus_code = adv7175_enum_mbus_code, .get_fmt = adv7175_get_fmt, + .set_fmt = adv7175_set_fmt, }; static const struct v4l2_subdev_ops adv7175_ops = { -- cgit v1.2.3