aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/watchdog.h
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2011-11-29 10:24:16 -0500
committerWim Van Sebroeck <wim@iguana.be>2012-01-06 09:22:04 -0500
commitff0b3cd4a416bc727b0797b95b229b278d2a28f2 (patch)
treecd6bdc2304ee8fd751f3bd79607c7bcaf337e198 /include/linux/watchdog.h
parentb8ec61189f3b4cd9d1b2856342f5d7676151d01c (diff)
watchdog: add nowayout helpers to Watchdog Timer Driver Kernel API
Add two nowayout helpers for the Watchdog Timer Driver Kernel API. And apply this to the already converted drivers. Note: s3c2410_wdt lost the nowayout feature during the conversion. Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'include/linux/watchdog.h')
-rw-r--r--include/linux/watchdog.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 111843f88b2a..43ba5b3ce2a3 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -53,11 +53,7 @@ struct watchdog_info {
53 53
54#ifdef __KERNEL__ 54#ifdef __KERNEL__
55 55
56#ifdef CONFIG_WATCHDOG_NOWAYOUT 56#include <linux/bitops.h>
57#define WATCHDOG_NOWAYOUT 1
58#else
59#define WATCHDOG_NOWAYOUT 0
60#endif
61 57
62struct watchdog_ops; 58struct watchdog_ops;
63struct watchdog_device; 59struct watchdog_device;
@@ -122,6 +118,21 @@ struct watchdog_device {
122#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */ 118#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
123}; 119};
124 120
121#ifdef CONFIG_WATCHDOG_NOWAYOUT
122#define WATCHDOG_NOWAYOUT 1
123#define WATCHDOG_NOWAYOUT_INIT_STATUS (1 << WDOG_NO_WAY_OUT)
124#else
125#define WATCHDOG_NOWAYOUT 0
126#define WATCHDOG_NOWAYOUT_INIT_STATUS 0
127#endif
128
129/* Use the following function to set the nowayout feature */
130static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
131{
132 if (nowayout)
133 set_bit(WDOG_NO_WAY_OUT, &wdd->status);
134}
135
125/* Use the following functions to manipulate watchdog driver specific data */ 136/* Use the following functions to manipulate watchdog driver specific data */
126static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) 137static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
127{ 138{