aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/irq.c
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-03-03 22:12:14 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:03 -0400
commita7bf4dbabac2a1ccd56527a56c82af720e7a00d1 (patch)
tree176c55c9ea2d545e93bbe9371c29d55bafcfa160 /arch/arm/mach-pxa/irq.c
parent7a26d3a33fd9adcbfd4fa2ca2d7e8a8272817935 (diff)
[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/irq.c')
-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)
166 GEDR0 = (1 << (irq - IRQ_GPIO0)); 166 GEDR0 = (1 << (irq - IRQ_GPIO0));
167} 167}
168 168
169static void pxa_mask_low_gpio(unsigned int irq)
170{
171 ICMR &= ~(1 << (irq - PXA_IRQ(0)));
172}
173
174static void pxa_unmask_low_gpio(unsigned int irq)
175{
176 ICMR |= 1 << (irq - PXA_IRQ(0));
177}
178
169static struct irq_chip pxa_low_gpio_chip = { 179static struct irq_chip pxa_low_gpio_chip = {
170 .name = "GPIO-l", 180 .name = "GPIO-l",
171 .ack = pxa_ack_low_gpio, 181 .ack = pxa_ack_low_gpio,
172 .mask = pxa_mask_low_irq, 182 .mask = pxa_mask_low_gpio,
173 .unmask = pxa_unmask_low_irq, 183 .unmask = pxa_unmask_low_gpio,
174 .set_type = pxa_gpio_irq_type, 184 .set_type = pxa_gpio_irq_type,
175}; 185};
176 186
@@ -267,20 +277,24 @@ void __init pxa_init_irq_gpio(int gpio_nr)
267 } 277 }
268 278
269 /* Install handler for GPIO>=2 edge detect interrupts */ 279 /* Install handler for GPIO>=2 edge detect interrupts */
270 set_irq_chip(IRQ_GPIO_2_x, &pxa_internal_chip_low);
271 set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler); 280 set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
272 281
273 pxa_init_gpio(gpio_nr); 282 pxa_init_gpio(gpio_nr);
274} 283}
275 284
285void __init pxa_init_gpio_set_wake(int (*set_wake)(unsigned int, unsigned int))
286{
287 pxa_low_gpio_chip.set_wake = set_wake;
288 pxa_muxed_gpio_chip.set_wake = set_wake;
289}
290
276void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int)) 291void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int))
277{ 292{
278 pxa_internal_chip_low.set_wake = set_wake; 293 pxa_internal_chip_low.set_wake = set_wake;
279#ifdef CONFIG_PXA27x 294#ifdef CONFIG_PXA27x
280 pxa_internal_chip_high.set_wake = set_wake; 295 pxa_internal_chip_high.set_wake = set_wake;
281#endif 296#endif
282 pxa_low_gpio_chip.set_wake = set_wake; 297 pxa_init_gpio_set_wake(set_wake);
283 pxa_muxed_gpio_chip.set_wake = set_wake;
284} 298}
285 299
286#ifdef CONFIG_PM 300#ifdef CONFIG_PM