aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2010-10-07 19:03:52 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-10-29 14:08:42 -0400
commit468ffde46d429fbd291b0ef43a06afe9c837629f (patch)
tree85e04da002a59f86e627aee02a5ba2a381bbf5bc /drivers
parent1fa25ab2caf79b99094c3da6e09f20a35e8f01f8 (diff)
WATCHDOG: octeon-wdt: Use I/O clock rate for timing calculations.
The creation of the I/O clock domain requires some adjustments. Since the watchdog counters are clocked by the I/O clock, use its rate for timing calculations. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Cc: Wim Van Sebroeck <wim@iguana.be> Cc: linux-watchdog@vger.kernel.org Patchwork: http://patchwork.linux-mips.org/patch/1659/ Acked-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/octeon-wdt-main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c
index 909923800a02..945ee8300306 100644
--- a/drivers/watchdog/octeon-wdt-main.c
+++ b/drivers/watchdog/octeon-wdt-main.c
@@ -478,7 +478,7 @@ static void octeon_wdt_calc_parameters(int t)
478 478
479 countdown_reset = periods > 2 ? periods - 2 : 0; 479 countdown_reset = periods > 2 ? periods - 2 : 0;
480 heartbeat = t; 480 heartbeat = t;
481 timeout_cnt = ((octeon_get_clock_rate() >> 8) * timeout_sec) >> 8; 481 timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * timeout_sec) >> 8;
482} 482}
483 483
484static int octeon_wdt_set_heartbeat(int t) 484static int octeon_wdt_set_heartbeat(int t)
@@ -677,7 +677,7 @@ static int __init octeon_wdt_init(void)
677 max_timeout_sec = 6; 677 max_timeout_sec = 6;
678 do { 678 do {
679 max_timeout_sec--; 679 max_timeout_sec--;
680 timeout_cnt = ((octeon_get_clock_rate() >> 8) * max_timeout_sec) >> 8; 680 timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * max_timeout_sec) >> 8;
681 } while (timeout_cnt > 65535); 681 } while (timeout_cnt > 65535);
682 682
683 BUG_ON(timeout_cnt == 0); 683 BUG_ON(timeout_cnt == 0);