16 #include <linux/kernel.h>
17 #include <linux/module.h>
20 #include <linux/device.h>
64 irq_mask |= reg << 16;
66 irq_mask |= reg << 24;
72 for (i = 0; i < tps65912->
irq_num; i++) {
73 if (!(irq_sts & (1 << i)))
99 static void tps65912_irq_lock(
struct irq_data *
data)
101 struct tps65912 *tps65912 = irq_data_get_irq_chip_data(data);
106 static void tps65912_irq_sync_unlock(
struct irq_data *
data)
108 struct tps65912 *tps65912 = irq_data_get_irq_chip_data(data);
115 reg_mask |= reg << 8;
117 reg_mask |= reg << 16;
119 reg_mask |= reg << 24;
121 if (tps65912->
irq_mask != reg_mask) {
124 reg = tps65912->
irq_mask >> 8 & 0xFF;
126 reg = tps65912->
irq_mask >> 16 & 0xFF;
128 reg = tps65912->
irq_mask >> 24 & 0xFF;
135 static void tps65912_irq_enable(
struct irq_data *data)
137 struct tps65912 *tps65912 = irq_data_get_irq_chip_data(data);
139 tps65912->
irq_mask &= ~(1 << irq_to_tps65912_irq(tps65912, data->
irq));
142 static void tps65912_irq_disable(
struct irq_data *data)
144 struct tps65912 *tps65912 = irq_data_get_irq_chip_data(data);
146 tps65912->
irq_mask |= (1 << irq_to_tps65912_irq(tps65912, data->
irq));
149 static struct irq_chip tps65912_irq_chip = {
151 .irq_bus_lock = tps65912_irq_lock,
152 .irq_bus_sync_unlock = tps65912_irq_sync_unlock,
153 .irq_disable = tps65912_irq_disable,
154 .irq_enable = tps65912_irq_enable,
165 dev_warn(tps65912->
dev,
"No interrupt support, no core IRQ\n");
170 dev_warn(tps65912->
dev,
"No interrupt support, no IRQ base\n");
195 cur_irq < tps65912->irq_num + tps65912->
irq_base;
198 irq_set_chip_and_handler(cur_irq, &tps65912_irq_chip,
200 irq_set_nested_thread(cur_irq, 1);
206 irq_set_noprobe(cur_irq);
211 "tps65912", tps65912);
215 dev_err(tps65912->
dev,
"Failed to request IRQ: %d\n", ret);