summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2008-08-02 01:14:50 +0200
committerRobert Jarzmik <robert.jarzmik@free.fr>2008-08-02 01:14:50 +0200
commit65041def75fa0ce51a0df92d47ce90e8789b55ac (patch)
tree41bbe95ea19cfd0c7cac63975c065cbe6595091d /linux/drivers
parentef1a5a79cd8e82b51422ca66992bbd483a8ebe5b (diff)
downloadmediapointer-dvb-s2-65041def75fa0ce51a0df92d47ce90e8789b55ac.tar.gz
mediapointer-dvb-s2-65041def75fa0ce51a0df92d47ce90e8789b55ac.tar.bz2
Add suspend/resume capabilities to soc_camera.
Add suspend/resume hooks to call soc operation specific suspend and resume functions. This ensures the camera chip has been previously resumed, as well as the camera bus. These hooks in camera chip drivers should save/restore chip context between suspend and resume time. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> --- drivers/media/video/soc_camera.c | 26 ++++++++++++++++++++++++++ include/media/soc_camera.h | 5 +++++ 2 files changed, 31 insertions(+), 0 deletions(-)
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/soc_camera.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/linux/drivers/media/video/soc_camera.c b/linux/drivers/media/video/soc_camera.c
index b6be5ee67..66ebe5956 100644
--- a/linux/drivers/media/video/soc_camera.c
+++ b/linux/drivers/media/video/soc_camera.c
@@ -732,10 +732,36 @@ static int soc_camera_remove(struct device *dev)
return 0;
}
+static int soc_camera_suspend(struct device *dev, pm_message_t state)
+{
+ struct soc_camera_device *icd = to_soc_camera_dev(dev);
+ struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
+ int ret = 0;
+
+ if (ici->ops->suspend)
+ ret = ici->ops->suspend(icd, state);
+
+ return ret;
+}
+
+static int soc_camera_resume(struct device *dev)
+{
+ struct soc_camera_device *icd = to_soc_camera_dev(dev);
+ struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
+ int ret = 0;
+
+ if (ici->ops->resume)
+ ret = ici->ops->resume(icd);
+
+ return ret;
+}
+
static struct bus_type soc_camera_bus_type = {
.name = "soc-camera",
.probe = soc_camera_probe,
.remove = soc_camera_remove,
+ .suspend = soc_camera_suspend,
+ .resume = soc_camera_resume,
};
static struct device_driver ic_drv = {