summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>2016-06-15 05:28:44 -0400
committerLee Jones <lee.jones@linaro.org>2016-06-29 05:14:40 -0400
commit1f2c39726f04906c6e97840599bc8d298c4b0eab (patch)
tree930a2db696924be78d95e0cffc8d018c7b2fd5af
parent9835f1b70bb3890d38308b9be4fb9d7451ba67f1 (diff)
mfd: arizona: Check if AOD interrupts are pending before dispatching
Previously the arizona_irq_thread implementation would call handle_nested_irqs() to handle AOD interrupts without checking if any were actually pending. The kernel will see these as spurious IRQs and will eventually disable the IRQ. This patch ensures we only launch the nested handler if there are AOD interrupts pending in the codec. Signed-off-by: Simon Trimmer <simont@opensource.wolfsonmicro.com> Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/arizona-irq.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index edeb4951366a..5e18d3c77582 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -109,8 +109,20 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
109 do { 109 do {
110 poll = false; 110 poll = false;
111 111
112 if (arizona->aod_irq_chip) 112 if (arizona->aod_irq_chip) {
113 handle_nested_irq(irq_find_mapping(arizona->virq, 0)); 113 /*
114 * Check the AOD status register to determine whether
115 * the nested IRQ handler should be called.
116 */
117 ret = regmap_read(arizona->regmap,
118 ARIZONA_AOD_IRQ1, &val);
119 if (ret)
120 dev_warn(arizona->dev,
121 "Failed to read AOD IRQ1 %d\n", ret);
122 else if (val)
123 handle_nested_irq(
124 irq_find_mapping(arizona->virq, 0));
125 }
114 126
115 /* 127 /*
116 * Check if one of the main interrupts is asserted and only 128 * Check if one of the main interrupts is asserted and only