]> git.baikalelectronics.ru Git - kernel.git/commit
media: ov2640: make set_fmt() work in power-down mode
authorAkinobu Mita <akinobu.mita@gmail.com>
Sat, 10 Feb 2018 15:28:37 +0000 (10:28 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 17 May 2018 10:22:08 +0000 (06:22 -0400)
commitdda9c638430f87b72a6ee4fdf1234c620172243c
tree4c88d214aadd67605cb0ca911a8c725d65c3a4ee
parent78af31220edf5f682f6e6544c645ebf0a8a3de63
media: ov2640: make set_fmt() work in power-down mode

The set_fmt() subdev pad operation for this driver currently does not
only do the driver internal format selection but also do the actual
register setup.

This doesn't work if the device power control via GPIO lines is enabled.
Because the set_fmt() can be called when the device is placed into power
down mode.

First of all, this fix adds flag to keep track of whether the device starts
streaming or not.  Then, the set_fmt() postpones applying the actual
register setup at this time.  Instead the setup will be applied when the
streaming is started.

Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@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/ov2640.c