Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107903
b: refs/heads/master
c: 2e52106
h: refs/heads/master
i:
  107901: eeb0651
  107899: d88ccda
  107895: 1749247
  107887: 20442c9
  107871: d40bced
  107839: 2f468aa
  107775: b9fe7c2
v: v3
  • Loading branch information
Robert Jarzmik authored and Mauro Carvalho Chehab committed Aug 6, 2008
1 parent 5310254 commit 876f998
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01c1e4ca8ec39d21be0cd9d1b300d479de97298a
refs/heads/master: 2e521061db61a35dd64ea85a1642f9a9dfde2872
26 changes: 26 additions & 0 deletions trunk/drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/media/soc_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <linux/videodev2.h>
#include <media/videobuf-core.h>
#include <linux/pm.h>

struct soc_camera_device {
struct list_head list;
Expand Down Expand Up @@ -63,6 +64,8 @@ struct soc_camera_host_ops {
struct module *owner;
int (*add)(struct soc_camera_device *);
void (*remove)(struct soc_camera_device *);
int (*suspend)(struct soc_camera_device *, pm_message_t state);
int (*resume)(struct soc_camera_device *);
int (*set_fmt_cap)(struct soc_camera_device *, __u32,
struct v4l2_rect *);
int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
Expand Down Expand Up @@ -111,6 +114,8 @@ struct soc_camera_ops {
struct module *owner;
int (*probe)(struct soc_camera_device *);
void (*remove)(struct soc_camera_device *);
int (*suspend)(struct soc_camera_device *, pm_message_t state);
int (*resume)(struct soc_camera_device *);
int (*init)(struct soc_camera_device *);
int (*release)(struct soc_camera_device *);
int (*start_capture)(struct soc_camera_device *);
Expand Down

0 comments on commit 876f998

Please sign in to comment.