projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[cascardo/linux.git]
/
drivers
/
rtc
/
rtc-sa1100.c
diff --git
a/drivers/rtc/rtc-sa1100.c
b/drivers/rtc/rtc-sa1100.c
index
ee4b61e
..
0918b78
100644
(file)
--- a/
drivers/rtc/rtc-sa1100.c
+++ b/
drivers/rtc/rtc-sa1100.c
@@
-68,8
+68,7
@@
static int rtc_update_alarm(struct rtc_time *alrm)
return ret;
}
return ret;
}
-static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id)
{
struct platform_device *pdev = to_platform_device(dev_id);
struct rtc_device *rtc = platform_get_drvdata(pdev);
{
struct platform_device *pdev = to_platform_device(dev_id);
struct rtc_device *rtc = platform_get_drvdata(pdev);
@@
-94,7
+93,7
@@
static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id,
if (rtsr & RTSR_HZ)
events |= RTC_UF | RTC_IRQF;
if (rtsr & RTSR_HZ)
events |= RTC_UF | RTC_IRQF;
- rtc_update_irq(
&rtc->class_dev
, 1, events);
+ rtc_update_irq(
rtc
, 1, events);
if (rtsr & RTSR_AL && rtc_periodic_alarm(&rtc_alarm))
rtc_update_alarm(&rtc_alarm);
if (rtsr & RTSR_AL && rtc_periodic_alarm(&rtc_alarm))
rtc_update_alarm(&rtc_alarm);
@@
-106,8
+105,7
@@
static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id,
static int rtc_timer1_count;
static int rtc_timer1_count;
-static irqreturn_t timer1_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t timer1_interrupt(int irq, void *dev_id)
{
struct platform_device *pdev = to_platform_device(dev_id);
struct rtc_device *rtc = platform_get_drvdata(pdev);
{
struct platform_device *pdev = to_platform_device(dev_id);
struct rtc_device *rtc = platform_get_drvdata(pdev);
@@
-121,7
+119,7
@@
static irqreturn_t timer1_interrupt(int irq, void *dev_id,
*/
OSSR = OSSR_M1; /* clear match on timer1 */
*/
OSSR = OSSR_M1; /* clear match on timer1 */
- rtc_update_irq(
&rtc->class_dev
, rtc_timer1_count, RTC_PF | RTC_IRQF);
+ rtc_update_irq(
rtc
, rtc_timer1_count, RTC_PF | RTC_IRQF);
if (rtc_timer1_count == 1)
rtc_timer1_count = (rtc_freq * ((1<<30)/(TIMER_FREQ>>2)));
if (rtc_timer1_count == 1)
rtc_timer1_count = (rtc_freq * ((1<<30)/(TIMER_FREQ>>2)));
@@
-265,8
+263,12
@@
static int sa1100_rtc_set_time(struct device *dev, struct rtc_time *tm)
static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
+ u32 rtsr;
+
memcpy(&alrm->time, &rtc_alarm, sizeof(struct rtc_time));
memcpy(&alrm->time, &rtc_alarm, sizeof(struct rtc_time));
- alrm->pending = RTSR & RTSR_AL ? 1 : 0;
+ rtsr = RTSR;
+ alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0;
+ alrm->pending = (rtsr & RTSR_AL) ? 1 : 0;
return 0;
}
return 0;
}
@@
-277,12
+279,10
@@
static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
spin_lock_irq(&sa1100_rtc_lock);
ret = rtc_update_alarm(&alrm->time);
if (ret == 0) {
spin_lock_irq(&sa1100_rtc_lock);
ret = rtc_update_alarm(&alrm->time);
if (ret == 0) {
- memcpy(&rtc_alarm, &alrm->time, sizeof(struct rtc_time));
-
if (alrm->enabled)
if (alrm->enabled)
-
enable_irq_wake(IRQ_RTCAlrm)
;
+
RTSR |= RTSR_ALE
;
else
else
-
disable_irq_wake(IRQ_RTCAlrm)
;
+
RTSR &= ~RTSR_ALE
;
}
spin_unlock_irq(&sa1100_rtc_lock);
}
spin_unlock_irq(&sa1100_rtc_lock);
@@
-291,9
+291,7
@@
static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq)
{
static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq)
{
- seq_printf(seq, "trim/divider\t: 0x%08lx\n", RTTR);
- seq_printf(seq, "alarm_IRQ\t: %s\n",
- (RTSR & RTSR_ALE) ? "yes" : "no" );
+ seq_printf(seq, "trim/divider\t: 0x%08x\n", (u32) RTTR);
seq_printf(seq, "update_IRQ\t: %s\n",
(RTSR & RTSR_HZE) ? "yes" : "no");
seq_printf(seq, "periodic_IRQ\t: %s\n",
seq_printf(seq, "update_IRQ\t: %s\n",
(RTSR & RTSR_HZE) ? "yes" : "no");
seq_printf(seq, "periodic_IRQ\t: %s\n",
@@
-303,7
+301,7
@@
static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq)
return 0;
}
return 0;
}
-static struct rtc_class_ops sa1100_rtc_ops = {
+static
const
struct rtc_class_ops sa1100_rtc_ops = {
.open = sa1100_rtc_open,
.read_callback = sa1100_rtc_read_callback,
.release = sa1100_rtc_release,
.open = sa1100_rtc_open,
.read_callback = sa1100_rtc_read_callback,
.release = sa1100_rtc_release,