Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172753
b: refs/heads/master
c: c40552b
h: refs/heads/master
i:
  172751: 4ca5363
v: v3
  • Loading branch information
Kevin Hilman committed Nov 11, 2009
1 parent 6d43422 commit b840116
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 89139dce8a0060d97a46cebde570a8f55c314712
refs/heads/master: c40552bc82166adb21a1a7fcb1dc4e76352b1b79
27 changes: 27 additions & 0 deletions trunk/arch/arm/mach-omap2/pm-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,29 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
return 0;
}

static int option_get(void *data, u64 *val)
{
u32 *option = data;

*val = *option;

return 0;
}

static int option_set(void *data, u64 val)
{
u32 *option = data;

*option = val;

if (option == &enable_off_mode)
omap3_pm_off_mode_enable(val);

return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n");

static int __init pm_dbg_init(void)
{
int i;
Expand Down Expand Up @@ -569,6 +592,10 @@ static int __init pm_dbg_init(void)

}

(void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d,
&enable_off_mode, &pm_dbg_option_fops);
(void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d,
&sleep_while_idle, &pm_dbg_option_fops);
pm_dbg_init_done = 1;

return 0;
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-omap2/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

#include <plat/powerdomain.h>

extern u32 enable_off_mode;
extern u32 sleep_while_idle;

extern void *omap3_secure_ram_storage;
extern void omap3_pm_off_mode_enable(int);

extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
Expand Down
22 changes: 22 additions & 0 deletions trunk/arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/list.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/clk.h>

#include <plat/sram.h>
#include <plat/clockdomain.h>
Expand Down Expand Up @@ -57,6 +58,9 @@
#define OMAP343X_TABLE_VALUE_OFFSET 0x30
#define OMAP343X_CONTROL_REG_VALUE_OFFSET 0x32

u32 enable_off_mode;
u32 sleep_while_idle;

struct power_state {
struct powerdomain *pwrdm;
u32 next_state;
Expand Down Expand Up @@ -456,6 +460,8 @@ static int omap3_fclks_active(void)

static int omap3_can_sleep(void)
{
if (!sleep_while_idle)
return 0;
if (!omap_uart_can_sleep())
return 0;
if (omap3_fclks_active())
Expand Down Expand Up @@ -900,6 +906,22 @@ static void __init prcm_setup_regs(void)
omap3_d2d_idle();
}

void omap3_pm_off_mode_enable(int enable)
{
struct power_state *pwrst;
u32 state;

if (enable)
state = PWRDM_POWER_OFF;
else
state = PWRDM_POWER_RET;

list_for_each_entry(pwrst, &pwrst_list, node) {
pwrst->next_state = state;
set_pwrdm_state(pwrst->pwrdm, state);
}
}

int omap3_pm_get_suspend_state(struct powerdomain *pwrdm)
{
struct power_state *pwrst;
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ static inline void __init omap_uart_reset(struct omap_uart_state *uart)

#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)

static int enable_off_mode; /* to be removed by full off-mode patches */

static void omap_uart_save_context(struct omap_uart_state *uart)
{
u16 lcr = 0;
Expand Down

0 comments on commit b840116

Please sign in to comment.