1
2
3
4
5
6
7
8
9
10#ifndef __DEVFREQ_COOLING_H__
11#define __DEVFREQ_COOLING_H__
12
13#include <linux/devfreq.h>
14#include <linux/thermal.h>
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48struct devfreq_cooling_power {
49 unsigned long (*get_static_power)(struct devfreq *devfreq,
50 unsigned long voltage);
51 unsigned long (*get_dynamic_power)(struct devfreq *devfreq,
52 unsigned long freq,
53 unsigned long voltage);
54 int (*get_real_power)(struct devfreq *df, u32 *power,
55 unsigned long freq, unsigned long voltage);
56 unsigned long dyn_power_coeff;
57};
58
59#ifdef CONFIG_DEVFREQ_THERMAL
60
61struct thermal_cooling_device *
62of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
63 struct devfreq_cooling_power *dfc_power);
64struct thermal_cooling_device *
65of_devfreq_cooling_register(struct device_node *np, struct devfreq *df);
66struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df);
67void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
68
69#else
70
71static inline struct thermal_cooling_device *
72of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
73 struct devfreq_cooling_power *dfc_power)
74{
75 return ERR_PTR(-EINVAL);
76}
77
78static inline struct thermal_cooling_device *
79of_devfreq_cooling_register(struct device_node *np, struct devfreq *df)
80{
81 return ERR_PTR(-EINVAL);
82}
83
84static inline struct thermal_cooling_device *
85devfreq_cooling_register(struct devfreq *df)
86{
87 return ERR_PTR(-EINVAL);
88}
89
90static inline void
91devfreq_cooling_unregister(struct thermal_cooling_device *dfc)
92{
93}
94
95#endif
96#endif
97