]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/cpuidle/cpuidle.h
Merge tag 'selinux-pr-20171113' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-bionic-kernel.git] / drivers / cpuidle / cpuidle.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
4f86d3a8
LB
2/*
3 * cpuidle.h - The internal header file
4 */
5
6#ifndef __DRIVER_CPUIDLE_H
7#define __DRIVER_CPUIDLE_H
8
4f86d3a8
LB
9/* For internal use only */
10extern struct cpuidle_governor *cpuidle_curr_governor;
4f86d3a8
LB
11extern struct list_head cpuidle_governors;
12extern struct list_head cpuidle_detected_devices;
13extern struct mutex cpuidle_lock;
14extern spinlock_t cpuidle_driver_lock;
62027aea 15extern int cpuidle_disabled(void);
56cfbf74
CC
16extern int cpuidle_enter_state(struct cpuidle_device *dev,
17 struct cpuidle_driver *drv, int next_state);
4f86d3a8
LB
18
19/* idle loop */
20extern void cpuidle_install_idle_handler(void);
21extern void cpuidle_uninstall_idle_handler(void);
22
23/* governors */
24extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
25
26/* sysfs */
8f3e9953
DL
27
28struct device;
29
8a25a2fd
KS
30extern int cpuidle_add_interface(struct device *dev);
31extern void cpuidle_remove_interface(struct device *dev);
bf4d1b5d
DL
32extern int cpuidle_add_device_sysfs(struct cpuidle_device *device);
33extern void cpuidle_remove_device_sysfs(struct cpuidle_device *device);
1aef40e2
DL
34extern int cpuidle_add_sysfs(struct cpuidle_device *dev);
35extern void cpuidle_remove_sysfs(struct cpuidle_device *dev);
4f86d3a8 36
4126c019 37#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
4c1ed5a6 38bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state);
abceaa9c 39int cpuidle_coupled_state_verify(struct cpuidle_driver *drv);
4126c019
CC
40int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
41 struct cpuidle_driver *drv, int next_state);
42int cpuidle_coupled_register_device(struct cpuidle_device *dev);
43void cpuidle_coupled_unregister_device(struct cpuidle_device *dev);
44#else
4c1ed5a6
XP
45static inline
46bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state)
4126c019
CC
47{
48 return false;
49}
50
abceaa9c
XP
51static inline int cpuidle_coupled_state_verify(struct cpuidle_driver *drv)
52{
53 return 0;
54}
55
4126c019
CC
56static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
57 struct cpuidle_driver *drv, int next_state)
58{
59 return -1;
60}
61
62static inline int cpuidle_coupled_register_device(struct cpuidle_device *dev)
63{
64 return 0;
65}
66
67static inline void cpuidle_coupled_unregister_device(struct cpuidle_device *dev)
68{
69}
70#endif
71
4f86d3a8 72#endif /* __DRIVER_CPUIDLE_H */