Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320617
b: refs/heads/master
c: 3d5946d
h: refs/heads/master
i:
  320615: a1cd1fc
v: v3
  • Loading branch information
Manjunath Hadli authored and Mauro Carvalho Chehab committed Jul 30, 2012
1 parent 4af7436 commit bb579ec
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9530dac31c0c0296242e9209c89f5a580a2d64b
refs/heads/master: 3d5946dcfd4d221126f3f190c5ca4ea41c20f138
73 changes: 61 additions & 12 deletions trunk/drivers/media/video/davinci/vpif_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -2312,38 +2312,87 @@ static int vpif_remove(struct platform_device *device)
return 0;
}

#ifdef CONFIG_PM
/**
* vpif_suspend: vpif device suspend
*
* TODO: Add suspend code here
*/
static int
vpif_suspend(struct device *dev)
static int vpif_suspend(struct device *dev)
{
return -1;

struct common_obj *common;
struct channel_obj *ch;
int i;

for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
/* Get the pointer to the channel object */
ch = vpif_obj.dev[i];
common = &ch->common[VPIF_VIDEO_INDEX];
mutex_lock(&common->lock);
if (ch->usrs && common->io_usrs) {
/* Disable channel */
if (ch->channel_id == VPIF_CHANNEL0_VIDEO) {
enable_channel0(0);
channel0_intr_enable(0);
}
if (ch->channel_id == VPIF_CHANNEL1_VIDEO ||
common->started == 2) {
enable_channel1(0);
channel1_intr_enable(0);
}
}
mutex_unlock(&common->lock);
}

return 0;
}

/**
/*
* vpif_resume: vpif device suspend
*
* TODO: Add resume code here
*/
static int
vpif_resume(struct device *dev)
static int vpif_resume(struct device *dev)
{
return -1;
struct common_obj *common;
struct channel_obj *ch;
int i;

for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
/* Get the pointer to the channel object */
ch = vpif_obj.dev[i];
common = &ch->common[VPIF_VIDEO_INDEX];
mutex_lock(&common->lock);
if (ch->usrs && common->io_usrs) {
/* Disable channel */
if (ch->channel_id == VPIF_CHANNEL0_VIDEO) {
enable_channel0(1);
channel0_intr_enable(1);
}
if (ch->channel_id == VPIF_CHANNEL1_VIDEO ||
common->started == 2) {
enable_channel1(1);
channel1_intr_enable(1);
}
}
mutex_unlock(&common->lock);
}

return 0;
}

static const struct dev_pm_ops vpif_dev_pm_ops = {
.suspend = vpif_suspend,
.resume = vpif_resume,
};

#define vpif_pm_ops (&vpif_dev_pm_ops)
#else
#define vpif_pm_ops NULL
#endif

static __refdata struct platform_driver vpif_driver = {
.driver = {
.name = "vpif_capture",
.owner = THIS_MODULE,
.pm = &vpif_dev_pm_ops,
.pm = vpif_pm_ops,
},
.probe = vpif_probe,
.remove = vpif_remove,
Expand Down

0 comments on commit bb579ec

Please sign in to comment.