]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 14:16:03 +0000 (08:16 -0600)
commite7e413ac1e13e1592503ea63f133cd96b696613d
treedf5064a4149dd4f32b7b8e45ca7d9950c6dce8b7
parent530e538c6d7d24cc9cff562373467bac4694519d
media: ov6650: Fix stored frame interval not in sync with hardware

BugLink: https://bugs.launchpad.net/bugs/1858428
[ Upstream commit 57822068dd120386b98891cb151dc20107b63ba7 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/media/i2c/ov6650.c