summaryrefslogtreecommitdiff
path: root/drivers/watchdog/omap_wdt.h
diff options
context:
space:
mode:
authorLars Poeschel <poeschel@lemonage.de>2015-06-17 10:58:59 +0200
committerWim Van Sebroeck <wim@iguana.be>2015-06-22 15:54:35 +0200
commit452fafed839eb008a8ed9072d63449cb76de617e (patch)
tree7960b3c8f0132c4b6f784f23b8c3ca87586062a2 /drivers/watchdog/omap_wdt.h
parent7a7cb009dcbae5588d8836cd7b4f7255db2e489b (diff)
watchdog: omap_wdt: implement get_timeleft
The omap watchdog hardware is able to read the watchdog timer counter register. This implements this functionality in the omap_wdt driver, so one is can read the time until the watchdog will trigger the reset in seconds using WDIOC_GETTIMELEFT. Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/omap_wdt.h')
-rw-r--r--drivers/watchdog/omap_wdt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/watchdog/omap_wdt.h b/drivers/watchdog/omap_wdt.h
index 09b774cf75b9..42f31ec5e90d 100644
--- a/drivers/watchdog/omap_wdt.h
+++ b/drivers/watchdog/omap_wdt.h
@@ -50,5 +50,6 @@
#define PTV 0 /* prescale */
#define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
+#define GET_WCCR_SECS(val) ((0xffffffff - (val) + 1) / (32768/(1<<PTV)))
#endif /* _OMAP_WATCHDOG_H */