aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-03 08:58:33 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-03 09:30:33 -0500
commitbbae92ca49f77898277576e3377b09e1391a3271 (patch)
treebbab5e3a951d4dec6f6778767c7426b942ea2e6b
parent55ac85e942c6783e728964861df36fc80e8ced93 (diff)
regmap: irq: Factor register read out of the IRQ parsing loop
In preparation for adding back support for block reads. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/base/regmap/regmap-irq.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 91294935130e..329be9836716 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -170,13 +170,6 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
170 } 170 }
171 } 171 }
172 172
173 /*
174 * Ignore masked IRQs and ack if we need to; we ack early so
175 * there is no race between handling and acknowleding the
176 * interrupt. We assume that typically few of the interrupts
177 * will fire simultaneously so don't worry about overhead from
178 * doing a write per register.
179 */
180 for (i = 0; i < data->chip->num_regs; i++) { 173 for (i = 0; i < data->chip->num_regs; i++) {
181 ret = regmap_read(map, chip->status_base + (i * map->reg_stride 174 ret = regmap_read(map, chip->status_base + (i * map->reg_stride
182 * data->irq_reg_stride), 175 * data->irq_reg_stride),
@@ -189,7 +182,16 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
189 pm_runtime_put(map->dev); 182 pm_runtime_put(map->dev);
190 return IRQ_NONE; 183 return IRQ_NONE;
191 } 184 }
185 }
192 186
187 /*
188 * Ignore masked IRQs and ack if we need to; we ack early so
189 * there is no race between handling and acknowleding the
190 * interrupt. We assume that typically few of the interrupts
191 * will fire simultaneously so don't worry about overhead from
192 * doing a write per register.
193 */
194 for (i = 0; i < data->chip->num_regs; i++) {
193 data->status_buf[i] &= ~data->mask_buf[i]; 195 data->status_buf[i] &= ~data->mask_buf[i];
194 196
195 if (data->status_buf[i] && chip->ack_base) { 197 if (data->status_buf[i] && chip->ack_base) {