diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-10 14:30:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-10 14:30:45 -0400 |
commit | 06eb4eafbdc0796d741d139a44f1253278da8611 (patch) | |
tree | fbdb44317130c371928154c9e6903e699fe2b995 /drivers/watchdog/imx2_wdt.c | |
parent | 32ed53b83ea5ec26a4dba90e18f5e0ff6c71eb48 (diff) | |
parent | f68e556e23d1a4176b563bcb25d8baf2c5313f91 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/watchdog/imx2_wdt.c')
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index c44c3334003..7a2b734fcdc 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -46,6 +46,9 @@ #define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */ #define IMX2_WDT_SEQ2 0xAAAA /* -> service sequence 2 */ +#define IMX2_WDT_WRSR 0x04 /* Reset Status Register */ +#define IMX2_WDT_WRSR_TOUT (1 << 1) /* -> Reset due to Timeout */ + #define IMX2_WDT_MAX_TIME 128 #define IMX2_WDT_DEFAULT_TIME 60 /* in seconds */ @@ -65,8 +68,8 @@ static struct { static struct miscdevice imx2_wdt_miscdev; -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); @@ -175,6 +178,7 @@ static long imx2_wdt_ioctl(struct file *file, unsigned int cmd, void __user *argp = (void __user *)arg; int __user *p = argp; int new_value; + u16 val; switch (cmd) { case WDIOC_GETSUPPORT: @@ -182,9 +186,13 @@ static long imx2_wdt_ioctl(struct file *file, unsigned int cmd, sizeof(struct watchdog_info)) ? -EFAULT : 0; case WDIOC_GETSTATUS: - case WDIOC_GETBOOTSTATUS: return put_user(0, p); + case WDIOC_GETBOOTSTATUS: + val = __raw_readw(imx2_wdt.base + IMX2_WDT_WRSR); + new_value = val & IMX2_WDT_WRSR_TOUT ? WDIOF_CARDRESET : 0; + return put_user(new_value, p); + case WDIOC_KEEPALIVE: imx2_wdt_ping(); return 0; |