linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH 4/6] OMAP3: GPIO: disable GPIO debounce clocks on idle
Date: Mon,  3 May 2010 16:26:15 -0700	[thread overview]
Message-ID: <1272929177-22685-5-git-send-email-khilman@deeprootsystems.com> (raw)
In-Reply-To: <1272929177-22685-1-git-send-email-khilman@deeprootsystems.com>

Ensure GPIO debounce clocks are disabled when idle.  Otherwise,
clocks will prevent PER powerdomain from entering retention.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/plat-omap/gpio.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 48670ae..98465cd 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -196,6 +196,7 @@ struct gpio_bank {
 	struct gpio_chip chip;
 	struct clk *dbck;
 	u32 mod_usage;
+	u32 dbck_enable_mask;
 };
 
 #define METHOD_MPUIO		0
@@ -647,6 +648,7 @@ void omap_set_gpio_debounce(int gpio, int enable)
 		goto done;
 
 	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+		bank->dbck_enable_mask = val;
 		if (enable)
 			clk_enable(bank->dbck);
 		else
@@ -2054,6 +2056,9 @@ void omap2_gpio_prepare_for_idle(int power_state)
 		struct gpio_bank *bank = &gpio_bank[i];
 		u32 l1, l2;
 
+		if (bank->dbck_enable_mask)
+			clk_disable(bank->dbck);
+
 		if (power_state > PWRDM_POWER_OFF)
 			continue;
 
@@ -2118,6 +2123,9 @@ void omap2_gpio_resume_after_idle(void)
 		struct gpio_bank *bank = &gpio_bank[i];
 		u32 l, gen, gen0, gen1;
 
+		if (bank->dbck_enable_mask)
+			clk_enable(bank->dbck);
+
 		if (!workaround_enabled)
 			continue;
 
-- 
1.7.0.2


  parent reply	other threads:[~2010-05-03 23:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 23:26 [PATCH 0/6] OMAP GPIO updates for 2.6.35 Kevin Hilman
2010-05-03 23:26 ` [PATCH 1/6] OMAP3: GPIO fixes for off-mode Kevin Hilman
2010-05-03 23:26 ` [PATCH 2/6] OMAP3: GPIO: Only enable WAKEUPEN for edge detection GPIOs Kevin Hilman
2010-05-10 21:11   ` Tony Lindgren
2010-05-11 14:27     ` Kevin Hilman
2010-05-11 22:57       ` Tony Lindgren
2010-05-11 23:27         ` Kevin Hilman
2010-05-11 23:53           ` Tony Lindgren
2010-05-03 23:26 ` [PATCH 3/6] OMAP2/3: GPIO: generalize prepare for idle Kevin Hilman
2010-05-03 23:26 ` Kevin Hilman [this message]
2010-05-03 23:26 ` [PATCH 5/6] OMAP3: GPIO: Removed a couple of unneeded registers from context save/restore Kevin Hilman
2010-05-03 23:26 ` [PATCH 6/6] OMAP: GPIO: remove duplicate debugfs interface Kevin Hilman
  -- strict thread matches above, loose matches on Subject: below --
2010-05-11 23:30 [PATCH 0/6] OMAP GPIO updates for 2.6.35 Kevin Hilman
2010-05-11 23:30 ` [PATCH 4/6] OMAP3: GPIO: disable GPIO debounce clocks on idle Kevin Hilman

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=1272929177-22685-5-git-send-email-khilman@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.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).