Venkatesh Pallipadi | fe8e288 | 2008-02-14 00:16:13 -0500 | [diff] [blame] | 1 | |
| 2 | |
| 3 | Supporting multiple CPU idle levels in kernel |
| 4 | |
| 5 | cpuidle drivers |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | cpuidle driver hooks into the cpuidle infrastructure and handles the |
| 11 | architecture/platform dependent part of CPU idle states. Driver |
| 12 | provides the platform idle state detection capability and also |
| 13 | has mechanisms in place to support actual entry-exit into CPU idle states. |
| 14 | |
| 15 | cpuidle driver initializes the cpuidle_device structure for each CPU device |
| 16 | and registers with cpuidle using cpuidle_register_device. |
| 17 | |
Daniel Lezcano | 4c637b2 | 2013-04-23 08:54:33 +0000 | [diff] [blame^] | 18 | If all the idle states are the same, the wrapper function cpuidle_register |
| 19 | could be used instead. |
| 20 | |
Venkatesh Pallipadi | fe8e288 | 2008-02-14 00:16:13 -0500 | [diff] [blame] | 21 | It can also support the dynamic changes (like battery <-> AC), by using |
| 22 | cpuidle_pause_and_lock, cpuidle_disable_device and cpuidle_enable_device, |
| 23 | cpuidle_resume_and_unlock. |
| 24 | |
| 25 | Interfaces: |
Daniel Lezcano | 4c637b2 | 2013-04-23 08:54:33 +0000 | [diff] [blame^] | 26 | extern int cpuidle_register(struct cpuidle_driver *drv, |
| 27 | const struct cpumask *const coupled_cpus); |
| 28 | extern int cpuidle_unregister(struct cpuidle_driver *drv); |
Venkatesh Pallipadi | fe8e288 | 2008-02-14 00:16:13 -0500 | [diff] [blame] | 29 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
| 30 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); |
| 31 | extern int cpuidle_register_device(struct cpuidle_device *dev); |
| 32 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); |
| 33 | |
| 34 | extern void cpuidle_pause_and_lock(void); |
| 35 | extern void cpuidle_resume_and_unlock(void); |
| 36 | extern int cpuidle_enable_device(struct cpuidle_device *dev); |
| 37 | extern void cpuidle_disable_device(struct cpuidle_device *dev); |