Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251361
b: refs/heads/master
c: 082a8ca
h: refs/heads/master
i:
  251359: 88286cd
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed May 25, 2011
1 parent 5efed2e commit 2802c68
Show file tree
Hide file tree
Showing 2 changed files with 32 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: 0af4817b80870cc12f4b6f38d89f3c012a7a6b28
refs/heads/master: 082a8ca1d3a2fbab76dba8ff66bc25c46677361d
33 changes: 31 additions & 2 deletions trunk/arch/arm/mach-shmobile/pm-sh7372.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <linux/pm.h>
#include <linux/suspend.h>
#include <linux/cpuidle.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/err.h>
Expand All @@ -24,8 +25,7 @@
#define SBAR 0xe6180020
#define APARMBAREA 0xe6f10020

#ifdef CONFIG_SUSPEND
static void sh7372_enter_core_standby(void)
void sh7372_enter_core_standby(void)
{
void __iomem *smfram = (void __iomem *)SMFRAM;

Expand All @@ -51,6 +51,34 @@ static void sh7372_enter_core_standby(void)
__raw_writel(0, SBAR); /* disable reset vector translation */
}

#ifdef CONFIG_CPU_IDLE
static void sh7372_cpuidle_setup(struct cpuidle_device *dev)
{
struct cpuidle_state *state;
int i = dev->state_count;

state = &dev->states[i];
snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
strncpy(state->desc, "Core Standby Mode", CPUIDLE_DESC_LEN);
state->exit_latency = 10;
state->target_residency = 20 + 10;
state->power_usage = 1; /* perhaps not */
state->flags = 0;
state->flags |= CPUIDLE_FLAG_TIME_VALID;
shmobile_cpuidle_modes[i] = sh7372_enter_core_standby;

dev->state_count = i + 1;
}

static void sh7372_cpuidle_init(void)
{
shmobile_cpuidle_setup = sh7372_cpuidle_setup;
}
#else
static void sh7372_cpuidle_init(void) {}
#endif

#ifdef CONFIG_SUSPEND
static int sh7372_enter_suspend(suspend_state_t suspend_state)
{
sh7372_enter_core_standby();
Expand All @@ -76,4 +104,5 @@ void __init sh7372_pm_init(void)
__raw_writel(0x00000000, DBGREG1);

sh7372_suspend_init();
sh7372_cpuidle_init();
}

0 comments on commit 2802c68

Please sign in to comment.