Skip to content

Commit 23c72dd

Browse files
Niklas Söderlundmchehab
authored andcommitted
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>
1 parent 25f9894 commit 23c72dd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/media/i2c/adv7180.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,17 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
749749
return ret;
750750
}
751751

752+
static int adv7180_init_cfg(struct v4l2_subdev *sd,
753+
struct v4l2_subdev_pad_config *cfg)
754+
{
755+
struct v4l2_subdev_format fmt = {
756+
.which = cfg ? V4L2_SUBDEV_FORMAT_TRY
757+
: V4L2_SUBDEV_FORMAT_ACTIVE,
758+
};
759+
760+
return adv7180_set_pad_format(sd, cfg, &fmt);
761+
}
762+
752763
static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
753764
struct v4l2_mbus_config *cfg)
754765
{
@@ -854,6 +865,7 @@ static const struct v4l2_subdev_core_ops adv7180_core_ops = {
854865
};
855866

856867
static const struct v4l2_subdev_pad_ops adv7180_pad_ops = {
868+
.init_cfg = adv7180_init_cfg,
857869
.enum_mbus_code = adv7180_enum_mbus_code,
858870
.set_fmt = adv7180_set_pad_format,
859871
.get_fmt = adv7180_get_pad_format,

0 commit comments

Comments
 (0)