Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196158
b: refs/heads/master
c: 8e2efde
h: refs/heads/master
v: v3
  • Loading branch information
Ari Kauppi authored and Kevin Hilman committed May 12, 2010
1 parent a166223 commit 3fcdfdf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 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: d6290a3ead555c0b092d48288b4dc0566580e17f
refs/heads/master: 8e2efde9f1ba2fb918245f9419246e4e59b42a11
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-omap2/pm-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,9 @@ static int option_set(void *data, u64 val)
{
u32 *option = data;

if (option == &wakeup_timer_milliseconds && val >= 1000)
return -EINVAL;

*option = val;

if (option == &enable_off_mode)
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-omap2/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);

extern u32 wakeup_timer_seconds;
extern u32 wakeup_timer_milliseconds;
extern struct omap_dm_timer *gptimer_wakeup;

#ifdef CONFIG_PM_DEBUG
Expand Down
17 changes: 10 additions & 7 deletions trunk/arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
u32 enable_off_mode;
u32 sleep_while_idle;
u32 wakeup_timer_seconds;
u32 wakeup_timer_milliseconds;

struct power_state {
struct powerdomain *pwrdm;
Expand Down Expand Up @@ -555,20 +556,21 @@ static void omap3_pm_idle(void)
#ifdef CONFIG_SUSPEND
static suspend_state_t suspend_state;

static void omap2_pm_wakeup_on_timer(u32 seconds)
static void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
{
u32 tick_rate, cycles;

if (!seconds)
if (!seconds && !milliseconds)
return;

tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
cycles = tick_rate * seconds;
cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
omap_dm_timer_stop(gptimer_wakeup);
omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles);

pr_info("PM: Resume timer in %d secs (%d ticks at %d ticks/sec.)\n",
seconds, cycles, tick_rate);
pr_info("PM: Resume timer in %u.%03u secs"
" (%d ticks at %d ticks/sec.)\n",
seconds, milliseconds, cycles, tick_rate);
}

static int omap3_pm_prepare(void)
Expand All @@ -582,8 +584,9 @@ static int omap3_pm_suspend(void)
struct power_state *pwrst;
int state, ret = 0;

if (wakeup_timer_seconds)
omap2_pm_wakeup_on_timer(wakeup_timer_seconds);
if (wakeup_timer_seconds || wakeup_timer_milliseconds)
omap2_pm_wakeup_on_timer(wakeup_timer_seconds,
wakeup_timer_milliseconds);

/* Read current next_pwrsts */
list_for_each_entry(pwrst, &pwrst_list, node)
Expand Down

0 comments on commit 3fcdfdf

Please sign in to comment.