summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-03-04 06:12:14 +0300
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 14:29:03 +0400
commita7bf4dbabac2a1ccd56527a56c82af720e7a00d1 (patch)
tree176c55c9ea2d545e93bbe9371c29d55bafcfa160 /arch/arm/mach-pxa
parent7a26d3a33fd9adcbfd4fa2ca2d7e8a8272817935 (diff)
downloadlinux-a7bf4dbabac2a1ccd56527a56c82af720e7a00d1.tar.xz
[ARM] pxa: make GPIO IRQ code less dependent on the internal IRQs
by: 1. introduce dedicated pxa_{mask,unmask}_low_gpio() 2. remove set_irq_chip(IRQ_GPIO_2_x, ...) which has already been initialized in pxa_init_irq() 3. introduce dedicated pxa_init_gpio_set_wake() Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/irq.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 381fde66aeeb..ce150bf00bdd 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -166,11 +166,21 @@ static void pxa_ack_low_gpio(unsigned int irq)
GEDR0 = (1 << (irq - IRQ_GPIO0));
}
+static void pxa_mask_low_gpio(unsigned int irq)
+{
+ ICMR &= ~(1 << (irq - PXA_IRQ(0)));
+}
+
+static void pxa_unmask_low_gpio(unsigned int irq)
+{
+ ICMR |= 1 << (irq - PXA_IRQ(0));
+}
+
static struct irq_chip pxa_low_gpio_chip = {
.name = "GPIO-l",
.ack = pxa_ack_low_gpio,
- .mask = pxa_mask_low_irq,
- .unmask = pxa_unmask_low_irq,
+ .mask = pxa_mask_low_gpio,
+ .unmask = pxa_unmask_low_gpio,
.set_type = pxa_gpio_irq_type,
};
@@ -267,20 +277,24 @@ void __init pxa_init_irq_gpio(int gpio_nr)
}
/* Install handler for GPIO>=2 edge detect interrupts */
- set_irq_chip(IRQ_GPIO_2_x, &pxa_internal_chip_low);
set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
pxa_init_gpio(gpio_nr);
}
+void __init pxa_init_gpio_set_wake(int (*set_wake)(unsigned int, unsigned int))
+{
+ pxa_low_gpio_chip.set_wake = set_wake;
+ pxa_muxed_gpio_chip.set_wake = set_wake;
+}
+
void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int))
{
pxa_internal_chip_low.set_wake = set_wake;
#ifdef CONFIG_PXA27x
pxa_internal_chip_high.set_wake = set_wake;
#endif
- pxa_low_gpio_chip.set_wake = set_wake;
- pxa_muxed_gpio_chip.set_wake = set_wake;
+ pxa_init_gpio_set_wake(set_wake);
}
#ifdef CONFIG_PM