Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296771
b: refs/heads/master
c: 16ac4ab
h: refs/heads/master
i:
  296769: 1b3afbd
  296767: 15b08be
v: v3
  • Loading branch information
Viresh Kumar authored and Wim Van Sebroeck committed Mar 27, 2012
1 parent 24c1713 commit 6eb5144
Show file tree
Hide file tree
Showing 2 changed files with 34 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: 474ef121008a2992bcc496930166ced89bda23d2
refs/heads/master: 16ac4abe0d0ea0a8d42d6a2a7de2a4a00bbf5b40
33 changes: 33 additions & 0 deletions trunk/drivers/watchdog/sp805_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
Expand Down Expand Up @@ -351,6 +352,37 @@ static int __devexit sp805_wdt_remove(struct amba_device *adev)
return 0;
}

#ifdef CONFIG_PM
static int sp805_wdt_suspend(struct device *dev)
{
if (test_bit(WDT_BUSY, &wdt->status)) {
wdt_disable();
clk_disable(wdt->clk);
}

return 0;
}

static int sp805_wdt_resume(struct device *dev)
{
int ret = 0;

if (test_bit(WDT_BUSY, &wdt->status)) {
ret = clk_enable(wdt->clk);
if (ret) {
dev_err(dev, "clock enable fail");
return ret;
}
wdt_enable();
}

return ret;
}
#endif /* CONFIG_PM */

static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend,
sp805_wdt_resume);

static struct amba_id sp805_wdt_ids[] = {
{
.id = 0x00141805,
Expand All @@ -364,6 +396,7 @@ MODULE_DEVICE_TABLE(amba, sp805_wdt_ids);
static struct amba_driver sp805_wdt_driver = {
.drv = {
.name = MODULE_NAME,
.pm = &sp805_wdt_dev_pm_ops,
},
.id_table = sp805_wdt_ids,
.probe = sp805_wdt_probe,
Expand Down

0 comments on commit 6eb5144

Please sign in to comment.