diff options
author | Zhang Rui <rui.zhang@intel.com> | 2014-12-09 11:38:34 +0800 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-12-09 11:38:34 +0800 |
commit | c89d99546dc5b076ccd6692c48ada9a92820a4ac (patch) | |
tree | 30788930f8c3fca80c0e5d8a377786d4a4a863bd /include/linux/thermal.h | |
parent | 5a530ff0d88a366736ae4d1021e7358b52e55756 (diff) | |
parent | 9c1e4550b5cbe17ff68ce631356190ef9a565386 (diff) | |
download | linux-c89d99546dc5b076ccd6692c48ada9a92820a4ac.tar.gz linux-c89d99546dc5b076ccd6692c48ada9a92820a4ac.tar.bz2 linux-c89d99546dc5b076ccd6692c48ada9a92820a4ac.zip |
Merge branch 'eduardo-soc-thermal' into thermal-soc
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index ef90838b36a0..99be7fc79c3b 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -289,19 +289,49 @@ struct thermal_genl_event { enum events event; }; +/** + * struct thermal_zone_of_device_ops - scallbacks for handling DT based zones + * + * Mandatory: + * @get_temp: a pointer to a function that reads the sensor temperature. + * + * Optional: + * @get_trend: a pointer to a function that reads the sensor temperature trend. + * @set_emul_temp: a pointer to a function that sets sensor emulated + * temperature. + */ +struct thermal_zone_of_device_ops { + int (*get_temp)(void *, long *); + int (*get_trend)(void *, long *); + int (*set_emul_temp)(void *, unsigned long); +}; + +/** + * struct thermal_trip - representation of a point in temperature domain + * @np: pointer to struct device_node that this trip point was created from + * @temperature: temperature value in miliCelsius + * @hysteresis: relative hysteresis in miliCelsius + * @type: trip point type + */ + +struct thermal_trip { + struct device_node *np; + unsigned long int temperature; + unsigned long int hysteresis; + enum thermal_trip_type type; +}; + /* Function declarations */ #ifdef CONFIG_THERMAL_OF struct thermal_zone_device * -thermal_zone_of_sensor_register(struct device *dev, int id, - void *data, int (*get_temp)(void *, long *), - int (*get_trend)(void *, long *)); +thermal_zone_of_sensor_register(struct device *dev, int id, void *data, + const struct thermal_zone_of_device_ops *ops); void thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tz); #else static inline struct thermal_zone_device * -thermal_zone_of_sensor_register(struct device *dev, int id, - void *data, int (*get_temp)(void *, long *), - int (*get_trend)(void *, long *)) +thermal_zone_of_sensor_register(struct device *dev, int id, void *data, + const struct thermal_zone_of_device_ops *ops) { return NULL; } |