Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Niklas Söderlund and committed by
Mauro Carvalho Chehab
23c72dd9 25f98947

+12
+12
drivers/media/i2c/adv7180.c
··· 749 749 return ret; 750 750 } 751 751 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 + 752 763 static int adv7180_g_mbus_config(struct v4l2_subdev *sd, 753 764 struct v4l2_mbus_config *cfg) 754 765 { ··· 865 854 }; 866 855 867 856 static const struct v4l2_subdev_pad_ops adv7180_pad_ops = { 857 + .init_cfg = adv7180_init_cfg, 868 858 .enum_mbus_code = adv7180_enum_mbus_code, 869 859 .set_fmt = adv7180_set_pad_format, 870 860 .get_fmt = adv7180_get_pad_format,