mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
[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>
This commit is contained in:
parent
e7ba176b47
commit
e4f586f280
1 changed files with 7 additions and 11 deletions
|
@ -130,8 +130,11 @@ static int eic_set_irq_type(unsigned int irq, unsigned int flow_type)
|
||||||
eic_writel(eic, EDGE, edge);
|
eic_writel(eic, EDGE, edge);
|
||||||
eic_writel(eic, LEVEL, level);
|
eic_writel(eic, LEVEL, level);
|
||||||
|
|
||||||
if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
|
if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) {
|
||||||
flow_type |= IRQ_LEVEL;
|
flow_type |= IRQ_LEVEL;
|
||||||
|
__set_irq_handler_unlocked(irq, handle_level_irq);
|
||||||
|
} else
|
||||||
|
__set_irq_handler_unlocked(irq, handle_edge_irq);
|
||||||
desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
|
desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
|
||||||
desc->status |= flow_type;
|
desc->status |= flow_type;
|
||||||
}
|
}
|
||||||
|
@ -151,9 +154,8 @@ static struct irq_chip eic_chip = {
|
||||||
static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
|
static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
|
||||||
{
|
{
|
||||||
struct eic *eic = desc->handler_data;
|
struct eic *eic = desc->handler_data;
|
||||||
struct irq_desc *ext_desc;
|
|
||||||
unsigned long status, pending;
|
unsigned long status, pending;
|
||||||
unsigned int i, ext_irq;
|
unsigned int i;
|
||||||
|
|
||||||
status = eic_readl(eic, ISR);
|
status = eic_readl(eic, ISR);
|
||||||
pending = status & eic_readl(eic, IMR);
|
pending = status & eic_readl(eic, IMR);
|
||||||
|
@ -162,12 +164,7 @@ static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
|
||||||
i = fls(pending) - 1;
|
i = fls(pending) - 1;
|
||||||
pending &= ~(1 << i);
|
pending &= ~(1 << i);
|
||||||
|
|
||||||
ext_irq = i + eic->first_irq;
|
generic_handle_irq(i + eic->first_irq);
|
||||||
ext_desc = irq_desc + ext_irq;
|
|
||||||
if (ext_desc->status & IRQ_LEVEL)
|
|
||||||
handle_level_irq(ext_irq, ext_desc);
|
|
||||||
else
|
|
||||||
handle_edge_irq(ext_irq, ext_desc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,9 +233,8 @@ static int __init eic_probe(struct platform_device *pdev)
|
||||||
eic->chip = &eic_chip;
|
eic->chip = &eic_chip;
|
||||||
|
|
||||||
for (i = 0; i < nr_irqs; i++) {
|
for (i = 0; i < nr_irqs; i++) {
|
||||||
/* NOTE the handler we set here is ignored by the demux */
|
|
||||||
set_irq_chip_and_handler(eic->first_irq + i, &eic_chip,
|
set_irq_chip_and_handler(eic->first_irq + i, &eic_chip,
|
||||||
handle_level_irq);
|
handle_edge_irq);
|
||||||
set_irq_chip_data(eic->first_irq + i, eic);
|
set_irq_chip_data(eic->first_irq + i, eic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue