public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: pxa: mfp: Force gpio direction for MFP_LPM_KEEP_OUTPUT
@ 2012-03-31 12:20 Paul Parsons
  2012-04-01  9:15 ` Igor Grinberg
  0 siblings, 1 reply; 22+ messages in thread
From: Paul Parsons @ 2012-03-31 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Some MFP configurations specify MFP_LPM_KEEP_OUTPUT to preserve the gpio output
value (HIGH or LOW) during sleep mode. For example:

    GPIO72_GPIO | MFP_LPM_KEEP_OUTPUT,

Unfortunately MFP_LPM_KEEP_OUTPUT makes no special provision for setting the
sleep mode gpio direction, unlike MFP_LPM_DRIVE_HIGH and MFP_LPM_DRIVE_LOW.
Consequently MFP configurations of the form:

    GPIO<n>_GPIO | MFP_LPM_KEEP_OUTPUT,

will set the sleep mode gpio direction to INPUT.

This patch forces the sleep mode gpio direction to OUTPUT in cases where
MFP_LPM_KEEP_OUTPUT was specified. This brings MFP_LPM_KEEP_OUTPUT into line
with MFP_LPM_DRIVE_HIGH and MFP_LPM_DRIVE_LOW.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
---

diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index b0a8428..3b443199 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -96,6 +96,9 @@ static int __mfp_config_gpio(unsigned gpio, unsigned long c)
 		break;
 	}
 
+	if (c & MFP_LPM_KEEP_OUTPUT)
+		is_out = 1;
+
 	if (is_out ^ gpio_desc[gpio].dir_inverted)
 		gpdr_lpm[bank] |= mask;
 	else

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-04-12 10:59 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-31 12:20 [PATCH] ARM: pxa: mfp: Force gpio direction for MFP_LPM_KEEP_OUTPUT Paul Parsons
2012-04-01  9:15 ` Igor Grinberg
2012-04-01 10:56   ` Paul Parsons
2012-04-01 12:23     ` Igor Grinberg
2012-04-01 17:56       ` Paul Parsons
2012-04-02  8:39         ` Igor Grinberg
2012-04-02 11:30           ` Paul Parsons
2012-04-02 12:44             ` Igor Grinberg
2012-04-02 13:33               ` Paul Parsons
2012-04-02 14:58                 ` Haojian Zhuang
2012-04-02 15:34                   ` Paul Parsons
2012-04-03  8:48                     ` Igor Grinberg
2012-04-03  8:01                 ` Igor Grinberg
2012-04-03 12:30                   ` Paul Parsons
2012-04-03 14:42                     ` Igor Grinberg
2012-04-03 15:08                       ` Igor Grinberg
2012-04-03 16:26                         ` Paul Parsons
2012-04-12 10:59                           ` Igor Grinberg
2012-04-04  1:00                         ` Paul Parsons
2012-04-03 23:55                   ` Paul Parsons
2012-04-05  8:16                     ` Igor Grinberg
2012-04-05 11:15                       ` Paul Parsons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox