[PATCH] pxa: Fix PGSR register address calculation

STALE5618d

2 messages, 2 authors, 2011-05-09 · open the first message on its own page

[PATCH] pxa: Fix PGSR register address calculation

From: Paul Parsons <hidden>
Date: 2011-05-08 01:54:33

The file mfp-pxa2xx.c defines a macro, PGSR(), which translates a gpio bank number to a PGSR register address. The function pxa2xx_mfp_suspend() erroneously passed in a gpio number instead of a gpio bank number.

Signed-off-by: Paul Parsons <redacted>
---
--- clean-2.6.39-rc6/arch/arm/mach-pxa/mfp-pxa2xx.c	2011-03-15 01:20:32.000000000 +0000
+++ linux-2.6.39-rc6/arch/arm/mach-pxa/mfp-pxa2xx.c	2011-05-08 02:09:36.706294235 +0100
@@ -347,9 +347,9 @@ static int pxa2xx_mfp_suspend(struct sys
 		if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
 		    (GPDR(i) & GPIO_bit(i))) {
 			if (GPLR(i) & GPIO_bit(i))
-				PGSR(i) |= GPIO_bit(i);
+				PGSR(gpio_to_bank(i)) |= GPIO_bit(i);
 			else
-				PGSR(i) &= ~GPIO_bit(i);
+				PGSR(gpio_to_bank(i)) &= ~GPIO_bit(i);
 		}
 	}
 

[PATCH] pxa: Fix PGSR register address calculation

From: Eric Miao <hidden>
Date: 2011-05-09 03:48:57

On Sun, May 8, 2011 at 9:54 AM, Paul Parsons [off-list ref] wrote:
The file mfp-pxa2xx.c defines a macro, PGSR(), which translates a gpio bank number to a PGSR register address. The function pxa2xx_mfp_suspend() erroneously passed in a gpio number instead of a gpio bank number.

Signed-off-by: Paul Parsons <redacted>
Applied to 'fix'.
quoted hunk
---
--- clean-2.6.39-rc6/arch/arm/mach-pxa/mfp-pxa2xx.c ? ? 2011-03-15 01:20:32.000000000 +0000
+++ linux-2.6.39-rc6/arch/arm/mach-pxa/mfp-pxa2xx.c ? ? 2011-05-08 02:09:36.706294235 +0100
@@ -347,9 +347,9 @@ static int pxa2xx_mfp_suspend(struct sys
? ? ? ? ? ? ? ?if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
? ? ? ? ? ? ? ? ? ?(GPDR(i) & GPIO_bit(i))) {
? ? ? ? ? ? ? ? ? ? ? ?if (GPLR(i) & GPIO_bit(i))
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PGSR(i) |= GPIO_bit(i);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PGSR(gpio_to_bank(i)) |= GPIO_bit(i);
? ? ? ? ? ? ? ? ? ? ? ?else
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PGSR(i) &= ~GPIO_bit(i);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PGSR(gpio_to_bank(i)) &= ~GPIO_bit(i);
? ? ? ? ? ? ? ?}
? ? ? ?}

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help