-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpuidle: Add common time keeping and irq enabling
Make necessary changes to implement time keeping and irq enabling in the core cpuidle code. This will allow the removal of these functionalities from various platform cpuidle implementations whose timekeeping and irq enabling follows the form in this common code. Signed-off-by: Robert Lee <rob.lee@linaro.org> Tested-by: Jean Pihet <j-pihet@ti.com> Tested-by: Amit Daniel <amit.kachhap@linaro.org> Tested-by: Robert Lee <rob.lee@linaro.org> Reviewed-by: Kevin Hilman <khilman@ti.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Acked-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Len Brown <len.brown@intel.com>
- Loading branch information
Robert Lee
authored and
Len Brown
committed
Mar 21, 2012
1 parent
c16fa4f
commit e168979
Showing
5 changed files
with
122 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef __ASM_ARM_CPUIDLE_H | ||
#define __ASM_ARM_CPUIDLE_H | ||
|
||
#ifdef CONFIG_CPU_IDLE | ||
extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev, | ||
struct cpuidle_driver *drv, int index); | ||
#else | ||
static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev, | ||
struct cpuidle_driver *drv, int index) { return -ENODEV; } | ||
#endif | ||
|
||
/* Common ARM WFI state */ | ||
#define ARM_CPUIDLE_WFI_STATE_PWR(p) {\ | ||
.enter = arm_cpuidle_simple_enter,\ | ||
.exit_latency = 1,\ | ||
.target_residency = 1,\ | ||
.power_usage = p,\ | ||
.flags = CPUIDLE_FLAG_TIME_VALID,\ | ||
.name = "WFI",\ | ||
.desc = "ARM WFI",\ | ||
} | ||
|
||
/* | ||
* in case power_specified == 1, give a default WFI power value needed | ||
* by some governors | ||
*/ | ||
#define ARM_CPUIDLE_WFI_STATE ARM_CPUIDLE_WFI_STATE_PWR(UINT_MAX) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright 2012 Linaro Ltd. | ||
* | ||
* The code contained herein is licensed under the GNU General Public | ||
* License. You may obtain a copy of the GNU General Public License | ||
* Version 2 or later at the following locations: | ||
* | ||
* http://www.opensource.org/licenses/gpl-license.html | ||
* http://www.gnu.org/copyleft/gpl.html | ||
*/ | ||
|
||
#include <linux/cpuidle.h> | ||
#include <asm/proc-fns.h> | ||
|
||
int arm_cpuidle_simple_enter(struct cpuidle_device *dev, | ||
struct cpuidle_driver *drv, int index) | ||
{ | ||
cpu_do_idle(); | ||
|
||
return index; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters