media: ov2680: Make setting the mode algorithm based
authorHans de Goede <hdegoede@redhat.com>
Thu, 3 Aug 2023 09:33:36 +0000 (11:33 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 14 Aug 2023 18:27:57 +0000 (20:27 +0200)
commit63f47529bb5c5ede928cf2dd9c69900a6c897b83
tree80ee0cb1c533764329d26979663a6b6ff8625970
parentf614dfb8cd587c923faf576caed5ca1af066a130
media: ov2680: Make setting the mode algorithm based

Instead of using a long fixed register settings list for each resolution,
calculate the register settings based on the requested width + height.

This is based on atomisp-ov2680 commit 0611888592df ("media: atomisp:
ov2680: Make setting the modes algorithm based").

This will allow future enhancements like adding hblank and vblank controls
and adding selection support.

This also adds properly programming the ISP window and setting
the manual ISP window control bit in register 0x5708, this is
necessary for the hflip and vflip conrols to work properly.

Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov2680.c