diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-22 12:59:33 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-08 15:20:57 +0200 |
commit | f8a0941f1bbdbaa68441142675986501b48da8f5 (patch) | |
tree | c0221ed4ad47670549d4e91a27a92a68f82d800e /drivers/mfd/arizona-irq.c | |
parent | 7994c664bdf365124a920457f9c3c9c111f89bcf (diff) |
mfd: arizona: Basic support for edge triggered IRQs
Allow the user to configure edge triggered IRQs, though we do not yet
fully handle new interrupts occurring while an interrupt is being handled.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/arizona-irq.c')
-rw-r--r-- | drivers/mfd/arizona-irq.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index 0aa39e2eb008..aa25468d24aa 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c @@ -195,7 +195,11 @@ int arizona_irq_init(struct arizona *arizona) /* Disable all wake sources by default */ regmap_write(arizona->regmap, ARIZONA_WAKE_CONTROL, 0); - if (arizona->pdata.irq_active_high) { + if (!arizona->pdata.irq_flags) + arizona->pdata.irq_flags = IRQF_TRIGGER_LOW; + + if (arizona->pdata.irq_flags & (IRQF_TRIGGER_HIGH | + IRQF_TRIGGER_RISING)) { ret = regmap_update_bits(arizona->regmap, ARIZONA_IRQ_CTRL_1, ARIZONA_IRQ_POL, 0); if (ret != 0) { @@ -203,12 +207,10 @@ int arizona_irq_init(struct arizona *arizona) ret); goto err; } - - flags |= IRQF_TRIGGER_HIGH; - } else { - flags |= IRQF_TRIGGER_LOW; } + flags |= arizona->pdata.irq_flags; + /* Allocate a virtual IRQ domain to distribute to the regmap domains */ arizona->virq = irq_domain_add_linear(NULL, 2, &arizona_domain_ops, arizona); |