media: allegro: use handler_setup to configure channel
authorMichael Tretter <m.tretter@pengutronix.de>
Thu, 3 Dec 2020 11:00:56 +0000 (12:00 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 27 Jan 2021 15:06:39 +0000 (16:06 +0100)
v4l2_ctrl_handler_setup() calls s_ctrl for all controls of the handler.
This ensures that the channel is initialized using the default values of
the v4l2-ctrls.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/allegro-dvt/allegro-core.c

index d7b1cc2b9e6eb079fc6d97a0c83cd19e20d58fa1..a9a9e9bb04015b7cf8c00e7c04cebe3178ad7ca4 100644 (file)
@@ -2520,6 +2520,8 @@ static int allegro_open(struct file *file)
 
        v4l2_ctrl_cluster(3, &channel->mpeg_video_bitrate_mode);
 
+       v4l2_ctrl_handler_setup(handler);
+
        channel->mcu_channel_id = -1;
        channel->user_id = -1;