aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bcm47xx_wdt.h9
-rw-r--r--include/linux/stmp3xxx_rtc_wdt.h15
-rw-r--r--include/linux/watchdog.h9
3 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h
index e5dfc256485b..b708786d4cbf 100644
--- a/include/linux/bcm47xx_wdt.h
+++ b/include/linux/bcm47xx_wdt.h
@@ -1,7 +1,10 @@
1#ifndef LINUX_BCM47XX_WDT_H_ 1#ifndef LINUX_BCM47XX_WDT_H_
2#define LINUX_BCM47XX_WDT_H_ 2#define LINUX_BCM47XX_WDT_H_
3 3
4#include <linux/notifier.h>
5#include <linux/timer.h>
4#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/watchdog.h>
5 8
6 9
7struct bcm47xx_wdt { 10struct bcm47xx_wdt {
@@ -10,6 +13,12 @@ struct bcm47xx_wdt {
10 u32 max_timer_ms; 13 u32 max_timer_ms;
11 14
12 void *driver_data; 15 void *driver_data;
16
17 struct watchdog_device wdd;
18 struct notifier_block notifier;
19
20 struct timer_list soft_timer;
21 atomic_t soft_ticks;
13}; 22};
14 23
15static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt) 24static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt)
diff --git a/include/linux/stmp3xxx_rtc_wdt.h b/include/linux/stmp3xxx_rtc_wdt.h
new file mode 100644
index 000000000000..1dd12c96231b
--- /dev/null
+++ b/include/linux/stmp3xxx_rtc_wdt.h
@@ -0,0 +1,15 @@
1/*
2 * stmp3xxx_rtc_wdt.h
3 *
4 * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
5 *
6 * This file is released under the GPLv2.
7 */
8#ifndef __LINUX_STMP3XXX_RTC_WDT_H
9#define __LINUX_STMP3XXX_RTC_WDT_H
10
11struct stmp3xxx_wdt_pdata {
12 void (*wdt_set_timeout)(struct device *dev, u32 timeout);
13};
14
15#endif /* __LINUX_STMP3XXX_RTC_WDT_H */
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 3a9df2f43be6..2a3038ee17a3 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