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>
This commit is contained in:
committed by
Linus Torvalds
parent
2fac6674dd
commit
5d2a50371d
@@ -24,6 +24,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/log2.h>
|
||||
#include <asm/rtc.h>
|
||||
|
||||
#define DRV_NAME "sh-rtc"
|
||||
@@ -551,6 +552,8 @@ static int sh_rtc_irq_set_state(struct device *dev, int enabled)
|
||||
|
||||
static int sh_rtc_irq_set_freq(struct device *dev, int freq)
|
||||
{
|
||||
if (!is_power_of_2(freq))
|
||||
return -EINVAL;
|
||||
return sh_rtc_ioctl(dev, RTC_IRQP_SET, freq);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user