[media] V4L2: soc-camera: work around unbalanced calls to .s_power()
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Mon, 21 Oct 2013 09:28:02 +0000 (06:28 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 31 Oct 2013 06:38:40 +0000 (04:38 -0200)
commit40f075330adfa497cc2894f9c6a32bb99c5cd5b8
tree61755f3cb66f0c8133711141d8db989ae89c850b
parentfc5d0f8a8878319f6cb87045fd704360b2bb4e52
[media] V4L2: soc-camera: work around unbalanced calls to .s_power()

Some non soc-camera drivers, e.g. em28xx, use subdevice drivers, originally
written for soc-camera, which use soc_camera_power_on() and
soc_camera_power_off() helpers to implement their .s_power() methods. Those
helpers in turn can enable and disable a clock, if it is supplied to them
as a parameter. This works well when camera host drivers balance their
calls to subdevices' .s_power() methods. However, some such drivers fail to
do that, which leads to unbalanced calls to v4l2_clk_enable() /
v4l2_clk_disable(), which then in turn produce kernel warnings. Such
behaviour is wrong and should be fixed, however, sometimes it is difficult,
because some of those drivers are rather old and use lots of subdevices,
which all should be tested after such a fix. To support such drivers this
patch adds a work-around, allowing host drivers or platforms to set a flag,
in which case soc-camera helpers will only enable the clock, if it is
disabled, and disable it only once on the first call to .s_power(0).

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/soc_camera/soc_camera.c
include/media/soc_camera.h
This page took 0.027435 seconds and 5 git commands to generate.