]> asedeno.scripts.mit.edu Git - linux.git/commit
media: ov6650: Fix stored frame interval not in sync with hardware
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Sun, 13 Oct 2019 12:50:45 +0000 (09:50 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 24 Oct 2019 21:38:56 +0000 (18:38 -0300)
commit57822068dd120386b98891cb151dc20107b63ba7
tree3cde4cf0071d1c363c129d2ba0e4921ec0f839be
parentcfc4652dee4a9435197e9859322ceef60a900e4d
media: ov6650: Fix stored frame interval not in sync with hardware

The driver stores a frame interval value supposed to be in line with
hardware state in a device private structure.  Since the driver initial
submission, the respective field of the structure has never been
initialised on device probe.  Moreover, if updated from
.s_frame_interval(), a new value is stored before it is applied on
hardware.  If an error occurs during device update, the stored value
may no longer reflect hardware state and consecutive calls to
.g_frame_interval() may return incorrect information.

Assuming a failed update of the device means its actual state hasn't
changed, update the frame interval field of the device private
structure with a new value only after it is successfully applied on
hardware so it always reflects actual hardware state to the extent
possible.  Also, initialise the field with hardware default frame
interval on device probe.

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