Skip to content

Commit 3c92506

Browse files
linuswbrgl
authored andcommitted
gpio: tc3589x: Make irqchip immutable
This turns the Toshiba tc3589x gpio irqchip immutable. Cc: Marc Zyngier <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Acked-by: Marc Zyngier <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 0ae3109 commit 3c92506

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpio/gpio-tc3589x.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ static void tc3589x_gpio_irq_mask(struct irq_data *d)
230230

231231
tc3589x_gpio->regs[REG_IE][regoffset] &= ~mask;
232232
tc3589x_gpio->regs[REG_DIRECT][regoffset] |= mask;
233+
gpiochip_disable_irq(gc, offset);
233234
}
234235

235236
static void tc3589x_gpio_irq_unmask(struct irq_data *d)
@@ -240,17 +241,20 @@ static void tc3589x_gpio_irq_unmask(struct irq_data *d)
240241
int regoffset = offset / 8;
241242
int mask = BIT(offset % 8);
242243

244+
gpiochip_enable_irq(gc, offset);
243245
tc3589x_gpio->regs[REG_IE][regoffset] |= mask;
244246
tc3589x_gpio->regs[REG_DIRECT][regoffset] &= ~mask;
245247
}
246248

247-
static struct irq_chip tc3589x_gpio_irq_chip = {
249+
static const struct irq_chip tc3589x_gpio_irq_chip = {
248250
.name = "tc3589x-gpio",
249251
.irq_bus_lock = tc3589x_gpio_irq_lock,
250252
.irq_bus_sync_unlock = tc3589x_gpio_irq_sync_unlock,
251253
.irq_mask = tc3589x_gpio_irq_mask,
252254
.irq_unmask = tc3589x_gpio_irq_unmask,
253255
.irq_set_type = tc3589x_gpio_irq_set_type,
256+
.flags = IRQCHIP_IMMUTABLE,
257+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
254258
};
255259

256260
static irqreturn_t tc3589x_gpio_irq(int irq, void *dev)
@@ -321,7 +325,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
321325
tc3589x_gpio->chip.base = -1;
322326

323327
girq = &tc3589x_gpio->chip.irq;
324-
girq->chip = &tc3589x_gpio_irq_chip;
328+
gpio_irq_chip_set_chip(girq, &tc3589x_gpio_irq_chip);
325329
/* This will let us handle the parent IRQ in the driver */
326330
girq->parent_handler = NULL;
327331
girq->num_parents = 0;

0 commit comments

Comments
 (0)