提交 aae67f36 编写于 作者: D dann frazier 提交者: 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: Ndann frazier <dannf@hp.com>
Acked-by: NThomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 6f681c2e
......@@ -450,6 +450,11 @@ static int hpwdt_change_timer(int new_margin)
return 0;
}
static int hpwdt_time_left(void)
{
return TICKS_TO_SECS(ioread16(hpwdt_timer_reg));
}
/*
* NMI Handler
*/
......@@ -591,6 +596,10 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd,
case WDIOC_GETTIMEOUT:
ret = put_user(soft_margin, p);
break;
case WDIOC_GETTIMELEFT:
ret = put_user(hpwdt_time_left(), p);
break;
}
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册