mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
watchdog: sama5d4: Implement resume hook
When resuming for the deepest state on sama5d2, it is necessary to restore MR as the registers are lost. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
722ce6356d
commit
f201353273
1 changed files with 17 additions and 0 deletions
|
@ -258,11 +258,28 @@ static const struct of_device_id sama5d4_wdt_of_match[] = {
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, sama5d4_wdt_of_match);
|
MODULE_DEVICE_TABLE(of, sama5d4_wdt_of_match);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
static int sama5d4_wdt_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct sama5d4_wdt *wdt = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
wdt_write(wdt, AT91_WDT_MR, wdt->mr & ~AT91_WDT_WDDIS);
|
||||||
|
if (wdt->mr & AT91_WDT_WDDIS)
|
||||||
|
wdt_write(wdt, AT91_WDT_MR, wdt->mr);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(sama5d4_wdt_pm_ops, NULL,
|
||||||
|
sama5d4_wdt_resume);
|
||||||
|
|
||||||
static struct platform_driver sama5d4_wdt_driver = {
|
static struct platform_driver sama5d4_wdt_driver = {
|
||||||
.probe = sama5d4_wdt_probe,
|
.probe = sama5d4_wdt_probe,
|
||||||
.remove = sama5d4_wdt_remove,
|
.remove = sama5d4_wdt_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "sama5d4_wdt",
|
.name = "sama5d4_wdt",
|
||||||
|
.pm = &sama5d4_wdt_pm_ops,
|
||||||
.of_match_table = sama5d4_wdt_of_match,
|
.of_match_table = sama5d4_wdt_of_match,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue