Let applications check the amount of time left before the watchdog will fire.
Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
        return 0;
 }
 
+static int hpwdt_time_left(void)
+{
+       return TICKS_TO_SECS(ioread16(hpwdt_timer_reg));
+}
+
 /*
  *     NMI Handler
  */
        case WDIOC_GETTIMEOUT:
                ret = put_user(soft_margin, p);
                break;
+
+       case WDIOC_GETTIMELEFT:
+               ret = put_user(hpwdt_time_left(), p);
+               break;
        }
        return ret;
 }