Lines Matching +full:num +full:- +full:irqs
6 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
101 .name = "BCMA-GPIO",
111 struct gpio_chip *gc = &cc->gpio; in bcma_gpio_irq_handler()
115 unsigned long irqs = (val ^ pol) & mask; in bcma_gpio_irq_handler() local
118 if (!irqs) in bcma_gpio_irq_handler()
121 for_each_set_bit(gpio, &irqs, gc->ngpio) in bcma_gpio_irq_handler()
122 generic_handle_domain_irq_safe(gc->irq.domain, gpio); in bcma_gpio_irq_handler()
123 bcma_chipco_gpio_polarity(cc, irqs, val & irqs); in bcma_gpio_irq_handler()
130 struct gpio_chip *chip = &cc->gpio; in bcma_gpio_irq_init()
131 struct gpio_irq_chip *girq = &chip->irq; in bcma_gpio_irq_init()
134 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC) in bcma_gpio_irq_init()
137 hwirq = bcma_core_irq(cc->core, 0); in bcma_gpio_irq_init()
148 girq->parent_handler = NULL; in bcma_gpio_irq_init()
149 girq->num_parents = 0; in bcma_gpio_irq_init()
150 girq->parents = NULL; in bcma_gpio_irq_init()
151 girq->default_type = IRQ_TYPE_NONE; in bcma_gpio_irq_init()
152 girq->handler = handle_simple_irq; in bcma_gpio_irq_init()
159 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC) in bcma_gpio_irq_exit()
163 free_irq(bcma_core_irq(cc->core, 0), cc); in bcma_gpio_irq_exit()
178 struct bcma_bus *bus = cc->core->bus; in bcma_gpio_init()
179 struct gpio_chip *chip = &cc->gpio; in bcma_gpio_init()
182 chip->label = "bcma_gpio"; in bcma_gpio_init()
183 chip->owner = THIS_MODULE; in bcma_gpio_init()
184 chip->request = bcma_gpio_request; in bcma_gpio_init()
185 chip->free = bcma_gpio_free; in bcma_gpio_init()
186 chip->get = bcma_gpio_get_value; in bcma_gpio_init()
187 chip->set = bcma_gpio_set_value; in bcma_gpio_init()
188 chip->direction_input = bcma_gpio_direction_input; in bcma_gpio_init()
189 chip->direction_output = bcma_gpio_direction_output; in bcma_gpio_init()
190 chip->parent = bus->dev; in bcma_gpio_init()
191 chip->fwnode = dev_fwnode(&cc->core->dev); in bcma_gpio_init()
193 switch (bus->chipinfo.id) { in bcma_gpio_init()
199 chip->ngpio = 32; in bcma_gpio_init()
202 chip->ngpio = 16; in bcma_gpio_init()
213 cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC) in bcma_gpio_init()
214 chip->base = bus->num * BCMA_GPIO_MAX_PINS; in bcma_gpio_init()
216 chip->base = -1; in bcma_gpio_init()
234 gpiochip_remove(&cc->gpio); in bcma_gpio_unregister()