OSDN Git Service

media: ov5640: Fix timings setup code
authorJacopo Mondi <jacopo@jmondi.org>
Wed, 18 Jul 2018 10:06:23 +0000 (06:06 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 17 Sep 2018 19:23:59 +0000 (15:23 -0400)
commitbad1774ed41e98a43074e50e7d5ac9e1e848d99a
tree067d5bf28e664a192061ab804637b53859641f8e
parentaa4bb8b8838ffcc776a79f49a4d7476b82405349
media: ov5640: Fix timings setup code

As of: commit 476dec012f4c ("media: ov5640: Add horizontal and vertical
totals") the timings parameters gets programmed separately from the
static register values array.

When changing capture mode, the vertical and horizontal totals gets
inspected by the set_mode_exposure_calc() functions, and only later
programmed with the new values. This means exposure, light banding
filter and shutter gain are calculated using the previous timings, and
are thus not correct.

Fix this by programming timings right after the static register value
table has been sent to the sensor in the ov5640_load_regs() function.

Fixes: 476dec012f4c ("media: ov5640: Add horizontal and vertical totals")

Tested-by: Steve Longerbeam <slongerbeam@gmail.com> # i.MX6q SabreSD, CSI-2
Tested-by: Loic Poulain <loic.poulain@linaro.org> # Dragonboard-410c, CSI-2
Signed-off-by: Samuel Bobrowicz <sam@elite-embedded.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov5640.c