Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29c71b13 authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz
Browse files

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Cc: rtc-linux@googlegroups.com
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent f99344fc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -307,11 +307,18 @@ static int wm8350_rtc_update_irq_enable(struct device *dev,
{
	struct wm8350 *wm8350 = dev_get_drvdata(dev);

	/* Suppress duplicate changes since genirq nests enable and
	 * disable calls. */
	if (enabled == wm8350->rtc.update_enabled)
		return 0;

	if (enabled)
		wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC);
	else
		wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);

	wm8350->rtc.update_enabled = enabled;

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -263,6 +263,7 @@ struct wm8350_rtc {
	struct platform_device *pdev;
	struct rtc_device *rtc;
	int alarm_enabled;      /* used over suspend/resume */
	int update_enabled;
};

#endif