14 #define DRV_MODULE_NAME "flipper-pic"
15 #define pr_fmt(fmt) DRV_MODULE_NAME ": " fmt
17 #include <linux/kernel.h>
25 #define FLIPPER_NR_IRQS 32
36 #define FLIPPER_ICR 0x00
37 #define FLIPPER_ICR_RSS (1<<16)
39 #define FLIPPER_IMR 0x04
41 #define FLIPPER_RESET 0x24
49 static void flipper_pic_mask_and_ack(
struct irq_data *
d)
51 int irq = irqd_to_hwirq(d);
60 static void flipper_pic_ack(
struct irq_data *
d)
62 int irq = irqd_to_hwirq(d);
69 static void flipper_pic_mask(
struct irq_data *
d)
71 int irq = irqd_to_hwirq(d);
77 static void flipper_pic_unmask(
struct irq_data *
d)
79 int irq = irqd_to_hwirq(d);
86 static struct irq_chip flipper_pic = {
87 .name =
"flipper-pic",
88 .irq_ack = flipper_pic_ack,
89 .irq_mask_ack = flipper_pic_mask_and_ack,
90 .irq_mask = flipper_pic_mask,
91 .irq_unmask = flipper_pic_unmask,
101 static int flipper_pic_map(
struct irq_domain *
h,
unsigned int virq,
117 .map = flipper_pic_map,
118 .match = flipper_pic_match,
143 pr_err(
"no parent found\n");
147 pr_err(
"unexpected parent compatible\n");
153 pr_err(
"no io memory range found\n");
158 pr_info(
"controller at 0x%08x mapped to 0x%p\n", res.
start, io_base);
160 __flipper_quiesce(io_base);
163 &flipper_irq_domain_ops, io_base);
165 pr_err(
"failed to allocate irq_domain\n");
184 irq =
__ffs(irq_status);
201 BUG_ON(!flipper_irq_host);
223 __flipper_quiesce(io_base);
233 if (flipper_irq_host && flipper_irq_host->
host_data) {
247 if (flipper_irq_host && flipper_irq_host->
host_data) {