]> asedeno.scripts.mit.edu Git - linux.git/commit
media: ov6650: Fix stored frame format not in sync with hardware
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Tue, 3 Sep 2019 20:11:43 +0000 (17:11 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 1 Oct 2019 20:30:54 +0000 (17:30 -0300)
commit3143b459de4cdcce67b36827476c966e93c1cf01
treef7be6ed5e6c4fed30ab46d52d8e0eb79e2f6e784
parent5439fa9263cb293e41168bc03711ec18c4f11cba
media: ov6650: Fix stored frame format not in sync with hardware

The driver stores frame format settings supposed to be in line with
hardware state in a device private structure.  Since the driver initial
submission, those settings are updated before they are actually applied
on hardware.  If an error occurs on device update, the stored settings
my not reflect hardware state anymore and consecutive calls to
.get_fmt() may return incorrect information.  That in turn may affect
ability of a bridge device to use correct DMA transfer settings if such
incorrect informmation on active frame format returned by .get_fmt() is
used.

Assuming a failed device update means its state hasn't changed, update
frame format related settings stored in the device private structure
only after they are successfully applied so the stored values always
reflect hardware state as closely as possible.

Fixes: 2f6e2404799a ("[media] SoC Camera: add driver for OV6650 sensor")
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov6650.c