summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-11-26 17:06:42 +0800
committerEric Miao <eric.miao@marvell.com>2008-12-02 14:42:36 +0800
commitddd244dd814ee3e5ef1e4872705cbec0dfced541 (patch)
tree6966184be36d2ba68fc6254182c9dc6574f16b4b /arch
parent9968711468570c5dc5f96c415e73cb3282e857fc (diff)
[ARM] pxa: use 'pxa_last_gpio' instead of 'gpio_nr' in mfp-pxa2xx.c
The 'gpio_nr' can really be inferred by 'pxa_last_gpio', and since we already have that variable, remove the unnecessary 'gpio_nr' now. Also, fix the incorrect GPIO number passed in pxa27x_init_irq(). Note: pxa_last_gpio should be initialized earlier, and this is true since it's been assigned in machine_desc->init_irq(). Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c14
-rw-r--r--arch/arm/mach-pxa/pxa27x.c2
2 files changed, 6 insertions, 10 deletions
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index 28d10679e225..1f2298759077 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -44,7 +44,6 @@ struct gpio_desc {
};
static struct gpio_desc gpio_desc[MFP_PIN_GPIO127 + 1];
-static int gpio_nr;
static unsigned long gpdr_lpm[4];
@@ -215,15 +214,13 @@ static void __init pxa25x_mfp_init(void)
{
int i;
- for (i = 0; i <= 84; i++)
+ for (i = 0; i <= pxa_last_gpio; i++)
gpio_desc[i].valid = 1;
for (i = 0; i <= 15; i++) {
gpio_desc[i].can_wakeup = 1;
gpio_desc[i].mask = GPIO_bit(i);
}
-
- gpio_nr = 85;
}
#else
static inline void pxa25x_mfp_init(void) {}
@@ -276,7 +273,7 @@ static void __init pxa27x_mfp_init(void)
{
int i, gpio;
- for (i = 0; i <= 120; i++) {
+ for (i = 0; i <= pxa_last_gpio; i++) {
/* skip GPIO2, 5, 6, 7, 8, they are not
* valid pins allow configuration
*/
@@ -313,7 +310,6 @@ static void __init pxa27x_mfp_init(void)
INIT_GPIO_DESC_MUXED(WEMUX2, 53);
INIT_GPIO_DESC_MUXED(WEMUX2, 40);
INIT_GPIO_DESC_MUXED(WEMUX2, 36);
- gpio_nr = 121;
}
#else
static inline void pxa27x_mfp_init(void) {}
@@ -327,7 +323,7 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
{
int i;
- for (i = 0; i <= gpio_to_bank(gpio_nr); i++) {
+ for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
saved_gafr[0][i] = GAFR_L(i);
saved_gafr[1][i] = GAFR_U(i);
@@ -342,7 +338,7 @@ static int pxa2xx_mfp_resume(struct sys_device *d)
{
int i;
- for (i = 0; i <= gpio_to_bank(gpio_nr); i++) {
+ for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
GAFR_L(i) = saved_gafr[0][i];
GAFR_U(i) = saved_gafr[1][i];
GPDR(i * 32) = saved_gpdr[i];
@@ -375,7 +371,7 @@ static int __init pxa2xx_mfp_init(void)
pxa27x_mfp_init();
/* initialize gafr_run[], pgsr_lpm[] from existing values */
- for (i = 0; i <= gpio_to_bank(gpio_nr); i++)
+ for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++)
gpdr_lpm[i] = GPDR(i * 32);
return sysdev_class_register(&pxa2xx_mfp_sysclass);
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 3e4ab2279c99..67592664493d 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -313,7 +313,7 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)
void __init pxa27x_init_irq(void)
{
pxa_init_irq(34, pxa27x_set_wake);
- pxa_init_gpio(128, pxa27x_set_wake);
+ pxa_init_gpio(121, pxa27x_set_wake);
}
/*