12 #include <linux/export.h>
21 #include <mach/common.h>
24 static inline unsigned int cp_intc_read(
unsigned offset)
29 static inline void cp_intc_write(
unsigned long value,
unsigned offset)
34 static void cp_intc_ack_irq(
struct irq_data *
d)
40 static void cp_intc_mask_irq(
struct irq_data *
d)
49 static void cp_intc_unmask_irq(
struct irq_data *
d)
54 static int cp_intc_set_irq_type(
struct irq_data *
d,
unsigned int flow_type)
93 static int cp_intc_set_wake(
struct irq_data *d,
unsigned int on)
98 static struct irq_chip cp_intc_irq_chip = {
100 .irq_ack = cp_intc_ack_irq,
101 .irq_mask = cp_intc_mask_irq,
102 .irq_unmask = cp_intc_unmask_irq,
103 .irq_set_type = cp_intc_set_irq_type,
104 .irq_set_wake = cp_intc_set_wake,
109 static int cp_intc_host_map(
struct irq_domain *
h,
unsigned int virq,
112 pr_debug(
"cp_intc_host_map(%d, 0x%lx)\n", virq, hw);
121 .map = cp_intc_host_map,
136 if (of_property_read_u32(node,
"ti,intc-size", &num_irq))
137 pr_warn(
"unable to get intc-size, default to %d\n",
151 for (i = 0; i < num_reg; i++)
159 for (i = 0; i < num_reg; i++)
170 num_reg = (num_irq + 3) >> 2;
175 for (k = i = 0; i < num_reg; i++) {
176 for (val = j = 0; j < 4; j++, k++) {
179 val |= irq_prio[
k] << 24;
190 for (i = 0; i < num_reg; i++)
195 for (i = 0; host_map[
i] != -1; i++)
198 irq_base = irq_alloc_descs(-1, 0, num_irq, 0);
200 pr_warn(
"Couldn't allocate IRQ numbers\n");
206 irq_base, 0, &cp_intc_host_ops,
NULL);
208 if (!cp_intc_domain) {
209 pr_err(
"cp_intc: failed to allocate irq host!\n");