Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mark Brown and committed by
Samuel Ortiz
29c71b13 f99344fc

+8
+7
drivers/rtc/rtc-wm8350.c
··· 307 307 { 308 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 315 if (enabled) 311 316 wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC); 312 317 else 313 318 wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC); 319 + 320 + wm8350->rtc.update_enabled = enabled; 314 321 315 322 return 0; 316 323 }
+1
include/linux/mfd/wm8350/rtc.h
··· 263 263 struct platform_device *pdev; 264 264 struct rtc_device *rtc; 265 265 int alarm_enabled; /* used over suspend/resume */ 266 + int update_enabled; 266 267 }; 267 268 268 269 #endif