Commit 604c7823 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: mxc: avoid disabling interrupts on device close

Currently, the IRQs are disabled when the rtc character device is closed.
This means that the device needs to stay open to get alarms while the usual
use case will open the device, set the alarm and close the device as is
done in rtcwake.

Keep the alarm functional on character device release so the platform can
actually wakeup.
Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 0a53a167
...@@ -238,26 +238,6 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) ...@@ -238,26 +238,6 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/*
* Clear all interrupts and release the IRQ
*/
static void mxc_rtc_release(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
spin_lock_irq(&pdata->rtc->irq_lock);
/* Disable all rtc interrupts */
writew(0, ioaddr + RTC_RTCIENR);
/* Clear all interrupt status */
writew(0xffffffff, ioaddr + RTC_RTCISR);
spin_unlock_irq(&pdata->rtc->irq_lock);
}
static int mxc_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static int mxc_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
{ {
mxc_rtc_irq_enable(dev, RTC_ALM_BIT, enabled); mxc_rtc_irq_enable(dev, RTC_ALM_BIT, enabled);
...@@ -343,7 +323,6 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -343,7 +323,6 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
/* RTC layer */ /* RTC layer */
static const struct rtc_class_ops mxc_rtc_ops = { static const struct rtc_class_ops mxc_rtc_ops = {
.release = mxc_rtc_release,
.read_time = mxc_rtc_read_time, .read_time = mxc_rtc_read_time,
.set_mmss64 = mxc_rtc_set_mmss, .set_mmss64 = mxc_rtc_set_mmss,
.read_alarm = mxc_rtc_read_alarm, .read_alarm = mxc_rtc_read_alarm,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment