24 #include <linux/kernel.h>
25 #include <linux/module.h>
70 return &twl6040_irqs[irq - twl6040->
irq_base];
80 static void twl6040_irq_sync_unlock(
struct irq_data *
data)
94 static void twl6040_irq_enable(
struct irq_data *data)
96 struct twl6040 *twl6040 = irq_data_get_irq_chip_data(data);
103 static void twl6040_irq_disable(
struct irq_data *data)
105 struct twl6040 *twl6040 = irq_data_get_irq_chip_data(data);
112 static struct irq_chip twl6040_irq_chip = {
114 .irq_bus_lock = twl6040_irq_lock,
115 .irq_bus_sync_unlock = twl6040_irq_sync_unlock,
116 .irq_enable = twl6040_irq_enable,
117 .irq_disable = twl6040_irq_disable,
120 static irqreturn_t twl6040_irq_thread(
int irq,
void *data)
122 struct twl6040 *twl6040 =
data;
129 for (i =
ARRAY_SIZE(twl6040_irqs) - 1; i >= 0; i--) {
131 intid &= ~twl6040_irqs[
i].
status;
132 if (intid & twl6040_irqs[i].
status)
157 irq_base = irq_alloc_descs(-1, 0, nr_irqs, 0);
159 dev_err(twl6040->
dev,
"Fail to allocate IRQ descs\n");
168 for (i = irq_base; i < irq_base +
nr_irqs; i++) {
170 irq_set_chip_and_handler(i, &twl6040_irq_chip,
172 irq_set_nested_thread(i, 1);
186 dev_err(twl6040->
dev,
"failed to request IRQ %d: %d\n",