sa1111.c (22a3e233ca08a2ddc949ba1ae8f6e16ec7ef1a13) sa1111.c (c4bfa28aec58c588de55babe99f4c172ec534704)
1/*
2 * linux/arch/arm/mach-sa1100/sa1111.c
3 *
4 * SA1111 support
5 *
6 * Original code by John Dorsey
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 136 unchanged lines hidden (view full) ---

145 * SA1111 interrupt support. Since clearing an IRQ while there are
146 * active IRQs causes the interrupt output to pulse, the upper levels
147 * will call us again if there are more interrupts to process.
148 */
149static void
150sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
151{
152 unsigned int stat0, stat1, i;
1/*
2 * linux/arch/arm/mach-sa1100/sa1111.c
3 *
4 * SA1111 support
5 *
6 * Original code by John Dorsey
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 136 unchanged lines hidden (view full) ---

145 * SA1111 interrupt support. Since clearing an IRQ while there are
146 * active IRQs causes the interrupt output to pulse, the upper levels
147 * will call us again if there are more interrupts to process.
148 */
149static void
150sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
151{
152 unsigned int stat0, stat1, i;
153 void __iomem *base = desc->data;
153 void __iomem *base = get_irq_data(irq);
154
155 stat0 = sa1111_readl(base + SA1111_INTSTATCLR0);
156 stat1 = sa1111_readl(base + SA1111_INTSTATCLR1);
157
158 sa1111_writel(stat0, base + SA1111_INTSTATCLR0);
159
160 desc->chip->ack(irq);
161
162 sa1111_writel(stat1, base + SA1111_INTSTATCLR1);
163
164 if (stat0 == 0 && stat1 == 0) {
165 do_bad_IRQ(irq, desc, regs);
166 return;
167 }
168
169 for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1)
170 if (stat0 & 1)
154
155 stat0 = sa1111_readl(base + SA1111_INTSTATCLR0);
156 stat1 = sa1111_readl(base + SA1111_INTSTATCLR1);
157
158 sa1111_writel(stat0, base + SA1111_INTSTATCLR0);
159
160 desc->chip->ack(irq);
161
162 sa1111_writel(stat1, base + SA1111_INTSTATCLR1);
163
164 if (stat0 == 0 && stat1 == 0) {
165 do_bad_IRQ(irq, desc, regs);
166 return;
167 }
168
169 for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1)
170 if (stat0 & 1)
171 do_edge_IRQ(i, irq_desc + i, regs);
171 handle_edge_irq(i, irq_desc + i, regs);
172
173 for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1)
174 if (stat1 & 1)
172
173 for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1)
174 if (stat1 & 1)
175 do_edge_IRQ(i, irq_desc + i, regs);
175 handle_edge_irq(i, irq_desc + i, regs);
176
177 /* For level-based interrupts */
178 desc->chip->unmask(irq);
179}
180
181#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START))
182#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32))
183

--- 1112 unchanged lines hidden ---
176
177 /* For level-based interrupts */
178 desc->chip->unmask(irq);
179}
180
181#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START))
182#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32))
183

--- 1112 unchanged lines hidden ---