@@ -77,12 +77,14 @@ int power_actor_set_power(struct thermal_cooling_device *cdev,
* @temperature: temperature value in miliCelsius
* @hysteresis: relative hysteresis in miliCelsius
* @type: trip point type
+ * @monitor_type: trip point monitor type
*/
struct thermal_trip {
struct device_node *np;
int temperature;
int hysteresis;
enum thermal_trip_type type;
+ enum thermal_trip_monitor_type monitor_type;
};
int get_tz_trend(struct thermal_zone_device *tz, int trip);
@@ -72,6 +72,8 @@ struct thermal_zone_device_ops {
int (*set_trip_temp) (struct thermal_zone_device *, int, int);
int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
+ int (*get_trip_mon_type)(struct thermal_zone_device *, int,
+ enum thermal_trip_monitor_type *);
int (*get_crit_temp) (struct thermal_zone_device *, int *);
int (*set_emul_temp) (struct thermal_zone_device *, int);
int (*get_trend) (struct thermal_zone_device *, int,
@@ -16,6 +16,11 @@ enum thermal_trip_type {
THERMAL_TRIP_CRITICAL,
};
+enum thermal_trip_monitor_type {
+ THERMAL_TRIP_MONITOR_RISING = 0,
+ THERMAL_TRIP_MONITOR_FALLING
+};
+
/* Adding event notification support elements */
#define THERMAL_GENL_FAMILY_NAME "thermal"
#define THERMAL_GENL_VERSION 0x01
Thermal trip points can be defined to indicate whether a temperature rise or a temperature fall is to be monitored. This property can now be defined in the DT bindings for a trip point. To support this following three changes are introduced to thermal core and sysfs code. 1. Define a new variable in thermal_trip to capture the monitor rising/falling information from trip point DT bindings. 2. Define a new ops in thermal_zone_device_ops that can be populated to indicate whether a trip is being monitored for rising or falling temperature. If the ops is not populated or if the binding is missing in the DT, it is assumed that the trip is being monitored for rising temperature. (default behavior today) Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org> --- drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 2 ++ include/uapi/linux/thermal.h | 5 +++++ 3 files changed, 9 insertions(+)