Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1738981 > unrolled thread
| Started by | "winton.liu" <18502523564@163.com> |
|---|---|
| First post | 2017-09-25 14:20 +0200 |
| Last post | 2017-09-25 14:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH] rtc: ds1374: wdt:support suspend/resume for watchdog "winton.liu" <18502523564@163.com> - 2017-09-25 14:20 +0200
| From | "winton.liu" <18502523564@163.com> |
|---|---|
| Date | 2017-09-25 14:20 +0200 |
| Subject | [PATCH] rtc: ds1374: wdt:support suspend/resume for watchdog |
| Message-ID | <utAn0-6aZ-21@gated-at.bofh.it> |
When enable CONFIG_RTC_DRV_DS1374_WDT use as watchdog,
in suspend mode, watchdog is still working but no daemon
patting the watchdog. The system will reboot if timeout.
So disable watchdog in suspend and recover it in resume.
Signed-off-by: winton.liu <18502523564@163.com>
---
drivers/rtc/rtc-ds1374.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 38a2e9e..e990773 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -690,6 +690,10 @@ static int ds1374_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
+#ifdef CONFIG_RTC_DRV_DS1374_WDT
+ ds1374_wdt_disable();
+#endif
+
if (client->irq > 0 && device_may_wakeup(&client->dev))
enable_irq_wake(client->irq);
return 0;
@@ -699,6 +703,10 @@ static int ds1374_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
+#ifdef CONFIG_RTC_DRV_DS1374_WDT
+ ds1374_wdt_settimeout(131072);
+#endif
+
if (client->irq > 0 && device_may_wakeup(&client->dev))
disable_irq_wake(client->irq);
return 0;
--
1.9.1
Back to top | Article view | linux.kernel
csiph-web