aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-21 15:02:03 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-14 03:52:11 -0400
commit3080de4ef62f0cc1910b227d33d3533f3c4a4a5d (patch)
tree31c52475e1fd31076e37ae23e57fa43c7126ebcc
parent55692af5eb587f7592d6c2713e1e0eeaab0f6c31 (diff)
mfd: arizona: Suppress needless calls to the primary IRQ
We can read back if the primary IRQ is asserted from the register map, meaning that we can suppress polling of the interrupt status registers when only the AoD IRQ domain is asserting. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/arizona-irq.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index 64940c6da93..a062153f54e 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -94,6 +94,7 @@ static irqreturn_t arizona_ctrlif_err(int irq, void *data)
94static irqreturn_t arizona_irq_thread(int irq, void *data) 94static irqreturn_t arizona_irq_thread(int irq, void *data)
95{ 95{
96 struct arizona *arizona = data; 96 struct arizona *arizona = data;
97 unsigned int val;
97 int i, ret; 98 int i, ret;
98 99
99 ret = pm_runtime_get_sync(arizona->dev); 100 ret = pm_runtime_get_sync(arizona->dev);
@@ -102,9 +103,20 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
102 return IRQ_NONE; 103 return IRQ_NONE;
103 } 104 }
104 105
105 /* Check both domains */ 106 /* Always handle the AoD domain */
106 for (i = 0; i < 2; i++) 107 handle_nested_irq(irq_find_mapping(arizona->virq, 0));
107 handle_nested_irq(irq_find_mapping(arizona->virq, i)); 108
109 /*
110 * Check if one of the main interrupts is asserted and only
111 * check that domain if it is.
112 */
113 ret = regmap_read(arizona->regmap, ARIZONA_IRQ_PIN_STATUS, &val);
114 if (ret == 0 && val & ARIZONA_IRQ1_STS) {
115 handle_nested_irq(irq_find_mapping(arizona->virq, 1));
116 } else if (ret != 0) {
117 dev_err(arizona->dev, "Failed to read main IRQ status: %d\n",
118 ret);
119 }
108 120
109 pm_runtime_mark_last_busy(arizona->dev); 121 pm_runtime_mark_last_busy(arizona->dev);
110 pm_runtime_put_autosuspend(arizona->dev); 122 pm_runtime_put_autosuspend(arizona->dev);