diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 22:25:12 +0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-31 22:25:12 +0400 |
commit | 1801ceaf073f77e0f2ccfbd54ee0e93bd6adbb5d (patch) | |
tree | 3485d3a1d7e40eef5a72df9b21e04a83e8ba4a6f /drivers/base/regmap | |
parent | 4ff4eb9e8c535f67ad2c1adc6c168ece1fb763bc (diff) | |
parent | 68622bdfefb969fd7cf710545d7e758a732ab01d (diff) | |
download | linux-1801ceaf073f77e0f2ccfbd54ee0e93bd6adbb5d.tar.xz |
Merge remote-tracking branch 'regmap/topic/irq' into regmap-next
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 1643e889bafc..d10456ffd811 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -418,6 +418,31 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, reg, ret); goto err_alloc; } + + if (!chip->init_ack_masked) + continue; + + /* Ack masked but set interrupts */ + reg = chip->status_base + + (i * map->reg_stride * d->irq_reg_stride); + ret = regmap_read(map, reg, &d->status_buf[i]); + if (ret != 0) { + dev_err(map->dev, "Failed to read IRQ status: %d\n", + ret); + goto err_alloc; + } + + if (d->status_buf[i] && chip->ack_base) { + reg = chip->ack_base + + (i * map->reg_stride * d->irq_reg_stride); + ret = regmap_write(map, reg, + d->status_buf[i] & d->mask_buf[i]); + if (ret != 0) { + dev_err(map->dev, "Failed to ack 0x%x: %d\n", + reg, ret); + goto err_alloc; + } + } } /* Wake is disabled by default */ |