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)
commit2aae393955d2c923e85ee162f4b7509d09519374
tree4c88d214aadd67605cb0ca911a8c725d65c3a4ee
parent706487807377ae276c3d0f45347b3702d791da12
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