media: atomisp: ov2680: Stop using half pixelclock for binned modes

Stop using half pixelclock for binned modes this fixes:
1. The exposure being twice as high for binned mods (due to the half clk)
2. The framerate being 15 fps instead of 30 fps

The original code with fixed per mode register lists did use half pixel
clk, but this should be combined with using half for the VTS value too.

Using half VTS fixes the framerate issue, but this has the undesired
side-effect of change the exposure ctrl range (half the range, double
the amount of exposure per step).

Link: https://lore.kernel.org/r/20230604161406.69369-3-hdegoede@redhat.com

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Hans de Goede 2023-06-04 17:14:03 +01:00 committed by Mauro Carvalho Chehab
parent ef0feca22e
commit 7d45a43225
2 changed files with 2 additions and 7 deletions

View File

@ -244,27 +244,21 @@ static void ov2680_calc_mode(struct ov2680_dev *sensor)
static int ov2680_set_mode(struct ov2680_dev *sensor)
{
struct i2c_client *client = sensor->client;
u8 pll_div, unknown, inc, fmt1, fmt2;
u8 unknown, inc, fmt1, fmt2;
int ret;
if (sensor->mode.binning) {
pll_div = 1;
unknown = 0x23;
inc = 0x31;
fmt1 = 0xc2;
fmt2 = 0x01;
} else {
pll_div = 0;
unknown = 0x21;
inc = 0x11;
fmt1 = 0xc0;
fmt2 = 0x00;
}
ret = ov_write_reg8(client, 0x3086, pll_div);
if (ret)
return ret;
ret = ov_write_reg8(client, 0x370a, unknown);
if (ret)
return ret;

View File

@ -181,6 +181,7 @@ static struct ov2680_reg const ov2680_global_setting[] = {
{0x3082, 0x45},
{0x3084, 0x09},
{0x3085, 0x04},
{0x3086, 0x00},
{0x3503, 0x03},
{0x350b, 0x36},
{0x3600, 0xb4},