diff options
-rw-r--r-- | arch/arm/mach-pxa/generic.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-pxa/generic.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/irq.c | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/irqs.h | 6 |
4 files changed, 5 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 1c5413fc6e74..eed95eaf58cd 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -71,6 +71,7 @@ EXPORT_SYMBOL(get_memclk_frequency_10khz); | |||
71 | /* | 71 | /* |
72 | * Handy function to set GPIO alternate functions | 72 | * Handy function to set GPIO alternate functions |
73 | */ | 73 | */ |
74 | int pxa_last_gpio; | ||
74 | 75 | ||
75 | int pxa_gpio_mode(int gpio_mode) | 76 | int pxa_gpio_mode(int gpio_mode) |
76 | { | 77 | { |
@@ -79,7 +80,7 @@ int pxa_gpio_mode(int gpio_mode) | |||
79 | int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8; | 80 | int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8; |
80 | int gafr; | 81 | int gafr; |
81 | 82 | ||
82 | if (gpio > PXA_LAST_GPIO) | 83 | if (gpio > pxa_last_gpio) |
83 | return -EINVAL; | 84 | return -EINVAL; |
84 | 85 | ||
85 | local_irq_save(flags); | 86 | local_irq_save(flags); |
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index 5b11741cccff..25bd9bf727b6 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -20,6 +20,7 @@ extern void __init pxa27x_init_irq(void); | |||
20 | extern void __init pxa_map_io(void); | 20 | extern void __init pxa_map_io(void); |
21 | 21 | ||
22 | extern unsigned int get_clk_frequency_khz(int info); | 22 | extern unsigned int get_clk_frequency_khz(int info); |
23 | extern int pxa_last_gpio; | ||
23 | 24 | ||
24 | #define SET_BANK(__nr,__start,__size) \ | 25 | #define SET_BANK(__nr,__start,__size) \ |
25 | mi->bank[__nr].start = (__start), \ | 26 | mi->bank[__nr].start = (__start), \ |
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index ae2ae08032d7..3d95442d4168 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c | |||
@@ -349,6 +349,8 @@ void __init pxa_init_irq_gpio(int gpio_nr) | |||
349 | { | 349 | { |
350 | int irq, i; | 350 | int irq, i; |
351 | 351 | ||
352 | pxa_last_gpio = gpio_nr - 1; | ||
353 | |||
352 | /* clear all GPIO edge detects */ | 354 | /* clear all GPIO edge detects */ |
353 | for (i = 0; i < gpio_nr; i += 32) { | 355 | for (i = 0; i < gpio_nr; i += 32) { |
354 | GFER(i) = 0; | 356 | GFER(i) = 0; |
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h index a07fe0f928cd..1bcc7632b46c 100644 --- a/include/asm-arm/arch-pxa/irqs.h +++ b/include/asm-arm/arch-pxa/irqs.h | |||
@@ -66,12 +66,6 @@ | |||
66 | #define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE) | 66 | #define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE) |
67 | #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) | 67 | #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) |
68 | 68 | ||
69 | #if defined(CONFIG_PXA25x) | ||
70 | #define PXA_LAST_GPIO 84 | ||
71 | #elif defined(CONFIG_PXA27x) | ||
72 | #define PXA_LAST_GPIO 127 | ||
73 | #endif | ||
74 | |||
75 | /* | 69 | /* |
76 | * The next 16 interrupts are for board specific purposes. Since | 70 | * The next 16 interrupts are for board specific purposes. Since |
77 | * the kernel can only run on one machine at a time, we can re-use | 71 | * the kernel can only run on one machine at a time, we can re-use |