aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-05 11:14:17 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2010-05-27 19:37:38 -0400
commit0d7e0e399d7fcd5ddc3313a1aa2135fab3226d8f (patch)
tree718f31cc11941fa23fa065f28451336ea4943b1a /drivers/mfd
parent752599667048898b6969e06e4637f906b04ec752 (diff)
mfd: Initialise WM831x IRQ masks on chip even if interrupts not in use
Ensure that the hardware has interrupts masked if we are not using the interrupt controller on the WM831x by initialising the masks before we check for the setup data required for the IRQ line. This avoids signalling an unused IRQ line and improves the robustness of checks that the IRQ is in use. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/wm831x-irq.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
index ec10004200c9..7dabe4dbd373 100644
--- a/drivers/mfd/wm831x-irq.c
+++ b/drivers/mfd/wm831x-irq.c
@@ -490,6 +490,14 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq)
490 490
491 mutex_init(&wm831x->irq_lock); 491 mutex_init(&wm831x->irq_lock);
492 492
493 /* Mask the individual interrupt sources */
494 for (i = 0; i < ARRAY_SIZE(wm831x->irq_masks_cur); i++) {
495 wm831x->irq_masks_cur[i] = 0xffff;
496 wm831x->irq_masks_cache[i] = 0xffff;
497 wm831x_reg_write(wm831x, WM831X_INTERRUPT_STATUS_1_MASK + i,
498 0xffff);
499 }
500
493 if (!irq) { 501 if (!irq) {
494 dev_warn(wm831x->dev, 502 dev_warn(wm831x->dev,
495 "No interrupt specified - functionality limited\n"); 503 "No interrupt specified - functionality limited\n");
@@ -505,14 +513,6 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq)
505 wm831x->irq = irq; 513 wm831x->irq = irq;
506 wm831x->irq_base = pdata->irq_base; 514 wm831x->irq_base = pdata->irq_base;
507 515
508 /* Mask the individual interrupt sources */
509 for (i = 0; i < ARRAY_SIZE(wm831x->irq_masks_cur); i++) {
510 wm831x->irq_masks_cur[i] = 0xffff;
511 wm831x->irq_masks_cache[i] = 0xffff;
512 wm831x_reg_write(wm831x, WM831X_INTERRUPT_STATUS_1_MASK + i,
513 0xffff);
514 }
515
516 /* Register them with genirq */ 516 /* Register them with genirq */
517 for (cur_irq = wm831x->irq_base; 517 for (cur_irq = wm831x->irq_base;
518 cur_irq < ARRAY_SIZE(wm831x_irqs) + wm831x->irq_base; 518 cur_irq < ARRAY_SIZE(wm831x_irqs) + wm831x->irq_base;