Linux 4.19.133
[linux/fpc-iii.git] / drivers / cpuidle / cpuidle.h
blob2965ab32a583f769ea919c30427eb7255b04909a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * cpuidle.h - The internal header file
4 */
6 #ifndef __DRIVER_CPUIDLE_H
7 #define __DRIVER_CPUIDLE_H
9 /* For internal use only */
10 extern struct cpuidle_governor *cpuidle_curr_governor;
11 extern struct list_head cpuidle_governors;
12 extern struct list_head cpuidle_detected_devices;
13 extern struct mutex cpuidle_lock;
14 extern spinlock_t cpuidle_driver_lock;
15 extern int cpuidle_disabled(void);
16 extern int cpuidle_enter_state(struct cpuidle_device *dev,
17 struct cpuidle_driver *drv, int next_state);
19 /* idle loop */
20 extern void cpuidle_install_idle_handler(void);
21 extern void cpuidle_uninstall_idle_handler(void);
23 /* governors */
24 extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
26 /* sysfs */
28 struct device;
30 extern int cpuidle_add_interface(struct device *dev);
31 extern void cpuidle_remove_interface(struct device *dev);
32 extern int cpuidle_add_device_sysfs(struct cpuidle_device *device);
33 extern void cpuidle_remove_device_sysfs(struct cpuidle_device *device);
34 extern int cpuidle_add_sysfs(struct cpuidle_device *dev);
35 extern void cpuidle_remove_sysfs(struct cpuidle_device *dev);
37 #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
38 bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state);
39 int cpuidle_coupled_state_verify(struct cpuidle_driver *drv);
40 int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
41 struct cpuidle_driver *drv, int next_state);
42 int cpuidle_coupled_register_device(struct cpuidle_device *dev);
43 void cpuidle_coupled_unregister_device(struct cpuidle_device *dev);
44 #else
45 static inline
46 bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state)
48 return false;
51 static inline int cpuidle_coupled_state_verify(struct cpuidle_driver *drv)
53 return 0;
56 static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
57 struct cpuidle_driver *drv, int next_state)
59 return -1;
62 static inline int cpuidle_coupled_register_device(struct cpuidle_device *dev)
64 return 0;
67 static inline void cpuidle_coupled_unregister_device(struct cpuidle_device *dev)
70 #endif
72 #endif /* __DRIVER_CPUIDLE_H */