aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-12-19 09:12:28 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-24 11:18:26 -0500
commit55ac85e942c6783e728964861df36fc80e8ced93 (patch)
tree4cbef19565ad287252ae3d405827207ce2d87585 /drivers/base
parenta49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff)
regmap: irq: enable wake support by default
regmap-irq framework is used vastly by mfd drivers and some of devices like TPS65910, TPS80036 do not support the wake base register to enable wake. Currently wake in regmap-irq only supported if client driver passes the wake base register. As the regmap-irq is mostly used by mfd devices and it is require to have wake support from these devices in most of use cases, enabling wake support by default in regmap-irq. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap-irq.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 5972ad958544..91294935130e 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -129,16 +129,15 @@ static int regmap_irq_set_wake(struct irq_data *data, unsigned int on)
129 struct regmap *map = d->map; 129 struct regmap *map = d->map;
130 const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq); 130 const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);
131 131
132 if (!d->chip->wake_base)
133 return -EINVAL;
134
135 if (on) { 132 if (on) {
136 d->wake_buf[irq_data->reg_offset / map->reg_stride] 133 if (d->wake_buf)
137 &= ~irq_data->mask; 134 d->wake_buf[irq_data->reg_offset / map->reg_stride]
135 &= ~irq_data->mask;
138 d->wake_count++; 136 d->wake_count++;
139 } else { 137 } else {
140 d->wake_buf[irq_data->reg_offset / map->reg_stride] 138 if (d->wake_buf)
141 |= irq_data->mask; 139 d->wake_buf[irq_data->reg_offset / map->reg_stride]
140 |= irq_data->mask;
142 d->wake_count--; 141 d->wake_count--;
143 } 142 }
144 143
@@ -316,11 +315,6 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
316 315
317 d->irq_chip = regmap_irq_chip; 316 d->irq_chip = regmap_irq_chip;
318 d->irq_chip.name = chip->name; 317 d->irq_chip.name = chip->name;
319 if (!chip->wake_base) {
320 d->irq_chip.irq_set_wake = NULL;
321 d->irq_chip.flags |= IRQCHIP_MASK_ON_SUSPEND |
322 IRQCHIP_SKIP_SET_WAKE;
323 }
324 d->irq = irq; 318 d->irq = irq;
325 d->map = map; 319 d->map = map;
326 d->chip = chip; 320 d->chip = chip;