summaryrefslogtreecommitdiff
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-07-18 10:54:04 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-15 17:04:42 -0300
commit4bbc6d52e61a8a9c19fcc859c4acab89cb8cd4e5 (patch)
tree64ce43072ed8fa87bd8f5bc4d8fe5794a0373aef /drivers/media/platform
parent4ec10bacd6bf08de39ebdba9e75060452cc313e0 (diff)
[media] soc-camera: Push probe-time power management to drivers
Several client drivers access the hardware at probe time, for instance to read the probe chip ID. Such chips need to be powered up when being probed. soc-camera handles this by powering chips up in the soc-camera probe implementation. However, this will break with non soc-camera hosts that don't perform the same operations. Fix the problem by pushing the power up/down from the soc-camera core down to individual drivers on a needs basis. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/soc_camera.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/drivers/media/platform/soc_camera.c b/drivers/media/platform/soc_camera.c
index 8e1548e16f54..f94055505d70 100644
--- a/drivers/media/platform/soc_camera.c
+++ b/drivers/media/platform/soc_camera.c
@@ -1086,22 +1086,6 @@ static int soc_camera_probe(struct soc_camera_device *icd)
if (ret < 0)
goto eadd;
- /*
- * This will not yet call v4l2_subdev_core_ops::s_power(1), because the
- * subdevice has not been initialised yet. We'll have to call it once
- * again after initialisation, even though it shouldn't be needed, we
- * don't do any IO here.
- *
- * The device pointer passed to soc_camera_power_on(), and ultimately to
- * the platform callback, should be the subdev physical device. However,
- * we have no way to retrieve a pointer to that device here. This isn't
- * a real issue, as no platform currently uses the device pointer, and
- * this soc_camera_power_on() call will be removed in the next commit.
- */
- ret = soc_camera_power_on(icd->pdev, icl);
- if (ret < 0)
- goto epower;
-
/* Must have icd->vdev before registering the device */
ret = video_dev_create(icd);
if (ret < 0)
@@ -1171,8 +1155,6 @@ static int soc_camera_probe(struct soc_camera_device *icd)
ici->ops->remove(icd);
- __soc_camera_power_off(icd);
-
mutex_unlock(&icd->video_lock);
return 0;
@@ -1193,8 +1175,6 @@ eadddev:
video_device_release(icd->vdev);
icd->vdev = NULL;
evdc:
- __soc_camera_power_off(icd);
-epower:
ici->ops->remove(icd);
eadd:
regulator_bulk_free(icl->num_regulators, icl->regulators);