11 #include <linux/kernel.h>
13 #include <linux/sched.h>
19 #include <linux/hrtimer.h>
20 #include <linux/module.h>
30 static int enabled_devices;
49 return target_state->
enter(dev, drv, index);
72 int i, dead_state = -1;
89 return drv->
states[dead_state].enter_dead(dev, dead_state);
105 entered_state = cpuidle_enter_ops(dev, drv, next_state);
107 if (entered_state >= 0) {
119 return entered_state;
146 if (need_resched()) {
152 trace_cpu_idle_rcuidle(next_state, dev->
cpu);
160 trace_power_end_rcuidle(dev->
cpu);
175 if (enabled_devices) {
187 if (enabled_devices) {
247 index =
enter(dev, drv, index);
253 diff = ktime_to_us(ktime_sub(time_end, time_start));
262 #ifdef CONFIG_ARCH_HAS_CPU_RELAX
271 while (!need_resched())
275 diff = ktime_to_us(ktime_sub(t2, t1));
294 state->
enter = poll_idle;
324 ret = __cpuidle_register_device(dev);
330 cpuidle_enter_tk : cpuidle_enter;
400 if (!try_module_get(cpuidle_driver->
owner))
406 list_add(&dev->
device_list, &cpuidle_detected_devices);
424 module_put(cpuidle_driver->
owner);
441 if ((ret = __cpuidle_register_device(dev))) {
482 module_put(cpuidle_driver->
owner);
489 static void smp_callback(
void *
v)
501 unsigned long l,
void *
v)
518 #define latency_notifier_init(x) do { } while (0)
525 static int __init cpuidle_init(
void)