Skip to content

Commit 63cd91d

Browse files
Magnus Dammpmundt
authored andcommitted
sh: SuperH Mobile Software Standby support for cpuidle
This patch adds "SuperH Mobile Standby Mode [SF]" to the list of cpuidle sleep modes. If the software latency requirements from cpuidle are met together with fulfilled hardware requirements then deep sleep modes can be entered. Tested on sh7722 and sh7724 with "Sleep Mode", "Sleep Mode + SF" and "Software Standby Mode + SF" together with a multimedia work load and flood ping without packet drop. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 309214a commit 63cd91d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎arch/sh/kernel/cpu/shmobile/cpuidle.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
static unsigned long cpuidle_mode[] = {
2222
SUSP_SH_SLEEP, /* regular sleep mode */
2323
SUSP_SH_SLEEP | SUSP_SH_SF, /* sleep mode + self refresh */
24+
SUSP_SH_STANDBY | SUSP_SH_SF, /* software standby mode + self refresh */
2425
};
2526

2627
static int cpuidle_sleep_enter(struct cpuidle_device *dev,
@@ -96,6 +97,16 @@ void sh_mobile_setup_cpuidle(void)
9697
state->flags |= CPUIDLE_FLAG_TIME_VALID;
9798
state->enter = cpuidle_sleep_enter;
9899

100+
state = &dev->states[i++];
101+
snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
102+
strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", CPUIDLE_DESC_LEN);
103+
state->exit_latency = 2300;
104+
state->target_residency = 1 * 2;
105+
state->power_usage = 1;
106+
state->flags = 0;
107+
state->flags |= CPUIDLE_FLAG_TIME_VALID;
108+
state->enter = cpuidle_sleep_enter;
109+
99110
dev->state_count = i;
100111

101112
cpuidle_register_device(dev);

0 commit comments

Comments
 (0)