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

media: adv7180: Do not write format to device in set_fmt

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>

authored by

Niklas Söderlund and committed by
Hans Verkuil
46c1e781 a67e0eed

+1 -8
+1 -8
drivers/media/i2c/adv7180.c
··· 793 793 ret = adv7180_mbus_fmt(sd, &format->format); 794 794 795 795 if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) { 796 - if (state->field != format->format.field) { 797 - guard(mutex)(&state->mutex); 798 - 799 - state->field = format->format.field; 800 - adv7180_set_power(state, false); 801 - adv7180_set_field_mode(state); 802 - adv7180_set_power(state, true); 803 - } 796 + state->field = format->format.field; 804 797 } else { 805 798 framefmt = v4l2_subdev_state_get_format(sd_state, 0); 806 799 *framefmt = format->format;