Commit aae67f36 authored by dann frazier's avatar dann frazier Committed by Wim Van Sebroeck

watchdog: hpwdt (8/12): implement WDIOC_GETTIMELEFT

Let applications check the amount of time left before the watchdog will fire.
Signed-off-by: default avatardann frazier <dannf@hp.com>
Acked-by: default avatarThomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 6f681c2e
...@@ -450,6 +450,11 @@ static int hpwdt_change_timer(int new_margin) ...@@ -450,6 +450,11 @@ static int hpwdt_change_timer(int new_margin)
return 0; return 0;
} }
static int hpwdt_time_left(void)
{
return TICKS_TO_SECS(ioread16(hpwdt_timer_reg));
}
/* /*
* NMI Handler * NMI Handler
*/ */
...@@ -591,6 +596,10 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd, ...@@ -591,6 +596,10 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd,
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(soft_margin, p); ret = put_user(soft_margin, p);
break; break;
case WDIOC_GETTIMELEFT:
ret = put_user(hpwdt_time_left(), p);
break;
} }
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment