Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55ac85e9 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Mark Brown
Browse files

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: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a49f0d1e
Loading
Loading
Loading
Loading
+6 −12
Original line number Original line Diff line number Diff line
@@ -129,14 +129,13 @@ static int regmap_irq_set_wake(struct irq_data *data, unsigned int on)
	struct regmap *map = d->map;
	struct regmap *map = d->map;
	const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);
	const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);


	if (!d->chip->wake_base)
		return -EINVAL;

	if (on) {
	if (on) {
		if (d->wake_buf)
			d->wake_buf[irq_data->reg_offset / map->reg_stride]
			d->wake_buf[irq_data->reg_offset / map->reg_stride]
				&= ~irq_data->mask;
				&= ~irq_data->mask;
		d->wake_count++;
		d->wake_count++;
	} else {
	} else {
		if (d->wake_buf)
			d->wake_buf[irq_data->reg_offset / map->reg_stride]
			d->wake_buf[irq_data->reg_offset / map->reg_stride]
				|= irq_data->mask;
				|= irq_data->mask;
		d->wake_count--;
		d->wake_count--;
@@ -316,11 +315,6 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,


	d->irq_chip = regmap_irq_chip;
	d->irq_chip = regmap_irq_chip;
	d->irq_chip.name = chip->name;
	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->irq = irq;
	d->map = map;
	d->map = map;
	d->chip = chip;
	d->chip = chip;