diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2020-01-15 20:27:19 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-02-24 16:14:49 +0100 |
commit | 23c72dd9ffd22d8a17ec1b432eafa4caf3d8ccb6 (patch) | |
tree | da679dcdf49c1301c58b3f6da63e64da4d6a0fc3 /drivers/media/i2c/adv7180.c | |
parent | media: vidioc-queryctrl.rst: fix error code (diff) | |
download | linux-23c72dd9ffd22d8a17ec1b432eafa4caf3d8ccb6.tar.xz linux-23c72dd9ffd22d8a17ec1b432eafa4caf3d8ccb6.zip |
media: adv7180: Add init_cfg pad operation
Add a init_cfg pad operation so that configurations allocated with
v4l2_subdev_alloc_pad_config() are initialized.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c/adv7180.c')
-rw-r--r-- | drivers/media/i2c/adv7180.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 6528e2343fc8..00159daa6fcd 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -749,6 +749,17 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, return ret; } +static int adv7180_init_cfg(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg) +{ + struct v4l2_subdev_format fmt = { + .which = cfg ? V4L2_SUBDEV_FORMAT_TRY + : V4L2_SUBDEV_FORMAT_ACTIVE, + }; + + return adv7180_set_pad_format(sd, cfg, &fmt); +} + static int adv7180_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { @@ -854,6 +865,7 @@ static const struct v4l2_subdev_core_ops adv7180_core_ops = { }; static const struct v4l2_subdev_pad_ops adv7180_pad_ops = { + .init_cfg = adv7180_init_cfg, .enum_mbus_code = adv7180_enum_mbus_code, .set_fmt = adv7180_set_pad_format, .get_fmt = adv7180_get_pad_format, |