aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-10-06 17:25:09 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-11 17:42:27 -0500
commitc40552bc82166adb21a1a7fcb1dc4e76352b1b79 (patch)
tree3625838f286478e88ccc3a3be09b1c330149106c /arch/arm/mach-omap2/pm34xx.c
parent89139dce8a0060d97a46cebde570a8f55c314712 (diff)
OMAP3: PM debug: allow runtime toggle of PM features
Allow enable/disable of low-power states during idle. To enable low-power idle: echo 1 > /debug/pm_debug/sleep_while_idle to disable: echo 0 > /debug/pm_debug/sleep_while_idle Also allow enable/disable of OFF-mode. To enable: echo 1 > /debug/pm_debug/enable_off_mode to disable: echo 0 > /debug/pm_debug/enable_off_mode Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 90d1dc5884ef..ade2e4a6bb7d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -25,6 +25,7 @@
25#include <linux/list.h> 25#include <linux/list.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/clk.h>
28 29
29#include <plat/sram.h> 30#include <plat/sram.h>
30#include <plat/clockdomain.h> 31#include <plat/clockdomain.h>
@@ -57,6 +58,9 @@
57#define OMAP343X_TABLE_VALUE_OFFSET 0x30 58#define OMAP343X_TABLE_VALUE_OFFSET 0x30
58#define OMAP343X_CONTROL_REG_VALUE_OFFSET 0x32 59#define OMAP343X_CONTROL_REG_VALUE_OFFSET 0x32
59 60
61u32 enable_off_mode;
62u32 sleep_while_idle;
63
60struct power_state { 64struct power_state {
61 struct powerdomain *pwrdm; 65 struct powerdomain *pwrdm;
62 u32 next_state; 66 u32 next_state;
@@ -456,6 +460,8 @@ static int omap3_fclks_active(void)
456 460
457static int omap3_can_sleep(void) 461static int omap3_can_sleep(void)
458{ 462{
463 if (!sleep_while_idle)
464 return 0;
459 if (!omap_uart_can_sleep()) 465 if (!omap_uart_can_sleep())
460 return 0; 466 return 0;
461 if (omap3_fclks_active()) 467 if (omap3_fclks_active())
@@ -900,6 +906,22 @@ static void __init prcm_setup_regs(void)
900 omap3_d2d_idle(); 906 omap3_d2d_idle();
901} 907}
902 908
909void omap3_pm_off_mode_enable(int enable)
910{
911 struct power_state *pwrst;
912 u32 state;
913
914 if (enable)
915 state = PWRDM_POWER_OFF;
916 else
917 state = PWRDM_POWER_RET;
918
919 list_for_each_entry(pwrst, &pwrst_list, node) {
920 pwrst->next_state = state;
921 set_pwrdm_state(pwrst->pwrdm, state);
922 }
923}
924
903int omap3_pm_get_suspend_state(struct powerdomain *pwrdm) 925int omap3_pm_get_suspend_state(struct powerdomain *pwrdm)
904{ 926{
905 struct power_state *pwrst; 927 struct power_state *pwrst;