aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-07-18 09:54:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-15 16:04:42 -0400
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)
1086 if (ret < 0) 1086 if (ret < 0)
1087 goto eadd; 1087 goto eadd;
1088 1088
1089 /*
1090 * This will not yet call v4l2_subdev_core_ops::s_power(1), because the
1091 * subdevice has not been initialised yet. We'll have to call it once
1092 * again after initialisation, even though it shouldn't be needed, we
1093 * don't do any IO here.
1094 *
1095 * The device pointer passed to soc_camera_power_on(), and ultimately to
1096 * the platform callback, should be the subdev physical device. However,
1097 * we have no way to retrieve a pointer to that device here. This isn't
1098 * a real issue, as no platform currently uses the device pointer, and
1099 * this soc_camera_power_on() call will be removed in the next commit.
1100 */
1101 ret = soc_camera_power_on(icd->pdev, icl);
1102 if (ret < 0)
1103 goto epower;
1104
1105 /* Must have icd->vdev before registering the device */ 1089 /* Must have icd->vdev before registering the device */
1106 ret = video_dev_create(icd); 1090 ret = video_dev_create(icd);
1107 if (ret < 0) 1091 if (ret < 0)
@@ -1171,8 +1155,6 @@ static int soc_camera_probe(struct soc_camera_device *icd)
1171 1155
1172 ici->ops->remove(icd); 1156 ici->ops->remove(icd);
1173 1157
1174 __soc_camera_power_off(icd);
1175
1176 mutex_unlock(&icd->video_lock); 1158 mutex_unlock(&icd->video_lock);
1177 1159
1178 return 0; 1160 return 0;
@@ -1193,8 +1175,6 @@ eadddev:
1193 video_device_release(icd->vdev); 1175 video_device_release(icd->vdev);
1194 icd->vdev = NULL; 1176 icd->vdev = NULL;
1195evdc: 1177evdc:
1196 __soc_camera_power_off(icd);
1197epower:
1198 ici->ops->remove(icd); 1178 ici->ops->remove(icd);
1199eadd: 1179eadd:
1200 regulator_bulk_free(icl->num_regulators, icl->regulators); 1180 regulator_bulk_free(icl->num_regulators, icl->regulators);