@@ -91,7 +91,6 @@ enum sprd_eic_type {
91
91
92
92
struct sprd_eic {
93
93
struct gpio_chip chip ;
94
- struct irq_chip intc ;
95
94
void __iomem * base [SPRD_EIC_MAX_BANK ];
96
95
enum sprd_eic_type type ;
97
96
spinlock_t lock ;
@@ -255,6 +254,8 @@ static void sprd_eic_irq_mask(struct irq_data *data)
255
254
default :
256
255
dev_err (chip -> parent , "Unsupported EIC type.\n" );
257
256
}
257
+
258
+ gpiochip_disable_irq (chip , offset );
258
259
}
259
260
260
261
static void sprd_eic_irq_unmask (struct irq_data * data )
@@ -263,6 +264,8 @@ static void sprd_eic_irq_unmask(struct irq_data *data)
263
264
struct sprd_eic * sprd_eic = gpiochip_get_data (chip );
264
265
u32 offset = irqd_to_hwirq (data );
265
266
267
+ gpiochip_enable_irq (chip , offset );
268
+
266
269
switch (sprd_eic -> type ) {
267
270
case SPRD_EIC_DEBOUNCE :
268
271
sprd_eic_update (chip , offset , SPRD_EIC_DBNC_IE , 1 );
@@ -564,6 +567,15 @@ static void sprd_eic_irq_handler(struct irq_desc *desc)
564
567
chained_irq_exit (ic , desc );
565
568
}
566
569
570
+ static const struct irq_chip sprd_eic_irq = {
571
+ .name = "sprd-eic" ,
572
+ .irq_ack = sprd_eic_irq_ack ,
573
+ .irq_mask = sprd_eic_irq_mask ,
574
+ .irq_unmask = sprd_eic_irq_unmask ,
575
+ .irq_set_type = sprd_eic_irq_set_type ,
576
+ .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_IMMUTABLE ,
577
+ GPIOCHIP_IRQ_RESOURCE_HELPERS ,
578
+ };
567
579
static int sprd_eic_probe (struct platform_device * pdev )
568
580
{
569
581
const struct sprd_eic_variant_data * pdata ;
@@ -626,15 +638,8 @@ static int sprd_eic_probe(struct platform_device *pdev)
626
638
break ;
627
639
}
628
640
629
- sprd_eic -> intc .name = dev_name (& pdev -> dev );
630
- sprd_eic -> intc .irq_ack = sprd_eic_irq_ack ;
631
- sprd_eic -> intc .irq_mask = sprd_eic_irq_mask ;
632
- sprd_eic -> intc .irq_unmask = sprd_eic_irq_unmask ;
633
- sprd_eic -> intc .irq_set_type = sprd_eic_irq_set_type ;
634
- sprd_eic -> intc .flags = IRQCHIP_SKIP_SET_WAKE ;
635
-
636
641
irq = & sprd_eic -> chip .irq ;
637
- irq -> chip = & sprd_eic -> intc ;
642
+ gpio_irq_chip_set_chip ( irq , & sprd_eic_irq ) ;
638
643
irq -> handler = handle_bad_irq ;
639
644
irq -> default_type = IRQ_TYPE_NONE ;
640
645
irq -> parent_handler = sprd_eic_irq_handler ;
0 commit comments