]> asedeno.scripts.mit.edu Git - linux.git/commit
media: ov772x: handle nested s_power() calls
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 6 May 2018 14:19:24 +0000 (10:19 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 28 Jun 2018 13:06:39 +0000 (09:06 -0400)
commit34af7d920b766ffa582231ff3ce526d0c6179cd0
tree1ae600c67fc9b78cf481d16b76411f2836cf1760
parentc2cae8951772aff8355171882fcc8e4eb9f53840
media: ov772x: handle nested s_power() calls

Depending on the v4l2 driver, calling s_power() could be nested.  So the
actual transitions between power saving mode and normal operation mode
should only happen at the first power on and the last power off.

This adds an s_power() nesting counter and updates the power state if the
counter is modified from 0 to != 0 or from != 0 to 0.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
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/ov772x.c