Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296770
b: refs/heads/master
c: 474ef12
h: refs/heads/master
v: v3
  • Loading branch information
Oskar Schirmer authored and Wim Van Sebroeck committed Mar 27, 2012
1 parent 1b3afbd commit 24c1713
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 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: 5ba927e8ca3f73acb98f417d126652e26ab40a57
refs/heads/master: 474ef121008a2992bcc496930166ced89bda23d2
10 changes: 9 additions & 1 deletion trunk/drivers/watchdog/imx2_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -175,16 +178,21 @@ 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:
return copy_to_user(argp, &imx2_wdt_info,
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;
Expand Down

0 comments on commit 24c1713

Please sign in to comment.