diff options
Diffstat (limited to 'drivers/watchdog/hpwdt.c')
-rw-r--r-- | drivers/watchdog/hpwdt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 00299919df39..554526cf3233 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -450,6 +450,11 @@ static int hpwdt_change_timer(int new_margin) | |||
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | 452 | ||
453 | static int hpwdt_time_left(void) | ||
454 | { | ||
455 | return TICKS_TO_SECS(ioread16(hpwdt_timer_reg)); | ||
456 | } | ||
457 | |||
453 | /* | 458 | /* |
454 | * NMI Handler | 459 | * NMI Handler |
455 | */ | 460 | */ |
@@ -591,6 +596,10 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd, | |||
591 | case WDIOC_GETTIMEOUT: | 596 | case WDIOC_GETTIMEOUT: |
592 | ret = put_user(soft_margin, p); | 597 | ret = put_user(soft_margin, p); |
593 | break; | 598 | break; |
599 | |||
600 | case WDIOC_GETTIMELEFT: | ||
601 | ret = put_user(hpwdt_time_left(), p); | ||
602 | break; | ||
594 | } | 603 | } |
595 | return ret; | 604 | return ret; |
596 | } | 605 | } |