16 #include <linux/kernel.h>
17 #include <linux/module.h>
20 #include <linux/device.h>
48 switch (tps65910_chip_id(tps65910)) {
58 switch (tps65910_chip_id(tps65910)) {
61 irq_mask |= reg << 16;
69 for (i = 0; i < tps65910->
irq_num; i++) {
71 if (!(irq_sts & (1 << i)))
83 switch (tps65910_chip_id(tps65910)) {
92 static void tps65910_irq_lock(
struct irq_data *
data)
94 struct tps65910 *tps65910 = irq_data_get_irq_chip_data(data);
99 static void tps65910_irq_sync_unlock(
struct irq_data *
data)
101 struct tps65910 *tps65910 = irq_data_get_irq_chip_data(data);
108 reg_mask |= reg << 8;
109 switch (tps65910_chip_id(tps65910)) {
112 reg_mask |= reg << 16;
115 if (tps65910->
irq_mask != reg_mask) {
118 reg = tps65910->
irq_mask >> 8 & 0xFF;
120 switch (tps65910_chip_id(tps65910)) {
129 static void tps65910_irq_enable(
struct irq_data *data)
131 struct tps65910 *tps65910 = irq_data_get_irq_chip_data(data);
136 static void tps65910_irq_disable(
struct irq_data *data)
138 struct tps65910 *tps65910 = irq_data_get_irq_chip_data(data);
143 #ifdef CONFIG_PM_SLEEP
146 struct tps65910 *tps65910 = irq_data_get_irq_chip_data(data);
150 #define tps65910_irq_set_wake NULL
153 static struct irq_chip tps65910_irq_chip = {
155 .irq_bus_lock = tps65910_irq_lock,
156 .irq_bus_sync_unlock = tps65910_irq_sync_unlock,
157 .irq_disable = tps65910_irq_disable,
158 .irq_enable = tps65910_irq_enable,
162 static int tps65910_irq_map(
struct irq_domain *
h,
unsigned int virq,
165 struct tps65910 *tps65910 = h->
host_data;
169 irq_set_nested_thread(virq, 1);
176 irq_set_noprobe(virq);
183 .map = tps65910_irq_map,
194 dev_warn(tps65910->
dev,
"No interrupt support, no core IRQ\n");
199 dev_warn(tps65910->
dev,
"No interrupt support, no pdata\n");
203 switch (tps65910_chip_id(tps65910)) {
216 dev_warn(tps65910->
dev,
"Failed to alloc IRQs: %d\n",
233 &tps65910_domain_ops, tps65910);
237 &tps65910_domain_ops, tps65910);
240 dev_err(tps65910->
dev,
"Failed to create IRQ domain\n");
245 "tps65910", tps65910);
250 dev_err(tps65910->
dev,
"Failed to request IRQ: %d\n", ret);