diff options
author | dann frazier <dannf@hp.com> | 2010-06-03 00:23:40 +0200 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2010-08-13 22:54:42 +0200 |
commit | 6f681c2eabbd8df062963c52abaa0c7c3b2c5a7d (patch) | |
tree | 13bf846272f0ff221e0b00cc04e876ff3af06ec8 /drivers | |
parent | watchdog: hpwdt (6/12): Introduce SECS_TO_TICKS() macro (diff) | |
download | linux-6f681c2eabbd8df062963c52abaa0c7c3b2c5a7d.tar.xz linux-6f681c2eabbd8df062963c52abaa0c7c3b2c5a7d.zip |
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: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/watchdog/hpwdt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index a5d36ae350dd..00299919df39 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -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); |