Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / cpuidle / cpuidle.h
blob9f336af17fa6038abe7b939b6c4718fd6965c540
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 char param_governor[];
11 extern struct cpuidle_governor *cpuidle_curr_governor;
12 extern struct cpuidle_governor *cpuidle_prev_governor;
13 extern struct list_head cpuidle_governors;
14 extern struct list_head cpuidle_detected_devices;
15 extern struct mutex cpuidle_lock;
16 extern spinlock_t cpuidle_driver_lock;
17 extern int cpuidle_disabled(void);
18 extern int cpuidle_enter_state(struct cpuidle_device *dev,
19 struct cpuidle_driver *drv, int next_state);
21 /* idle loop */
22 extern void cpuidle_install_idle_handler(void);
23 extern void cpuidle_uninstall_idle_handler(void);
25 /* governors */
26 extern struct cpuidle_governor *cpuidle_find_governor(const char *str);
27 extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
29 /* sysfs */
31 struct device;
33 extern int cpuidle_add_interface(struct device *dev);
34 extern void cpuidle_remove_interface(struct device *dev);
35 extern int cpuidle_add_device_sysfs(struct cpuidle_device *device);
36 extern void cpuidle_remove_device_sysfs(struct cpuidle_device *device);
37 extern int cpuidle_add_sysfs(struct cpuidle_device *dev);
38 extern void cpuidle_remove_sysfs(struct cpuidle_device *dev);
40 #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
41 bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state);
42 int cpuidle_coupled_state_verify(struct cpuidle_driver *drv);
43 int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
44 struct cpuidle_driver *drv, int next_state);
45 int cpuidle_coupled_register_device(struct cpuidle_device *dev);
46 void cpuidle_coupled_unregister_device(struct cpuidle_device *dev);
47 #else
48 static inline
49 bool cpuidle_state_is_coupled(struct cpuidle_driver *drv, int state)
51 return false;
54 static inline int cpuidle_coupled_state_verify(struct cpuidle_driver *drv)
56 return 0;
59 static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev,
60 struct cpuidle_driver *drv, int next_state)
62 return -1;
65 static inline int cpuidle_coupled_register_device(struct cpuidle_device *dev)
67 return 0;
70 static inline void cpuidle_coupled_unregister_device(struct cpuidle_device *dev)
73 #endif
75 #endif /* __DRIVER_CPUIDLE_H */