0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __DEVFREQ_COOLING_H__
0011 #define __DEVFREQ_COOLING_H__
0012
0013 #include <linux/devfreq.h>
0014 #include <linux/thermal.h>
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 struct devfreq_cooling_power {
0038 int (*get_real_power)(struct devfreq *df, u32 *power,
0039 unsigned long freq, unsigned long voltage);
0040 };
0041
0042 #ifdef CONFIG_DEVFREQ_THERMAL
0043
0044 struct thermal_cooling_device *
0045 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
0046 struct devfreq_cooling_power *dfc_power);
0047 struct thermal_cooling_device *
0048 of_devfreq_cooling_register(struct device_node *np, struct devfreq *df);
0049 struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df);
0050 void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
0051 struct thermal_cooling_device *
0052 devfreq_cooling_em_register(struct devfreq *df,
0053 struct devfreq_cooling_power *dfc_power);
0054
0055 #else
0056
0057 static inline struct thermal_cooling_device *
0058 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
0059 struct devfreq_cooling_power *dfc_power)
0060 {
0061 return ERR_PTR(-EINVAL);
0062 }
0063
0064 static inline struct thermal_cooling_device *
0065 of_devfreq_cooling_register(struct device_node *np, struct devfreq *df)
0066 {
0067 return ERR_PTR(-EINVAL);
0068 }
0069
0070 static inline struct thermal_cooling_device *
0071 devfreq_cooling_register(struct devfreq *df)
0072 {
0073 return ERR_PTR(-EINVAL);
0074 }
0075
0076 static inline struct thermal_cooling_device *
0077 devfreq_cooling_em_register(struct devfreq *df,
0078 struct devfreq_cooling_power *dfc_power)
0079 {
0080 return ERR_PTR(-EINVAL);
0081 }
0082
0083 static inline void
0084 devfreq_cooling_unregister(struct thermal_cooling_device *dfc)
0085 {
0086 }
0087
0088 #endif
0089 #endif