From 4caf79de95c26495e7cdc8204023d97598f887d2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 30 Jan 2009 08:07:27 +0000 Subject: consider alrm->enable in pcf50633_rtc_set_alarm Hi Balaji, Mickey mentioned to me that he had trouble with the RTC wakeup interrupt. I had a quick look at the problem and it seems that alrm->enable doesn't get propagated when setting the alarm time with RTC_WKALM_SET. Does something like my patch below look right ? We also don't handle alrm->pending, but I'm not sure if we have to. I tested this only very lightly since my current andy-tracking crashes in soc_suspend. If nobody else beats me to it, I'll have a look at it tomorrow. - Werner ---------------------------------- cut here ----------------------------------- According to Documentation/rtc.txt, RTC_WKALM_SET sets the alarm time and enables/disables the alarm. We implement RTC_WKALM_SET through pcf50633_rtc_set_alarm. The enabling/disabling part was missing. Signed-off-by: Werner Almesberger Reported-by: Michael 'Mickey' Lauer --- drivers/rtc/rtc-pcf50633.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c index f4dd87e2907..0d6b0061b92 100644 --- a/drivers/rtc/rtc-pcf50633.c +++ b/drivers/rtc/rtc-pcf50633.c @@ -245,8 +245,9 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA, PCF50633_TI_EXTENT, &pcf_tm.time[0]); - if (!alarm_masked) + if (!alarm_masked || alrm->enabled) pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); + rtc->alarm_enabled = alrm->enabled; return ret; } -- cgit v1.2.3