Merge tag 'imx-fixes-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
[linux-2.6-block.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 9/* For internal use only */
61cb5758 10extern char param_governor[];
4f86d3a8 11extern struct cpuidle_governor *cpuidle_curr_governor;
4f86d3a8
LB
12extern struct list_head cpuidle_governors;
13extern struct list_head cpuidle_detected_devices;
14extern struct mutex cpuidle_lock;
15extern spinlock_t cpuidle_driver_lock;
62027aea 16extern int cpuidle_disabled(void);
56cfbf74
CC
17extern int cpuidle_enter_state(struct cpuidle_device *dev,
18 struct cpuidle_driver *drv, int next_state);
4f86d3a8
LB
19
20/* idle loop */
21extern void cpuidle_install_idle_handler(void);
22extern void cpuidle_uninstall_idle_handler(void);
23
24/* governors */
25extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
26
27/* sysfs */
8f3e9953
DL
28
29struct device;
30
8a25a2fd
KS
31extern int cpuidle_add_interface(struct device *dev);
32extern void cpuidle_remove_interface(struct device *dev);
bf4d1b5d
DL
33extern int cpuidle_add_device_sysfs(struct cpuidle_device *device);
34extern void cpuidle_remove_device_sysfs(struct cpuidle_device *device);
1aef40e2
DL
35extern int cpuidle_add_sysfs(struct cpuidle_device *dev);
36extern void cpuidle_remove_sysfs(struct cpuidle_device *dev);
4f86d3a8 37
4126c019 38#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
4c1ed5a6 39bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state);
abceaa9c 40int cpuidle_coupled_state_verify(struct cpuidle_driver *drv);
4126c019
CC
41int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
42 struct cpuidle_driver *drv, int next_state);
43int cpuidle_coupled_register_device(struct cpuidle_device *dev);
44void cpuidle_coupled_unregister_device(struct cpuidle_device *dev);
45#else
4c1ed5a6
XP
46static inline
47bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state)
4126c019
CC
48{
49 return false;
50}
51
abceaa9c
XP
52static inline int cpuidle_coupled_state_verify(struct cpuidle_driver *drv)
53{
54 return 0;
55}
56
4126c019
CC
57static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
58 struct cpuidle_driver *drv, int next_state)
59{
60 return -1;
61}
62
63static inline int cpuidle_coupled_register_device(struct cpuidle_device *dev)
64{
65 return 0;
66}
67
68static inline void cpuidle_coupled_unregister_device(struct cpuidle_device *dev)
69{
70}
71#endif
72
4f86d3a8 73#endif /* __DRIVER_CPUIDLE_H */