]> git.baikalelectronics.ru Git - kernel.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)
commit54a411bbcca55b90ee06f8e7f4e93b9d7551b277
treef7be6ed5e6c4fed30ab46d52d8e0eb79e2f6e784
parent1118d1335a3af006ad5c555f8309cba4127cd2b5
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: 0fe768636fbb ("[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