mfd: Mask and unmask wm8350 IRQs on request and free

Bring the WM8350 IRQ API more in line with the generic IRQ API by
masking and unmasking interrupts as they are requested and freed.
This is mostly just a case of deleting the mask and unmask calls
from the individual drivers.

The RTC driver is changed to mask the periodic IRQ after requesting
it rather than only unmasking the alarm IRQ. If the periodic IRQ
fires in the period where it is reqested then there will be a
spurious notification but there should be no serious consequences
from this.

The CODEC drive is changed to explicitly disable headphone jack
detection prior to requesting the IRQs. This will avoid the IRQ
firing with no jack set up.

Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
Mark Brown 2009-11-04 16:10:52 +00:00 • committed by Samuel Ortiz
commit 6a6127462e
5 changed files with 9 additions and 41 deletions

View file

@ -445,6 +445,8 @@ int wm8350_register_irq(struct wm8350 *wm8350, int irq,
wm8350->irq[irq].data = data;
mutex_unlock(&wm8350->irq_mutex);
wm8350_unmask_irq(wm8350, irq);
return 0;
}
EXPORT_SYMBOL_GPL(wm8350_register_irq);
@ -454,6 +456,8 @@ int wm8350_free_irq(struct wm8350 *wm8350, int irq)
if (irq < 0 || irq > WM8350_NUM_IRQ)
return -EINVAL;
wm8350_mask_irq(wm8350, irq);
mutex_lock(&wm8350->irq_mutex);
wm8350->irq[irq].handler = NULL;
mutex_unlock(&wm8350->irq_mutex);