Only the first pad was configured, but there are 4. This causes
set_fmt to fail with -EINVAL since the passed pad is > 0.
Configure all three sink pads and the source pad.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
struct adv7842_state {
struct adv7842_platform_data pdata;
struct v4l2_subdev sd;
struct adv7842_state {
struct adv7842_platform_data pdata;
struct v4l2_subdev sd;
+ struct media_pad pads[ADV7842_PAD_SOURCE + 1];
struct v4l2_ctrl_handler hdl;
enum adv7842_mode mode;
struct v4l2_dv_timings timings;
struct v4l2_ctrl_handler hdl;
enum adv7842_mode mode;
struct v4l2_dv_timings timings;
struct v4l2_ctrl_handler *hdl;
struct v4l2_ctrl *ctrl;
struct v4l2_subdev *sd;
struct v4l2_ctrl_handler *hdl;
struct v4l2_ctrl *ctrl;
struct v4l2_subdev *sd;
adv7842_delayed_work_enable_hotplug);
sd->entity.function = MEDIA_ENT_F_DV_DECODER;
adv7842_delayed_work_enable_hotplug);
sd->entity.function = MEDIA_ENT_F_DV_DECODER;
- state->pad.flags = MEDIA_PAD_FL_SOURCE;
- err = media_entity_pads_init(&sd->entity, 1, &state->pad);
+ for (i = 0; i < ADV7842_PAD_SOURCE; ++i)
+ state->pads[i].flags = MEDIA_PAD_FL_SINK;
+ state->pads[ADV7842_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
+ err = media_entity_pads_init(&sd->entity, ADV7842_PAD_SOURCE + 1,
+ state->pads);
if (err)
goto err_work_queues;
if (err)
goto err_work_queues;