From 440c19bc8930c225e7c90d8de4fb433dc659e050 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Wed, 6 Jun 2007 06:32:38 +0100 Subject: [PATCH] --- yaml --- r: 59259 b: refs/heads/master c: c08b7b3ef6bf489ddabadc03e050f3db2ea44b5d h: refs/heads/master i: 59257: c4002f15751715d3db84700cc2e63b533cf91d56 59255: 6fca2642a54c7493a6c8f9ae58df38e3042d6880 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-pxa/irq.c | 26 ++++++++++++++++---------- trunk/include/asm-arm/arch-pxa/irqs.h | 15 ++++++--------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index 439f5281d549..13df0d875f0e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 486c955118dbbb0f13dc4d40cc5dac2b23f82676 +refs/heads/master: c08b7b3ef6bf489ddabadc03e050f3db2ea44b5d diff --git a/trunk/arch/arm/mach-pxa/irq.c b/trunk/arch/arm/mach-pxa/irq.c index 45ce711f0472..844d3de3ef44 100644 --- a/trunk/arch/arm/mach-pxa/irq.c +++ b/trunk/arch/arm/mach-pxa/irq.c @@ -67,7 +67,7 @@ static struct irq_chip pxa_internal_chip_low = { .set_wake = pxa_set_wake, }; -#if PXA_INTERNAL_IRQS > 32 +#ifdef CONFIG_PXA27x /* * This is for the second set of internal IRQs as found on the PXA27x. @@ -90,6 +90,19 @@ static struct irq_chip pxa_internal_chip_high = { .unmask = pxa_unmask_high_irq, }; +void __init pxa_init_irq_high(void) +{ + int irq; + + ICMR2 = 0; + ICLR2 = 0; + + for (irq = PXA_IRQ(32); irq < PXA_IRQ(64); irq++) { + set_irq_chip(irq, &pxa_internal_chip_high); + set_irq_handler(irq, handle_level_irq); + set_irq_flags(irq, IRQF_VALID); + } +} #endif /* Note that if an input/irq line ever gets changed to an output during @@ -314,7 +327,6 @@ static struct irq_chip pxa_muxed_gpio_chip = { .set_wake = pxa_set_gpio_wake, }; - void __init pxa_init_irq(void) { int irq; @@ -338,8 +350,6 @@ void __init pxa_init_irq(void) #ifdef CONFIG_PXA27x /* And similarly for the extra regs on the PXA27x */ - ICMR2 = 0; - ICLR2 = 0; GFER3 = 0; GRER3 = 0; GEDR3 = GEDR3; @@ -357,12 +367,8 @@ void __init pxa_init_irq(void) set_irq_flags(irq, IRQF_VALID); } -#if PXA_INTERNAL_IRQS > 32 - for (irq = PXA_IRQ(32); irq < PXA_IRQ(PXA_INTERNAL_IRQS); irq++) { - set_irq_chip(irq, &pxa_internal_chip_high); - set_irq_handler(irq, handle_level_irq); - set_irq_flags(irq, IRQF_VALID); - } +#ifdef CONFIG_PXA27x + pxa_init_irq_high(); #endif for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) { diff --git a/trunk/include/asm-arm/arch-pxa/irqs.h b/trunk/include/asm-arm/arch-pxa/irqs.h index dc4e7548b7d5..a07fe0f928cd 100644 --- a/trunk/include/asm-arm/arch-pxa/irqs.h +++ b/trunk/include/asm-arm/arch-pxa/irqs.h @@ -55,18 +55,15 @@ #ifdef CONFIG_PXA27x #define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ #define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ - -#define PXA_INTERNAL_IRQS 34 -#else -#define PXA_INTERNAL_IRQS 32 #endif -#define GPIO_2_x_TO_IRQ(x) \ - PXA_IRQ((x) - 2 + PXA_INTERNAL_IRQS) +#define PXA_GPIO_IRQ_BASE (64) +#define PXA_GPIO_IRQ_NUM (128) + +#define GPIO_2_x_TO_IRQ(x) (PXA_GPIO_IRQ_BASE + (x)) #define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x)) -#define IRQ_TO_GPIO_2_x(i) \ - ((i) - IRQ_GPIO(2) + 2) +#define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE) #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) #if defined(CONFIG_PXA25x) @@ -81,7 +78,7 @@ * these. If you need more, increase IRQ_BOARD_END, but keep it * within sensible limits. */ -#define IRQ_BOARD_START (IRQ_GPIO(PXA_LAST_GPIO) + 1) +#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM) #define IRQ_BOARD_END (IRQ_BOARD_START + 16) #define IRQ_SA1111_START (IRQ_BOARD_END)