23 static void shirq_irq_mask(
struct irq_data *
d)
25 struct spear_shirq *shirq = irq_data_get_irq_chip_data(d);
29 if ((shirq->
regs.enb_reg == -1) || shirq->
dev_config[
id].enb_mask == -1)
34 if (shirq->
regs.reset_to_enb)
39 spin_unlock_irqrestore(&lock, flags);
42 static void shirq_irq_unmask(
struct irq_data *d)
44 struct spear_shirq *shirq = irq_data_get_irq_chip_data(d);
48 if ((shirq->
regs.enb_reg == -1) || shirq->
dev_config[
id].enb_mask == -1)
53 if (shirq->
regs.reset_to_enb)
58 spin_unlock_irqrestore(&lock, flags);
61 static struct irq_chip shirq_chip = {
62 .name =
"spear_shirq",
63 .irq_ack = shirq_irq_mask,
64 .irq_mask = shirq_irq_mask,
65 .irq_unmask = shirq_irq_unmask,
68 static void shirq_handler(
unsigned irq,
struct irq_desc *
desc)
71 struct spear_shirq *shirq = irq_get_handler_data(irq);
74 while ((val =
readl(shirq->
regs.base + shirq->
regs.status_reg) &
75 shirq->
regs.status_reg_mask)) {
76 for (i = 0; (i < shirq->
dev_count) && val; i++) {
84 if ((shirq->
regs.clear_reg == -1) ||
88 if (shirq->
regs.reset_to_clear)
108 irq_set_chained_handler(shirq->
irq, shirq_handler);
110 irq_set_chip_and_handler(shirq->
dev_config[i].virq,