From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 16/17] omap4: cpuidle: Allow debugfs control through enable_off_mode
Date: Sat, 19 Feb 2011 16:12:37 +0530 [thread overview]
Message-ID: <1298112158-28469-17-git-send-email-santosh.shilimkar@ti.com> (raw)
In-Reply-To: <1298112158-28469-1-git-send-email-santosh.shilimkar@ti.com>
Only MPU OFF and RET is controllable. CORE state is blocked
at ON state till the CORE RET support is added.
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
---
arch/arm/mach-omap2/cpuidle44xx.c | 30 ++++++++++++++++++++++++++++++
arch/arm/mach-omap2/pm.h | 1 +
arch/arm/mach-omap2/pm44xx.c | 4 ++++
3 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index e887eb5..4207862 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -170,6 +170,31 @@ static int omap4_enter_idle_bm(struct cpuidle_device *dev,
}
/**
+ * omap4_cpuidle_update_states() - Update the cpuidle states
+ * @mpu_deepest_state: Enable states upto and including this for mpu domain
+ * @core_deepest_state: Enable states upto and including this for core domain
+ *
+ * This goes through the list of states available and enables and disables the
+ * validity of C states based on deepest state that can be achieved for the
+ * variable domain
+ */
+void omap4_cpuidle_update_states(u32 mpu_deepest_state, u32 core_deepest_state)
+{
+ int i;
+
+ for (i = OMAP4_STATE_C1; i < OMAP4_MAX_STATES; i++) {
+ struct omap4_processor_cx *cx = &omap4_power_states[i];
+
+ if ((cx->mpu_state >= mpu_deepest_state) &&
+ (cx->core_state >= core_deepest_state)) {
+ cx->valid = 1;
+ } else {
+ cx->valid = 0;
+ }
+ }
+}
+
+/**
* omap4_init_power_states - Initialises the OMAP4 specific C states.
*
*/
@@ -325,6 +350,11 @@ int __init omap4_idle_init(void)
}
}
+ if (enable_off_mode)
+ omap4_cpuidle_update_states(PWRDM_POWER_OFF, PWRDM_POWER_OFF);
+ else
+ omap4_cpuidle_update_states(PWRDM_POWER_RET, PWRDM_POWER_RET);
+
return 0;
}
#else
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index ce848b0..4df89d1 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -77,6 +77,7 @@ extern u32 sleep_while_idle;
#if defined(CONFIG_CPU_IDLE)
extern void omap3_cpuidle_update_states(u32, u32);
+extern void omap4_cpuidle_update_states(u32, u32);
#endif
#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 628242d..6244ab2 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -183,6 +183,10 @@ void omap4_pm_off_mode_enable(int enable)
else
state = PWRDM_POWER_RET;
+#ifdef CONFIG_CPU_IDLE
+ omap4_cpuidle_update_states(state, PWRDM_POWER_ON);
+#endif
+
list_for_each_entry(pwrst, &pwrst_list, node) {
/* FIXME: Remove this check when core retention is supported */
if (!strcmp(pwrst->pwrdm->name, "mpu_pwrdm")) {
--
1.6.0.4
next prev parent reply other threads:[~2011-02-19 10:42 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-19 10:42 [PATCH 00/17] omap4: pm: suspend, hotplug and cpuilde support Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 01/17] omap4: pm: Add omap WakeupGen module support Santosh Shilimkar
2011-03-02 21:47 ` Kevin Hilman
2011-03-03 16:04 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 02/17] omap4: pm: Add SAR RAM support Santosh Shilimkar
2011-03-02 21:56 ` Kevin Hilman
2011-03-03 16:08 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 03/17] omap4: Export scu base address Santosh Shilimkar
2011-03-02 21:58 ` Kevin Hilman
2011-03-03 16:09 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 04/17] omap4: pm: Add CPUx OFF mode support Santosh Shilimkar
2011-03-02 22:12 ` Kevin Hilman
2011-03-03 16:14 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 05/17] omap4: pm: Initialise all the clockdomains to supported states Santosh Shilimkar
2011-03-02 22:17 ` Kevin Hilman
2011-03-03 16:14 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 06/17] omap4: pm: Program CPU1 to hit OFF when off-lined Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 07/17] omap4: pm: CPU1 wakeup workaround form Low power modes Santosh Shilimkar
2011-03-02 22:23 ` Kevin Hilman
2011-03-03 16:15 ` Santosh Shilimkar
2011-03-02 23:44 ` Kevin Hilman
2011-02-19 10:42 ` [PATCH 08/17] omap4: pm: Add GIC save/restore support Santosh Shilimkar
2011-03-02 22:29 ` Kevin Hilman
2011-03-03 16:29 ` Santosh Shilimkar
2011-03-03 17:03 ` Kevin Hilman
2011-03-04 8:39 ` Santosh Shilimkar
2011-03-04 16:11 ` Kevin Hilman
2011-03-04 16:14 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 09/17] omap4: pm: Add WakeupGen " Santosh Shilimkar
2011-03-02 22:34 ` Kevin Hilman
2011-02-19 10:42 ` [PATCH 10/17] omap4: pm: Add L2 cache lowpower support Santosh Shilimkar
2011-03-02 22:36 ` Kevin Hilman
2011-03-03 16:30 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 11/17] omap4: suspend: Add MPUSS RET and OFF support Santosh Shilimkar
2011-03-02 22:45 ` Kevin Hilman
2011-03-03 16:31 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 12/17] omap4: pm-debug: Add wakeup timer and debug counters Santosh Shilimkar
2011-03-02 22:51 ` Kevin Hilman
2011-03-03 16:34 ` Santosh Shilimkar
2011-03-03 17:05 ` Kevin Hilman
2011-03-04 6:26 ` Santosh Shilimkar
2011-02-19 10:42 ` [PATCH 13/17] omap4: cpuidle: Basic CPUidle support Santosh Shilimkar
2011-03-02 22:55 ` Kevin Hilman
2011-02-19 10:42 ` [PATCH 14/17] omap4: cpuidle: Add MPUSS RET OFF states Santosh Shilimkar
2011-02-21 10:19 ` Jean Pihet
2011-02-21 10:26 ` Santosh Shilimkar
2011-02-21 14:01 ` Santosh Shilimkar
2011-03-02 23:32 ` Kevin Hilman
2011-02-19 10:42 ` [PATCH 15/17] omap4: cpuidle: Switch to gptimer from twd in deeper C-states Santosh Shilimkar
2011-02-19 10:42 ` Santosh Shilimkar [this message]
2011-03-02 23:43 ` [PATCH 16/17] omap4: cpuidle: Allow debugfs control through enable_off_mode Kevin Hilman
2011-02-19 10:42 ` [PATCH 17/17] omap4: Remove un-used do_wfi() macro Santosh Shilimkar
2011-03-02 23:46 ` [PATCH 00/17] omap4: pm: suspend, hotplug and cpuilde support Kevin Hilman
2011-03-03 7:20 ` Santosh Shilimkar
2011-03-04 17:20 ` Santosh Shilimkar
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=1298112158-28469-17-git-send-email-santosh.shilimkar@ti.com \
--to=santosh.shilimkar@ti.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).