diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2009-01-06 17:42:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:24 -0500 |
commit | 5d2a50371ddf127afa782ad3147469be8e9bd69f (patch) | |
tree | bc7b7032512c17f493e5f656044c79c17952f517 /drivers/rtc/rtc-vr41xx.c | |
parent | 2fac6674ddf3164da42a76d62f8912073d629a30 (diff) |
rtc: move power of 2 periodic frequency check down into drivers
Move the power of 2 check on frequencies down into individual rtc drivers
This is to allow for non power of 2 real time clock periodic interrupts
such as those on the pxa27x to be found in the new pxa27x-rtc driver
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-vr41xx.c')
-rw-r--r-- | drivers/rtc/rtc-vr41xx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c index 57b7aac092a3..f11297aff854 100644 --- a/drivers/rtc/rtc-vr41xx.c +++ b/drivers/rtc/rtc-vr41xx.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/rtc.h> | 27 | #include <linux/rtc.h> |
28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/log2.h> | ||
30 | 31 | ||
31 | #include <asm/div64.h> | 32 | #include <asm/div64.h> |
32 | #include <asm/io.h> | 33 | #include <asm/io.h> |
@@ -210,6 +211,8 @@ static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq) | |||
210 | { | 211 | { |
211 | unsigned long count; | 212 | unsigned long count; |
212 | 213 | ||
214 | if (!is_power_of_2(freq)) | ||
215 | return -EINVAL; | ||
213 | count = RTC_FREQUENCY; | 216 | count = RTC_FREQUENCY; |
214 | do_div(count, freq); | 217 | do_div(count, freq); |
215 | 218 | ||