media: ov2680: Fix exposure and gain ctrls range and default value
authorHans de Goede <hdegoede@redhat.com>
Thu, 3 Aug 2023 09:33:39 +0000 (11:33 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 14 Aug 2023 18:27:57 +0000 (20:27 +0200)
commit05d6bd86dcf7960dfaa163472d9dec1b7295f27b
tree1906908f2e634decf74b2922cdf5b83d29690fda
parent3b378b35e83d8d87bdbe353c7597565595ff2dc9
media: ov2680: Fix exposure and gain ctrls range and default value

The exposure control's max effective value is VTS - 8, set the control
range to match this. Thas means that if/when a future commit makes VTS
configurable as a control itself the exposure range needs to be
updated dynamically to match the VTS value.

The gain control goes from 0 - 1023, higher values wrap around to
the lowest gain setting.

The gain control, controls an analog gain so use V4L2_CID_ANALOGUE_GAIN
for it instead of V4L2_CID_GAIN.

Also stop setting 0 as default for both controls this leads to
a totally black picture which is no good. This is esp. important
for tests of the sensor driver without (userspace driven)
auto exposure / gain.

Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.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