000e99c333
Make it clear that Orion top-level IRQs are level-triggered. This means that we don't need an ->ack() handler, or at least, we don't need the ->ack() handler (or the acking part of the ->mask_ack() handler) to actually do anything. Given that, we might as well point our ->mask_ack() handler at the ->mask() handler instead of providing a dummy ->ack() handler, since providing a ->mask_ack() handler on level IRQ sources will prevent ->ack() from ever being called. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Acked-by: Russell King <linux@arm.linux.org.uk>
66 lines
1.3 KiB
C
66 lines
1.3 KiB
C
/*
|
|
* arch/arm/plat-orion/irq.c
|
|
*
|
|
* Marvell Orion SoC IRQ handling.
|
|
*
|
|
* This file is licensed under the terms of the GNU General Public
|
|
* License version 2. This program is licensed "as is" without any
|
|
* warranty of any kind, whether express or implied.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/init.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/io.h>
|
|
#include <asm/plat-orion/irq.h>
|
|
|
|
static void orion_irq_mask(u32 irq)
|
|
{
|
|
void __iomem *maskaddr = get_irq_chip_data(irq);
|
|
u32 mask;
|
|
|
|
mask = readl(maskaddr);
|
|
mask &= ~(1 << (irq & 31));
|
|
writel(mask, maskaddr);
|
|
}
|
|
|
|
static void orion_irq_unmask(u32 irq)
|
|
{
|
|
void __iomem *maskaddr = get_irq_chip_data(irq);
|
|
u32 mask;
|
|
|
|
mask = readl(maskaddr);
|
|
mask |= 1 << (irq & 31);
|
|
writel(mask, maskaddr);
|
|
}
|
|
|
|
static struct irq_chip orion_irq_chip = {
|
|
.name = "orion_irq",
|
|
.mask = orion_irq_mask,
|
|
.mask_ack = orion_irq_mask,
|
|
.unmask = orion_irq_unmask,
|
|
};
|
|
|
|
void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
|
|
{
|
|
unsigned int i;
|
|
|
|
/*
|
|
* Mask all interrupts initially.
|
|
*/
|
|
writel(0, maskaddr);
|
|
|
|
/*
|
|
* Register IRQ sources.
|
|
*/
|
|
for (i = 0; i < 32; i++) {
|
|
unsigned int irq = irq_start + i;
|
|
|
|
set_irq_chip(irq, &orion_irq_chip);
|
|
set_irq_chip_data(irq, maskaddr);
|
|
set_irq_handler(irq, handle_level_irq);
|
|
irq_desc[irq].status |= IRQ_LEVEL;
|
|
set_irq_flags(irq, IRQF_VALID);
|
|
}
|
|
}
|