OSDN Git Service

Merge tag 'asm-generic-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd...
[tomoyo/tomoyo-test1.git] / drivers / bcma / driver_gpio.c
index 65fb9ba..5f90bac 100644 (file)
@@ -82,6 +82,7 @@ static void bcma_gpio_irq_unmask(struct irq_data *d)
        int gpio = irqd_to_hwirq(d);
        u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
 
+       gpiochip_enable_irq(gc, gpio);
        bcma_chipco_gpio_polarity(cc, BIT(gpio), val);
        bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio));
 }
@@ -93,12 +94,15 @@ static void bcma_gpio_irq_mask(struct irq_data *d)
        int gpio = irqd_to_hwirq(d);
 
        bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
+       gpiochip_disable_irq(gc, gpio);
 }
 
-static struct irq_chip bcma_gpio_irq_chip = {
+static const struct irq_chip bcma_gpio_irq_chip = {
        .name           = "BCMA-GPIO",
        .irq_mask       = bcma_gpio_irq_mask,
        .irq_unmask     = bcma_gpio_irq_unmask,
+       .flags          = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id)
@@ -139,7 +143,7 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
        bcma_chipco_gpio_intmask(cc, ~0, 0);
        bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO);
 
-       girq->chip = &bcma_gpio_irq_chip;
+       gpio_irq_chip_set_chip(girq, &bcma_gpio_irq_chip);
        /* This will let us handle the parent IRQ in the driver */
        girq->parent_handler = NULL;
        girq->num_parents = 0;