Skip to contentSkip to conversation

pxa/spitz_pm.c: Fix hang under certain conditions when resuming from STR.

PATCH New dromede at gmail.com 2 participants 2 messages Oct 25, 2012 – Oct 27, 2012

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

PATCH 1/1 pxa/spitz_pm.c: Fix hang under certain conditions when resuming from STR.

From: Marko Katic <dromede.gmail.com>

Devices that use spitz_pm.c will fail to resume
from STR (Suspend To Ram) when the charger plug is inserted or removed when a device is in STR mode. The culprit is
a misconfigured gpio line - GPIO18. GPIO18 should be configured as a regular GPIO input but it gets configured as an alternate function GPIO18_RDY. And then later in postsuspend() it gets configured as a regular GPIO18 input line.

Fix this by removing the GPIO18_RDY configuration so that GPIO18 only gets configured as a regular gpio input.

Signed-off-by Marko Katic <dromede.gmail.com>
---
 arch/arm/mach-pxa/spitz_pm.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/spitz_pm.c +2 -6
index 438f02f..842596d 100644
@@ -86,10 +86,7 @@ static void spitz_discharge1(int on)
 	gpio_set_value(SPITZ_GPIO_LED_GREEN, on);
 }
 
-static unsigned long gpio18_config[] = {
-	GPIO18_RDY,
-	GPIO18_GPIO,
-};
+static unsigned long gpio18_config = GPIO18_GPIO;
 
 static void spitz_presuspend(void)
 {
@@ -112,7 +109,7 @@ static void spitz_presuspend(void)
 	PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT;
 	PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0);
 
-	pxa2xx_mfp_config(&gpio18_config[0], 1);
+	pxa2xx_mfp_config(&gpio18_config, 1);
 	gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown");
 	gpio_free(18);
 
@@ -131,7 +128,6 @@ static void spitz_presuspend(void)
 
 static void spitz_postsuspend(void)
 {
-	pxa2xx_mfp_config(&gpio18_config[1], 1);
 }
 
 static int spitz_should_wakeup(unsigned int resume_on_alarm)
Signature · 1 line
1.7.4.1
maintainer
#1 lore raw

PATCH 1/1 pxa/spitz_pm.c: Fix hang under certain conditions when resuming from STR.

Quoted 10 lines · On Fri, Oct 26, 2012 at 12:51 AM, <[email protected]> wrote:

From: Marko Katic <dromede.gmail.com>

Devices that use spitz_pm.c will fail to resume
from STR (Suspend To Ram) when the charger plug is inserted or removed when a device is in STR mode. The culprit is
a misconfigured gpio line - GPIO18. GPIO18 should be configured as a regular GPIO input but it gets configured as an alternate function GPIO18_RDY. And then later in postsuspend() it gets configured as a regular GPIO18 input line.

Quoted 4 lines

Fix this by removing the GPIO18_RDY configuration so that GPIO18 only gets configured as a regular gpio input.

Signed-off-by Marko Katic <dromede.gmail.com>

Applied with fixing your email to dromede at gmail.com

Thanks
Haojian