Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282211
b: refs/heads/master
c: ff0b3cd
h: refs/heads/master
i:
  282209: d9610bf
  282207: f5b0381
v: v3
  • Loading branch information
Wim Van Sebroeck committed Jan 6, 2012
1 parent 473c5b8 commit 9f117dd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8ec61189f3b4cd9d1b2856342f5d7676151d01c
refs/heads/master: ff0b3cd4a416bc727b0797b95b229b278d2a28f2
10 changes: 9 additions & 1 deletion trunk/Documentation/watchdog/watchdog-kernel-api.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The Linux WatchDog Timer Driver Core kernel API.
===============================================
Last reviewed: 22-Jul-2011
Last reviewed: 29-Nov-2011

Wim Van Sebroeck <wim@iguana.be>

Expand Down Expand Up @@ -142,6 +142,14 @@ bit-operations. The status bits that are defined are:
* WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog.
If this bit is set then the watchdog timer will not be able to stop.

To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog
timer device) you can either:
* set it statically in your watchdog_device struct with
.status = WATCHDOG_NOWAYOUT_INIT_STATUS,
(this will set the value the same as CONFIG_WATCHDOG_NOWAYOUT) or
* use the following helper function:
static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)

Note: The WatchDog Timer Driver Core supports the magic close feature and
the nowayout feature. To use the magic close feature you must set the
WDIOF_MAGICCLOSE bit in the options field of the watchdog's info structure.
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/watchdog/s3c2410_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
"cannot start\n");
}

watchdog_set_nowayout(&s3c2410_wdd, nowayout);

ret = watchdog_register_device(&s3c2410_wdd);
if (ret) {
dev_err(dev, "cannot register watchdog (%d)\n", ret);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/watchdog/wm831x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,9 @@ static int __devinit wm831x_wdt_probe(struct platform_device *pdev)

wm831x_wdt->info = &wm831x_wdt_info;
wm831x_wdt->ops = &wm831x_wdt_ops;
watchdog_set_nowayout(wm831x_wdt, nowayout);
watchdog_set_drvdata(wm831x_wdt, driver_data);

if (nowayout)
wm831x_wdt->status |= WDOG_NO_WAY_OUT;

reg = wm831x_reg_read(wm831x, WM831X_WATCHDOG);
reg &= WM831X_WDOG_TO_MASK;
for (i = 0; i < ARRAY_SIZE(wm831x_wdt_cfgs); i++)
Expand Down
21 changes: 16 additions & 5 deletions trunk/include/linux/watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ struct watchdog_info {

#ifdef __KERNEL__

#ifdef CONFIG_WATCHDOG_NOWAYOUT
#define WATCHDOG_NOWAYOUT 1
#else
#define WATCHDOG_NOWAYOUT 0
#endif
#include <linux/bitops.h>

struct watchdog_ops;
struct watchdog_device;
Expand Down Expand Up @@ -122,6 +118,21 @@ struct watchdog_device {
#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
};

#ifdef CONFIG_WATCHDOG_NOWAYOUT
#define WATCHDOG_NOWAYOUT 1
#define WATCHDOG_NOWAYOUT_INIT_STATUS (1 << WDOG_NO_WAY_OUT)
#else
#define WATCHDOG_NOWAYOUT 0
#define WATCHDOG_NOWAYOUT_INIT_STATUS 0
#endif

/* Use the following function to set the nowayout feature */
static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
{
if (nowayout)
set_bit(WDOG_NO_WAY_OUT, &wdd->status);
}

/* Use the following functions to manipulate watchdog driver specific data */
static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
{
Expand Down

0 comments on commit 9f117dd

Please sign in to comment.