Skip to content

Commit 29c71b1

Browse files
broonieSamuel Ortiz
authored andcommitted
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>
1 parent f99344f commit 29c71b1

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/rtc/rtc-wm8350.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,18 @@ static int wm8350_rtc_update_irq_enable(struct device *dev,
307307
{
308308
struct wm8350 *wm8350 = dev_get_drvdata(dev);
309309

310+
/* Suppress duplicate changes since genirq nests enable and
311+
* disable calls. */
312+
if (enabled == wm8350->rtc.update_enabled)
313+
return 0;
314+
310315
if (enabled)
311316
wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC);
312317
else
313318
wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
314319

320+
wm8350->rtc.update_enabled = enabled;
321+
315322
return 0;
316323
}
317324

‎include/linux/mfd/wm8350/rtc.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ struct wm8350_rtc {
263263
struct platform_device *pdev;
264264
struct rtc_device *rtc;
265265
int alarm_enabled; /* used over suspend/resume */
266+
int update_enabled;
266267
};
267268

268269
#endif

0 commit comments

Comments
 (0)