From: "Varadarajan, Charulatha" <charu@ti.com>
To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: tony@atomide.com, khilman@deeprootsystems.com, paul@pwsan.com,
Charulatha V <charu@ti.com>
Subject: [PATCH 5/7] OMAP2+: GPIO: make workaround_enabled bank specific
Date: Mon, 18 Apr 2011 20:36:55 +0530 [thread overview]
Message-ID: <1303139217-10285-6-git-send-email-charu@ti.com> (raw)
In-Reply-To: <no>
From: Charulatha V <charu@ti.com>
Make workaround_enabled flag bank-specific instead of using a single
flag for all the banks together. This would be helpful while making
use of runtime framework in OMAP GPIO driver which would make the
driver handle each GPIO bank independently.
Also rename workaround_enabled flag to off_mode_wkup_wa_enabled
Signed-off-by: Charulatha V <charu@ti.com>
---
arch/arm/plat-omap/gpio.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 5d4ed6c..5933c98 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -176,6 +176,7 @@ struct gpio_bank {
int stride;
bool looses_context;
u32 ctx_lost_cnt_before;
+ bool off_mode_wkup_wa_enabled;
};
/*
@@ -1636,6 +1637,7 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank)
static int gpio;
bank->mod_usage = 0;
+ bank->off_mode_wkup_wa_enabled = false;
/*
* REVISIT eventually switch from OMAP-specific gpio structs
* over to the generic ones
@@ -1858,11 +1860,9 @@ static struct sys_device omap_gpio_device = {
static void omap_gpio_save_context(struct gpio_bank *bank);
static void omap_gpio_restore_context(struct gpio_bank *bank);
-static int workaround_enabled;
-
void omap2_gpio_prepare_for_idle(int off_mode)
{
- int i, c = 0;
+ int i;
for (i = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = &gpio_bank[i];
@@ -1922,7 +1922,7 @@ void omap2_gpio_prepare_for_idle(int off_mode)
__raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
}
- c++;
+ bank->off_mode_wkup_wa_enabled = true;
save_gpio_ctx:
pdev = to_platform_device(bank->dev);
@@ -1930,11 +1930,6 @@ save_gpio_ctx:
omap_device_get_context_loss_count(pdev);
omap_gpio_save_context(bank);
}
- if (!c) {
- workaround_enabled = 0;
- return;
- }
- workaround_enabled = 1;
}
void omap2_gpio_resume_after_idle(void)
@@ -1964,7 +1959,7 @@ void omap2_gpio_resume_after_idle(void)
if (ctx_lost_cnt_after == bank->ctx_lost_cnt_before)
continue;
- if (!workaround_enabled)
+ if (!bank->off_mode_wkup_wa_enabled)
goto restore_gpio_ctx;
if (!(bank->enabled_non_wakeup_gpios))
@@ -2042,6 +2037,7 @@ void omap2_gpio_resume_after_idle(void)
}
restore_gpio_ctx:
+ bank->off_mode_wkup_wa_enabled = false;
omap_gpio_restore_context(bank);
}
--
1.7.1
next prev parent reply other threads:[~2011-04-18 15:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <no>
2011-04-18 15:06 ` [v2 0/7] OMAP: GPIO: Use PM runtime framework Varadarajan, Charulatha
2011-04-19 6:26 ` Tony Lindgren
2011-04-20 23:59 ` Kevin Hilman
2011-04-21 5:42 ` Tony Lindgren
2011-04-21 15:15 ` Kevin Hilman
2011-04-22 6:11 ` Tony Lindgren
2011-04-23 8:35 ` Linus Walleij
2011-04-26 7:29 ` Tony Lindgren
2011-04-27 13:18 ` Linus Walleij
2011-05-03 16:22 ` Kevin Hilman
2011-05-03 21:41 ` Linus Walleij
2011-05-04 6:19 ` Tony Lindgren
2011-05-12 0:57 ` Linus Walleij
2011-05-12 9:42 ` Kevin Hilman
2011-05-19 19:08 ` Grant Likely
2011-05-20 3:34 ` Shawn Guo
2011-05-19 19:05 ` Grant Likely
2011-04-18 15:06 ` [PATCH 1/7] OMAP: GPIO: Make gpio_context part of gpio_bank structure Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 2/7] OMAP: GPIO: Use flag to identify wkup dmn GPIO Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 3/7] OMAP4: GPIO: Save/restore context Varadarajan, Charulatha
2011-04-21 0:26 ` Kevin Hilman
2011-04-18 15:06 ` [PATCH 4/7] OMAP: GPIO: handle save/restore ctx in GPIO driver Varadarajan, Charulatha
2011-04-18 15:06 ` Varadarajan, Charulatha [this message]
2011-04-18 15:06 ` [PATCH 6/7] OMAP: GPIO: Cleanup prepare_for_idle/resume Varadarajan, Charulatha
2011-04-18 15:06 ` [PATCH 7/7] OMAP: GPIO: use PM runtime framework Varadarajan, Charulatha
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=1303139217-10285-6-git-send-email-charu@ti.com \
--to=charu@ti.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=tony@atomide.com \
/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