aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpuidle/driver.c')
-rw-r--r--drivers/cpuidle/driver.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index c2b281afe0ed..422c7b69ba7c 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -19,34 +19,9 @@ DEFINE_SPINLOCK(cpuidle_driver_lock);
19static void __cpuidle_set_cpu_driver(struct cpuidle_driver *drv, int cpu); 19static void __cpuidle_set_cpu_driver(struct cpuidle_driver *drv, int cpu);
20static struct cpuidle_driver * __cpuidle_get_cpu_driver(int cpu); 20static struct cpuidle_driver * __cpuidle_get_cpu_driver(int cpu);
21 21
22static void set_power_states(struct cpuidle_driver *drv)
23{
24 int i;
25
26 /*
27 * cpuidle driver should set the drv->power_specified bit
28 * before registering if the driver provides
29 * power_usage numbers.
30 *
31 * If power_specified is not set,
32 * we fill in power_usage with decreasing values as the
33 * cpuidle code has an implicit assumption that state Cn
34 * uses less power than C(n-1).
35 *
36 * With CONFIG_ARCH_HAS_CPU_RELAX, C0 is already assigned
37 * an power value of -1. So we use -2, -3, etc, for other
38 * c-states.
39 */
40 for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++)
41 drv->states[i].power_usage = -1 - i;
42}
43
44static void __cpuidle_driver_init(struct cpuidle_driver *drv) 22static void __cpuidle_driver_init(struct cpuidle_driver *drv)
45{ 23{
46 drv->refcnt = 0; 24 drv->refcnt = 0;
47
48 if (!drv->power_specified)
49 set_power_states(drv);
50} 25}
51 26
52static int __cpuidle_register_driver(struct cpuidle_driver *drv, int cpu) 27static int __cpuidle_register_driver(struct cpuidle_driver *drv, int cpu)