@@ -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
235236static 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
256260static 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