mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-02 15:21:03 +00:00
regmap: irq: Support wake IRQ mask inversion
Support devices which have an enable rather than mask register for wake sources. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
33be49324f
commit
9442490a02
@ -92,8 +92,14 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
|
|||||||
reg = d->chip->wake_base +
|
reg = d->chip->wake_base +
|
||||||
(i * map->reg_stride * d->irq_reg_stride);
|
(i * map->reg_stride * d->irq_reg_stride);
|
||||||
if (d->wake_buf) {
|
if (d->wake_buf) {
|
||||||
ret = regmap_update_bits(d->map, reg,
|
if (d->chip->wake_invert)
|
||||||
d->mask_buf_def[i], d->wake_buf[i]);
|
ret = regmap_update_bits(d->map, reg,
|
||||||
|
d->mask_buf_def[i],
|
||||||
|
~d->wake_buf[i]);
|
||||||
|
else
|
||||||
|
ret = regmap_update_bits(d->map, reg,
|
||||||
|
d->mask_buf_def[i],
|
||||||
|
d->wake_buf[i]);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
dev_err(d->map->dev,
|
dev_err(d->map->dev,
|
||||||
"Failed to sync wakes in %x: %d\n",
|
"Failed to sync wakes in %x: %d\n",
|
||||||
@ -419,8 +425,15 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
|
|||||||
d->wake_buf[i] = d->mask_buf_def[i];
|
d->wake_buf[i] = d->mask_buf_def[i];
|
||||||
reg = chip->wake_base +
|
reg = chip->wake_base +
|
||||||
(i * map->reg_stride * d->irq_reg_stride);
|
(i * map->reg_stride * d->irq_reg_stride);
|
||||||
ret = regmap_update_bits(map, reg, d->wake_buf[i],
|
|
||||||
d->wake_buf[i]);
|
if (chip->wake_invert)
|
||||||
|
ret = regmap_update_bits(map, reg,
|
||||||
|
d->mask_buf_def[i],
|
||||||
|
0);
|
||||||
|
else
|
||||||
|
ret = regmap_update_bits(map, reg,
|
||||||
|
d->mask_buf_def[i],
|
||||||
|
d->wake_buf[i]);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
|
dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
|
||||||
reg, ret);
|
reg, ret);
|
||||||
|
@ -381,6 +381,7 @@ struct regmap_irq_chip {
|
|||||||
unsigned int wake_base;
|
unsigned int wake_base;
|
||||||
unsigned int irq_reg_stride;
|
unsigned int irq_reg_stride;
|
||||||
unsigned int mask_invert;
|
unsigned int mask_invert;
|
||||||
|
unsigned int wake_invert;
|
||||||
bool runtime_pm;
|
bool runtime_pm;
|
||||||
|
|
||||||
int num_regs;
|
int num_regs;
|
||||||
|
Loading…
Reference in New Issue
Block a user