aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-12-18 23:50:28 -0500
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2008-01-25 02:31:44 -0500
commite4f586f280bbfa05c68f99df2db981356ee30533 (patch)
treecfe3e267be1bea797ed881582d55fd5de443a8f3 /arch/avr32
parente7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9 (diff)
[AVR32] extint: change set_irq_type() handling
Update the AVR32 EIC code to use the new __set_irq_handler_unlocked() call, getting rid of one more instance of this widespread problem. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/mach-at32ap/extint.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c
index e108e7bba8c0..81a4a02f5f42 100644
--- a/arch/avr32/mach-at32ap/extint.c
+++ b/arch/avr32/mach-at32ap/extint.c
@@ -130,8 +130,11 @@ static int eic_set_irq_type(unsigned int irq, unsigned int flow_type)
130 eic_writel(eic, EDGE, edge); 130 eic_writel(eic, EDGE, edge);
131 eic_writel(eic, LEVEL, level); 131 eic_writel(eic, LEVEL, level);
132 132
133 if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 133 if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) {
134 flow_type |= IRQ_LEVEL; 134 flow_type |= IRQ_LEVEL;
135 __set_irq_handler_unlocked(irq, handle_level_irq);
136 } else
137 __set_irq_handler_unlocked(irq, handle_edge_irq);
135 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); 138 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
136 desc->status |= flow_type; 139 desc->status |= flow_type;
137 } 140 }
@@ -151,9 +154,8 @@ static struct irq_chip eic_chip = {
151static void demux_eic_irq(unsigned int irq, struct irq_desc *desc) 154static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
152{ 155{
153 struct eic *eic = desc->handler_data; 156 struct eic *eic = desc->handler_data;
154 struct irq_desc *ext_desc;
155 unsigned long status, pending; 157 unsigned long status, pending;
156 unsigned int i, ext_irq; 158 unsigned int i;
157 159
158 status = eic_readl(eic, ISR); 160 status = eic_readl(eic, ISR);
159 pending = status & eic_readl(eic, IMR); 161 pending = status & eic_readl(eic, IMR);
@@ -162,12 +164,7 @@ static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
162 i = fls(pending) - 1; 164 i = fls(pending) - 1;
163 pending &= ~(1 << i); 165 pending &= ~(1 << i);
164 166
165 ext_irq = i + eic->first_irq; 167 generic_handle_irq(i + eic->first_irq);
166 ext_desc = irq_desc + ext_irq;
167 if (ext_desc->status & IRQ_LEVEL)
168 handle_level_irq(ext_irq, ext_desc);
169 else
170 handle_edge_irq(ext_irq, ext_desc);
171 } 168 }
172} 169}
173 170
@@ -236,9 +233,8 @@ static int __init eic_probe(struct platform_device *pdev)
236 eic->chip = &eic_chip; 233 eic->chip = &eic_chip;
237 234
238 for (i = 0; i < nr_irqs; i++) { 235 for (i = 0; i < nr_irqs; i++) {
239 /* NOTE the handler we set here is ignored by the demux */
240 set_irq_chip_and_handler(eic->first_irq + i, &eic_chip, 236 set_irq_chip_and_handler(eic->first_irq + i, &eic_chip,
241 handle_level_irq); 237 handle_edge_irq);
242 set_irq_chip_data(eic->first_irq + i, eic); 238 set_irq_chip_data(eic->first_irq + i, eic);
243 } 239 }
244 240