diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2013-11-11 15:33:44 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2013-11-17 13:42:31 -0500 |
commit | b0df38dd3554d47fcfd5c1183951c2fe7dd07eda (patch) | |
tree | 3651c1d94637b98104144adb17241ece74540cde /drivers/watchdog/sirfsoc_wdt.c | |
parent | ab5bbdc7015bb35c364ad5f3c955736b17d1acb6 (diff) |
watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE
As CSR SiRF is converted to multi platform CLOCK_TICK_RATE is a dummy
value that seems to match the right value is used.
(arch/arm/mach-prima2/include/mach/timex.h which defined CLOCK_TICK_RATE
to 1000000 was removed in commit cf82e0e (ARM: sirf: enable
multiplatform support); marco used the same file.)
To not depend on that dummy value use a local #define instead.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/sirfsoc_wdt.c')
-rw-r--r-- | drivers/watchdog/sirfsoc_wdt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index 3b8d7397e001..ced3edc95957 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/uaccess.h> | 15 | #include <linux/uaccess.h> |
16 | 16 | ||
17 | #define CLOCK_FREQ 1000000 | ||
18 | |||
17 | #define SIRFSOC_TIMER_COUNTER_LO 0x0000 | 19 | #define SIRFSOC_TIMER_COUNTER_LO 0x0000 |
18 | #define SIRFSOC_TIMER_MATCH_0 0x0008 | 20 | #define SIRFSOC_TIMER_MATCH_0 0x0008 |
19 | #define SIRFSOC_TIMER_INT_EN 0x0024 | 21 | #define SIRFSOC_TIMER_INT_EN 0x0024 |
@@ -50,7 +52,7 @@ static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd) | |||
50 | 52 | ||
51 | time_left = match - counter; | 53 | time_left = match - counter; |
52 | 54 | ||
53 | return time_left / CLOCK_TICK_RATE; | 55 | return time_left / CLOCK_FREQ; |
54 | } | 56 | } |
55 | 57 | ||
56 | static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) | 58 | static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) |
@@ -58,7 +60,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) | |||
58 | u32 counter, timeout_ticks; | 60 | u32 counter, timeout_ticks; |
59 | void __iomem *wdt_base; | 61 | void __iomem *wdt_base; |
60 | 62 | ||
61 | timeout_ticks = wdd->timeout * CLOCK_TICK_RATE; | 63 | timeout_ticks = wdd->timeout * CLOCK_FREQ; |
62 | wdt_base = watchdog_get_drvdata(wdd); | 64 | wdt_base = watchdog_get_drvdata(wdd); |
63 | 65 | ||
64 | /* Enable the latch before reading the LATCH_LO register */ | 66 | /* Enable the latch before reading the LATCH_LO register */ |