19 #include <linux/device.h>
21 #include <linux/module.h>
22 #include <linux/slab.h>
25 #define LP8788_INT_1 0x00
26 #define LP8788_INTEN_1 0x03
28 #define BASE_INTEN_ADDR LP8788_INTEN_1
85 static void lp8788_irq_bus_sync_unlock(
struct irq_data *
data)
91 addr = _irq_to_enable_addr(irq);
92 mask = _irq_to_mask(irq);
93 val = _irq_to_val(irq, irqd->
enabled[irq]);
100 static struct irq_chip lp8788_irq_chip = {
102 .irq_enable = lp8788_irq_enable,
103 .irq_disable = lp8788_irq_disable,
104 .irq_bus_lock = lp8788_irq_bus_lock,
105 .irq_bus_sync_unlock = lp8788_irq_bus_sync_unlock,
120 addr = _irq_to_addr(i);
121 mask = _irq_to_mask(i);
124 if (status[addr] & mask) {
133 static int lp8788_irq_map(
struct irq_domain *
d,
unsigned int virq,
141 irq_set_nested_thread(virq, 1);
146 irq_set_noprobe(virq);
153 .map = lp8788_irq_map,
162 dev_warn(lp->
dev,
"invalid irq number: %d\n", irq);
172 &lp8788_domain_ops, irqd);
174 dev_err(lp->
dev,
"failed to add irq domain err\n");
185 dev_err(lp->
dev,
"failed to create a thread for IRQ_N\n");