Skip to contentSkip to conversation

pxa: Fix PGSR register address calculation

PATCH New Paul Parsons 2 participants 2 messages May 8, 2011 – May 9, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa: Fix PGSR register address calculation

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.

---

arch/arm/mach-pxa/mfp-pxa2xx.c +2 -2
@@ -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);
 		}
 	}
 
Applied
#1 lore raw

PATCH 1/1 pxa: Fix PGSR register address calculation

Quoted 3 lines · Paul Parsons

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.

Applied to 'fix'.

Quoted 17 lines

---

arch/arm/mach-pxa/mfp-pxa2xx.c ? ? 2011-05-08 02:09:36.706294235 +0100 renamed from arch/arm/mach-pxa/mfp-pxa2xx.c ? ? 2011-03-15 01:20:32.000000000 +0000 +0 -0
@@ -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); ? ? ? ? ? ? ? ?}
? ? ? ?}