media: atomisp: ov2680: Fix window settings and enable window for all resolutions
authorHans de Goede <hdegoede@redhat.com>
Mon, 2 Jan 2023 21:02:04 +0000 (22:02 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 07:24:33 +0000 (08:24 +0100)
commit1c08b2faa88fbcf813a700120ffe89bc2c8c567c
treec55fb87c1fe12518ae9c8a41955faa9443789886
parent76f39e721e29a0ea7a503da1ed10d4ebefa49e0a
media: atomisp: ov2680: Fix window settings and enable window for all resolutions

By default the ov2680 automatically sets the window to match the outputsize
and automatically adjusts it to keep the bayer pattern stable when enabling
hflip/vflip.

This does not work for the 1616x1216 mode because there is no room to
adjust the window there. To make flipping work in the 1616 wide modes the
register lists for those modes set bit 0 of 0x5708 (manual_win_en) to 1 and
ov2680_set_bayer_order() updates the bayer-order on the pad to match.

But ov2680_set_bayer_order() is always called, so when enabling flipping
on modes with a width of less then 1616 now results in the wrong bayer
order being reported on the pad since the sensor is auto-adjusting
the window in this case.

Specify the correct (== output-size) window-size in all resolutions
register-list and always set the manual_win_en bit, so that the bayer order
is changed on hflip/vflip enable on all resolutions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/i2c/ov2680.h