diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-12-15 04:36:51 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-16 15:50:13 -0500 |
commit | d3233433356aa1965b60b08ee61465b20e50474b (patch) | |
tree | cd693a91f65f5c2aa937047459fd6f3d49fcd719 /drivers/base | |
parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) |
regmap: irq: Allow using zero value for ack_base
In some cases, clear interrupt register may be at address 0.
This patch allows to use such configurations by adding additional
configuration bit to indicate this.
[With doc fix from Levente Kurusa <levex@linux.com> -- broonie]
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 763c60d3d277..82692068d3cb 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c | |||
@@ -113,7 +113,7 @@ static void regmap_irq_sync_unlock(struct irq_data *data) | |||
113 | * OR if there is masked interrupt which hasn't been Acked, | 113 | * OR if there is masked interrupt which hasn't been Acked, |
114 | * it'll be ignored in irq handler, then may introduce irq storm | 114 | * it'll be ignored in irq handler, then may introduce irq storm |
115 | */ | 115 | */ |
116 | if (d->mask_buf[i] && d->chip->ack_base) { | 116 | if (d->mask_buf[i] && (d->chip->ack_base || d->chip->use_ack)) { |
117 | reg = d->chip->ack_base + | 117 | reg = d->chip->ack_base + |
118 | (i * map->reg_stride * d->irq_reg_stride); | 118 | (i * map->reg_stride * d->irq_reg_stride); |
119 | ret = regmap_write(map, reg, d->mask_buf[i]); | 119 | ret = regmap_write(map, reg, d->mask_buf[i]); |
@@ -271,7 +271,7 @@ static irqreturn_t regmap_irq_thread(int irq, void *d) | |||
271 | for (i = 0; i < data->chip->num_regs; i++) { | 271 | for (i = 0; i < data->chip->num_regs; i++) { |
272 | data->status_buf[i] &= ~data->mask_buf[i]; | 272 | data->status_buf[i] &= ~data->mask_buf[i]; |
273 | 273 | ||
274 | if (data->status_buf[i] && chip->ack_base) { | 274 | if (data->status_buf[i] && (chip->ack_base || chip->use_ack)) { |
275 | reg = chip->ack_base + | 275 | reg = chip->ack_base + |
276 | (i * map->reg_stride * data->irq_reg_stride); | 276 | (i * map->reg_stride * data->irq_reg_stride); |
277 | ret = regmap_write(map, reg, data->status_buf[i]); | 277 | ret = regmap_write(map, reg, data->status_buf[i]); |
@@ -448,7 +448,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, | |||
448 | goto err_alloc; | 448 | goto err_alloc; |
449 | } | 449 | } |
450 | 450 | ||
451 | if (d->status_buf[i] && chip->ack_base) { | 451 | if (d->status_buf[i] && (chip->ack_base || chip->use_ack)) { |
452 | reg = chip->ack_base + | 452 | reg = chip->ack_base + |
453 | (i * map->reg_stride * d->irq_reg_stride); | 453 | (i * map->reg_stride * d->irq_reg_stride); |
454 | ret = regmap_write(map, reg, | 454 | ret = regmap_write(map, reg, |