aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Porcedda2013-01-08 04:04:10 -0600
committerWim Van Sebroeck2013-03-01 05:48:36 -0600
commit3048253ed957fc6cdc34599178408559aa1e0062 (patch)
tree2e8fd94c3d64899dc4a48912f7ece62721047c68 /include
parente3e83d0001a77cdb337be9170e58b55488835ba0 (diff)
downloadam43-linux-kernel-3048253ed957fc6cdc34599178408559aa1e0062.tar.gz
am43-linux-kernel-3048253ed957fc6cdc34599178408559aa1e0062.tar.xz
am43-linux-kernel-3048253ed957fc6cdc34599178408559aa1e0062.zip
watchdog: core: dt: add support for the timeout-sec dt property
Add support for watchdog drivers to initialize/set the timeout field of the watchdog_device structure. The timeout field is initialised either with the module timeout parameter value (if valid) or with the timeout-sec dt property (if valid). If both are invalid the initial value is unchanged. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'include')
-rw-r--r--include/linux/watchdog.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 3a9df2f43be..2a3038ee17a 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -118,6 +118,13 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway
118 set_bit(WDOG_NO_WAY_OUT, &wdd->status); 118 set_bit(WDOG_NO_WAY_OUT, &wdd->status);
119} 119}
120 120
121/* Use the following function to check if a timeout value is invalid */
122static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t)
123{
124 return ((wdd->max_timeout != 0) &&
125 (t < wdd->min_timeout || t > wdd->max_timeout));
126}
127
121/* Use the following functions to manipulate watchdog driver specific data */ 128/* Use the following functions to manipulate watchdog driver specific data */
122static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) 129static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
123{ 130{
@@ -130,6 +137,8 @@ static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
130} 137}
131 138
132/* drivers/watchdog/watchdog_core.c */ 139/* drivers/watchdog/watchdog_core.c */
140extern int watchdog_init_timeout(struct watchdog_device *wdd,
141 unsigned int timeout_parm, struct device *dev);
133extern int watchdog_register_device(struct watchdog_device *); 142extern int watchdog_register_device(struct watchdog_device *);
134extern void watchdog_unregister_device(struct watchdog_device *); 143extern void watchdog_unregister_device(struct watchdog_device *);
135 144