14 #include <linux/device.h>
100 irq_to_max8998_irq(
struct max8998_dev *max8998,
int irq)
102 return &max8998_irqs[irq - max8998->
irq_base];
107 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
112 static void max8998_irq_sync_unlock(
struct irq_data *
data)
114 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
132 static void max8998_irq_unmask(
struct irq_data *data)
134 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
141 static void max8998_irq_mask(
struct irq_data *data)
143 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
150 static struct irq_chip max8998_irq_chip = {
152 .irq_bus_lock = max8998_irq_lock,
153 .irq_bus_sync_unlock = max8998_irq_sync_unlock,
154 .irq_mask = max8998_irq_mask,
155 .irq_unmask = max8998_irq_unmask,
158 static irqreturn_t max8998_irq_thread(
int irq,
void *data)
168 dev_err(max8998->
dev,
"Failed to read interrupt register: %d\n",
179 if (irq_reg[max8998_irqs[i].
reg - 1] & max8998_irqs[i].
mask)
189 max8998_irq_thread(max8998->
irq_base, max8998);
201 "No interrupt specified, no interrupts\n");
208 "No interrupt base specified, no interrupts\n");
228 irq_set_chip_and_handler(cur_irq, &max8998_irq_chip,
230 irq_set_nested_thread(cur_irq, 1);
234 irq_set_noprobe(cur_irq);
240 "max8998-irq", max8998);
242 dev_err(max8998->
dev,
"Failed to request IRQ %d: %d\n",
254 dev_err(max8998->
dev,
"Failed to request IRQ %d: %d\n",