16 #include <linux/slab.h>
17 #include <linux/time.h>
22 #define OPB_NR_IRQS 32
24 #define OPB_MLSASIER 0x04
25 #define OPB_MLSIR 0x50
26 #define OPB_MLSIER 0x54
27 #define OPB_MLSIPR 0x58
28 #define OPB_MLSIIR 0x5c
30 static int opb_index = 0;
49 static void opb_unmask_irq(
struct irq_data *
d)
56 bitset = (1 << (31 - irqd_to_hwirq(d)));
64 spin_unlock_irqrestore(&opb->
lock, flags);
67 static void opb_mask_irq(
struct irq_data *
d)
74 mask = ~(1 << (31 - irqd_to_hwirq(d)));
82 spin_unlock_irqrestore(&opb->
lock, flags);
85 static void opb_ack_irq(
struct irq_data *
d)
92 bitset = (1 << (31 - irqd_to_hwirq(d)));
99 spin_unlock_irqrestore(&opb->
lock, flags);
102 static void opb_mask_ack_irq(
struct irq_data *
d)
110 bitset = (1 << (31 - irqd_to_hwirq(d)));
121 spin_unlock_irqrestore(&opb->
lock, flags);
124 static int opb_set_irq_type(
struct irq_data *
d,
unsigned int flow)
155 bit = (1 << (31 - irqd_to_hwirq(d)));
161 ipr = (ipr &
mask) | (invert ? bit : 0);
165 spin_unlock_irqrestore(&opb->
lock, flags);
168 irqd_set_trigger_type(d, flow);
173 static struct irq_chip opb_irq_chip = {
175 .irq_mask = opb_mask_irq,
176 .irq_unmask = opb_unmask_irq,
177 .irq_mask_ack = opb_mask_ack_irq,
178 .irq_ack = opb_ack_irq,
179 .irq_set_type = opb_set_irq_type
182 static int opb_host_map(
struct irq_domain *
host,
unsigned int virq,
209 opb = (
struct opb_pic *)
private;
265 opb->
index = opb_index++;
292 for_each_compatible_node(dn,
NULL,
"ibm,opb") {
304 printk(
"opb: irq_op_parse_and_map failed!\n");
310 "OPB LS Cascade", opb);
312 printk(
"opb: request_irq failed: %d\n", rc);
316 printk(
"OPB%d init with %d IRQs at %p\n", opb->
index,