Skip to content

Commit

Permalink
regmap: set MASK_ON_SUSPEND/SKIP_SET_WAKE if no wake_base
Browse files Browse the repository at this point in the history
If a regmap-irq chip has no wake base:

* There's no point calling .irq_set_wake, hence IRQCHIP_SKIP_SET_WAKE.

* If some IRQs in the chip are enabled for wake and some aren't, we
  should mask those interrupts that are not wake enabled, so that if
  they occur during suspend, the system is not awoken. Hence,
  IRQCHIP_MASK_ON_SUSPEND.

Note that IRQCHIP_MASK_ON_SUSPEND is handled by check_wakeup_irqs(),
which always iterates over every single interrupt in the system,
irrespective of whether an interrupt is a child of a controller whose
output interrupt has no wake-enabled inputs and hence is presumably
masked itself. Hence this change might cause interrupt unnecessary
masking operations and associated register I/O.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Aug 4, 2012
1 parent ca14275 commit 685879f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/base/regmap/regmap-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,

d->irq_chip = regmap_irq_chip;
d->irq_chip.name = chip->name;
if (!chip->wake_base) {
d->irq_chip.irq_set_wake = NULL;
d->irq_chip.flags |= IRQCHIP_MASK_ON_SUSPEND |
IRQCHIP_SKIP_SET_WAKE;
}
d->irq = irq;
d->map = map;
d->chip = chip;
Expand Down

0 comments on commit 685879f

Please sign in to comment.