gpio: stmpe: Convert to immutable irq_chip
Convert the driver to immutable irq-chip with a bit of intuition. Cc: Marc Zyngier <maz@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
5ff8240e47
commit
32585b565f
|
@ -234,6 +234,7 @@ static void stmpe_gpio_irq_mask(struct irq_data *d)
|
||||||
int mask = BIT(offset % 8);
|
int mask = BIT(offset % 8);
|
||||||
|
|
||||||
stmpe_gpio->regs[REG_IE][regoffset] &= ~mask;
|
stmpe_gpio->regs[REG_IE][regoffset] &= ~mask;
|
||||||
|
gpiochip_disable_irq(gc, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stmpe_gpio_irq_unmask(struct irq_data *d)
|
static void stmpe_gpio_irq_unmask(struct irq_data *d)
|
||||||
|
@ -244,6 +245,7 @@ static void stmpe_gpio_irq_unmask(struct irq_data *d)
|
||||||
int regoffset = offset / 8;
|
int regoffset = offset / 8;
|
||||||
int mask = BIT(offset % 8);
|
int mask = BIT(offset % 8);
|
||||||
|
|
||||||
|
gpiochip_enable_irq(gc, offset);
|
||||||
stmpe_gpio->regs[REG_IE][regoffset] |= mask;
|
stmpe_gpio->regs[REG_IE][regoffset] |= mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,13 +359,15 @@ static void stmpe_dbg_show(struct seq_file *s, struct gpio_chip *gc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip stmpe_gpio_irq_chip = {
|
static const struct irq_chip stmpe_gpio_irq_chip = {
|
||||||
.name = "stmpe-gpio",
|
.name = "stmpe-gpio",
|
||||||
.irq_bus_lock = stmpe_gpio_irq_lock,
|
.irq_bus_lock = stmpe_gpio_irq_lock,
|
||||||
.irq_bus_sync_unlock = stmpe_gpio_irq_sync_unlock,
|
.irq_bus_sync_unlock = stmpe_gpio_irq_sync_unlock,
|
||||||
.irq_mask = stmpe_gpio_irq_mask,
|
.irq_mask = stmpe_gpio_irq_mask,
|
||||||
.irq_unmask = stmpe_gpio_irq_unmask,
|
.irq_unmask = stmpe_gpio_irq_unmask,
|
||||||
.irq_set_type = stmpe_gpio_irq_set_type,
|
.irq_set_type = stmpe_gpio_irq_set_type,
|
||||||
|
.flags = IRQCHIP_IMMUTABLE,
|
||||||
|
GPIOCHIP_IRQ_RESOURCE_HELPERS,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_GPIOS 24
|
#define MAX_GPIOS 24
|
||||||
|
@ -511,7 +515,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
girq = &stmpe_gpio->chip.irq;
|
girq = &stmpe_gpio->chip.irq;
|
||||||
girq->chip = &stmpe_gpio_irq_chip;
|
gpio_irq_chip_set_chip(girq, &stmpe_gpio_irq_chip);
|
||||||
/* This will let us handle the parent IRQ in the driver */
|
/* This will let us handle the parent IRQ in the driver */
|
||||||
girq->parent_handler = NULL;
|
girq->parent_handler = NULL;
|
||||||
girq->num_parents = 0;
|
girq->num_parents = 0;
|
||||||
|
|
Loading…
Reference in New Issue