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

watchdog: hpwdt (7/12): allow full range of timer values supported by hardware

The hpwdt timer is a 16 bit value with 128ms resolution.
Let applications use this entire range.
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 e802e32d
......@@ -36,6 +36,8 @@
#define HPWDT_VERSION "1.1.1"
#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000)
#define HPWDT_MAX_TIMER TICKS_TO_SECS(65535)
#define DEFAULT_MARGIN 30
static unsigned int soft_margin = DEFAULT_MARGIN; /* in seconds */
......@@ -432,8 +434,7 @@ static void hpwdt_ping(void)
static int hpwdt_change_timer(int new_margin)
{
/* Arbitrary, can't find the card's limits */
if (new_margin < 5 || new_margin > 600) {
if (new_margin < 1 || new_margin > HPWDT_MAX_TIMER) {
printk(KERN_WARNING
"hpwdt: New value passed in is invalid: %d seconds.\n",
new_margin);
......
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