aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-wm8350.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-01-05 08:59:08 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2010-03-07 16:16:56 -0500
commit29c71b138c83c8191f1f7e46fcc28b9d6bc8a5dd (patch)
tree75f836772ba015d263a0174718701fc5cd9aa784 /drivers/rtc/rtc-wm8350.c
parentf99344fc69c3df46786a39ea4283a4175ea40b3f (diff)
rtc: Suppress duplicate enable/disable of WM8350 update interrupt
Unlike the wm8350-custom code genirq nests enable and disable calls so we can't just unconditionally mask or unmask the interrupt, we need to remember the state we set and only mask or unmask when there is a real change. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: rtc-linux@googlegroups.com Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/rtc/rtc-wm8350.c')
-rw-r--r--drivers/rtc/rtc-wm8350.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index a5512f515998..3d0dc76b38af 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -307,11 +307,18 @@ static int wm8350_rtc_update_irq_enable(struct device *dev,
307{ 307{
308 struct wm8350 *wm8350 = dev_get_drvdata(dev); 308 struct wm8350 *wm8350 = dev_get_drvdata(dev);
309 309
310 /* Suppress duplicate changes since genirq nests enable and
311 * disable calls. */
312 if (enabled == wm8350->rtc.update_enabled)
313 return 0;
314
310 if (enabled) 315 if (enabled)
311 wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC); 316 wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC);
312 else 317 else
313 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC); 318 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
314 319
320 wm8350->rtc.update_enabled = enabled;
321
315 return 0; 322 return 0;
316} 323}
317 324