linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric.y.miao@gmail.com (Eric Miao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 15/16] [ARM] pxa: add MFP_LPM_KEEP_OUTPUT flag to pin config
Date: Mon, 11 Jan 2010 22:04:23 +0800	[thread overview]
Message-ID: <1263218664-11546-16-git-send-email-eric.y.miao@gmail.com> (raw)
In-Reply-To: <1263218664-11546-1-git-send-email-eric.y.miao@gmail.com>

Some pins are expected to keep their last level during suspend, and
introduce MFP_LPM_KEEP_OUTPUT for this.

Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
---
 arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h |    2 ++
 arch/arm/mach-pxa/mfp-pxa2xx.c              |   11 +++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
index 658b28e..c54cef2 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
@@ -25,6 +25,8 @@
 #define MFP_DIR(x)		(((x) >> 23) & 0x1)
 
 #define MFP_LPM_CAN_WAKEUP	(0x1 << 24)
+#define MFP_LPM_KEEP_OUTPUT	(0x1 << 25)
+
 #define WAKEUP_ON_EDGE_RISE	(MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
 #define WAKEUP_ON_EDGE_FALL	(MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL)
 #define WAKEUP_ON_EDGE_BOTH	(MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH)
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index cf6b720..c98b5a8 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -328,6 +328,17 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
 {
 	int i;
 
+	/* set corresponding PGSR bit of those marked MFP_LPM_KEEP_OUTPUT */
+	for (i = 0; i < pxa_last_gpio; i++) {
+		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);
+			else
+				PGSR(i) &= ~GPIO_bit(i);
+		}
+	}
+
 	for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
 
 		saved_gafr[0][i] = GAFR_L(i);
-- 
1.6.3.3

  parent reply	other threads:[~2010-01-11 14:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 14:04 [RFC PATCH 00/16] pxa gpio API cleanup Eric Miao
2010-01-11 14:04 ` [PATCH 01/16] [ARM] pxa/tosa: make use of the matrix keypad driver Eric Miao
2010-01-11 14:04 ` [PATCH 02/16] [ARM] pxa: use chip->ack() instead of accessing GEDR directly Eric Miao
2010-01-11 14:04 ` [PATCH 03/16] [ARM] pxa: simplify the LCD pin configuration for pxa25x platforms Eric Miao
2010-01-11 14:04 ` [PATCH 04/16] [ARM] pxa: simplify the LCD pin configuration for pxa27x platforms Eric Miao
2010-01-11 14:04 ` [PATCH 05/16] [ARM] pxa/cm-x270: avoid direct access of GPIO/MFP registers Eric Miao
2010-01-11 15:19   ` Mike Rapoport
2010-01-12  0:19     ` Eric Miao
2010-01-11 14:04 ` [PATCH 06/16] [ARM] pxa: fix the incorrect naming of AC97 reset pin config for pxa26x Eric Miao
2010-01-11 14:04 ` [PATCH 07/16] [ARM] pxa: remove the unnecessary restoring of MFP registers Eric Miao
2010-01-11 14:04 ` [PATCH 08/16] [ARM] pxa: introduce processor specific pxa27x_assert_ac97reset() Eric Miao
2010-01-11 14:04 ` [PATCH 09/16] [ARM] pxa: add the missing AC97 pin configurations Eric Miao
2010-01-11 14:04 ` [PATCH 10/16] [ARM] pxa: remove now unnecessary pxa_gpio_mode() calls in ac97 Eric Miao
2010-01-11 14:04 ` [PATCH 11/16] gpio: introduce gpio_request_one() and friends Eric Miao
2010-01-11 14:04 ` [PATCH 12/16] [ARM] pxa/corgi: use generic GPIO API and remove pxa_gpio_mode() Eric Miao
2010-01-11 14:04 ` [PATCH 13/16] [ARM] pxa/spitz: " Eric Miao
2010-01-11 14:04 ` [PATCH 14/16] [ARM] pxa: fix irq suspend/resume for pxa25x Eric Miao
2010-01-11 14:04 ` Eric Miao [this message]
2010-01-11 14:04 ` [PATCH 16/16] [ARM] pxa/corgi: cleanup GPIO configurations and low power mode settings Eric Miao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263218664-11546-16-git-send-email-eric.y.miao@gmail.com \
    --to=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).