From dc12a27cd1c954e9a5ac9c0e0fdcbf6e1fa554ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20S=C3=B6derlund?= Date: Thu, 28 Aug 2025 18:06:48 +0200 Subject: [PATCH] media: adv7180: Setup controls every time the device is reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The device initialization code resets the whole device, thus the initial controls set at probe are lost as adv7180_init_controls() are called before init_device(). Additionally the controls were never restored after the device where reset coming back from suspend. Solve this by separate the setup of the controls from the creation of them, and always set them up when the device is reset. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil --- drivers/media/i2c/adv7180.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 7b0387151c3a6..8409ee9acc4f7 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -700,7 +700,6 @@ static int adv7180_init_controls(struct adv7180_state *state) v4l2_ctrl_handler_free(&state->ctrl_hdl); return err; } - v4l2_ctrl_handler_setup(&state->ctrl_hdl); return 0; } @@ -898,6 +897,8 @@ static int init_device(struct adv7180_state *state) adv7180_set_field_mode(state); + __v4l2_ctrl_handler_setup(&state->ctrl_hdl); + /* register for interrupts */ if (state->irq > 0) { /* config the Interrupt pin to be active low */ -- 2.47.3