cpuidle: move generic cpuidle to generic

After this change, low level cpuidle drivers load the generic cpuidle
module if they can support the underlying platform.

change the intel cpuidle driver accordingly, now it's loaded by acpi
bus manager during boot, although it doesn't depend on acpi

Signed-off-by: Fredrik Holmqvist <[email protected]>
This commit is contained in:
Yongcong Du
2012-11-18 17:39:19 +01:00
committed by Fredrik Holmqvist
parent 57311e7bb7
commit 71d9d375b8
16 changed files with 463 additions and 334 deletions
+6 -9
View File
@@ -14,7 +14,7 @@ extern "C" {
#define CPUIDLE_CSTATE_MAX 8
#define CSTATE_NAME_LENGTH 32
#define B_CPUIDLE_MODULE_NAME "idle/generic/cpuidle/v1"
#define B_CPUIDLE_MODULE_NAME "generic/cpuidle/v1"
struct CpuidleStat {
@@ -28,28 +28,25 @@ struct CpuidleInfo {
CpuidleStat stats[CPUIDLE_CSTATE_MAX];
};
struct CpuidleDevice;
struct CpuidleCstate {
char name[CSTATE_NAME_LENGTH];
int32 latency;
int32 (*EnterIdle)(int32 state, CpuidleCstate *cstate);
int32 (*EnterIdle)(int32 state, CpuidleDevice *device);
void *pData;
};
struct CpuidleModuleInfo {
module_info info;
struct CpuidleDevice {
CpuidleCstate cStates[CPUIDLE_CSTATE_MAX];
int32 cStateCount;
};
struct GenCpuidle {
struct CpuidleModuleInfo {
module_info info;
int32 (*GetIdleStateCount)(void);
char * (*GetIdleStateName)(int32 state);
void (*GetIdleStateInfo)(int32 cpu, int32 state,
CpuidleStat *stat);
status_t (*AddDevice)(CpuidleDevice *device);
};