]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: adv7180: Do not write format to device in set_fmt
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thu, 28 Aug 2025 16:06:52 +0000 (18:06 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 4 Sep 2025 08:06:13 +0000 (10:06 +0200)
The .set_fmt callback should not write the new format directly do the
device, it should only store it and have it applied by .s_stream.

The .s_stream callback already calls adv7180_set_field_mode() so it's
safe to remove programming of the device and just store the format and
have .s_stream apply it.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/adv7180.c

index e01cc270d5a44737dc37c89cff662f7598b84ad2..444857c6015d6602bcae40dd2a20ba8fc313a073 100644 (file)
@@ -793,14 +793,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
        ret = adv7180_mbus_fmt(sd,  &format->format);
 
        if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
-               if (state->field != format->format.field) {
-                       guard(mutex)(&state->mutex);
-
-                       state->field = format->format.field;
-                       adv7180_set_power(state, false);
-                       adv7180_set_field_mode(state);
-                       adv7180_set_power(state, true);
-               }
+               state->field = format->format.field;
        } else {
                framefmt = v4l2_subdev_state_get_format(sd_state, 0);
                *framefmt = format->format;