Lines Matching full:tz

25 int get_tz_trend(struct thermal_zone_device *tz, const struct thermal_trip *trip)  in get_tz_trend()  argument
29 if (tz->emul_temperature || !tz->ops.get_trend || in get_tz_trend()
30 tz->ops.get_trend(tz, trip, &trend)) { in get_tz_trend()
31 if (tz->temperature > tz->last_temperature) in get_tz_trend()
33 else if (tz->temperature < tz->last_temperature) in get_tz_trend()
42 static bool thermal_instance_present(struct thermal_zone_device *tz, in thermal_instance_present() argument
57 bool thermal_trip_is_bound_to_cdev(struct thermal_zone_device *tz, in thermal_trip_is_bound_to_cdev() argument
61 guard(thermal_zone)(tz); in thermal_trip_is_bound_to_cdev()
64 return thermal_instance_present(tz, cdev, trip); in thermal_trip_is_bound_to_cdev()
70 * @tz: a valid pointer to a struct thermal_zone_device
76 * Both tz and tz->ops must be valid pointers when calling this function,
77 * and the tz->ops.get_temp callback must be provided.
78 * The function must be called under tz->lock.
82 int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) in __thermal_zone_get_temp() argument
88 lockdep_assert_held(&tz->lock); in __thermal_zone_get_temp()
90 ret = tz->ops.get_temp(tz, temp); in __thermal_zone_get_temp()
92 if (IS_ENABLED(CONFIG_THERMAL_EMULATION) && tz->emul_temperature) { in __thermal_zone_get_temp()
93 for_each_trip_desc(tz, td) { in __thermal_zone_get_temp()
108 *temp = tz->emul_temperature; in __thermal_zone_get_temp()
112 dev_dbg(&tz->device, "Failed to get temperature: %d\n", ret); in __thermal_zone_get_temp()
119 * @tz: a valid pointer to a struct thermal_zone_device
127 int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) in thermal_zone_get_temp() argument
131 if (IS_ERR_OR_NULL(tz)) in thermal_zone_get_temp()
134 guard(thermal_zone)(tz); in thermal_zone_get_temp()
136 if (!tz->ops.get_temp) in thermal_zone_get_temp()
139 ret = __thermal_zone_get_temp(tz, temp); in thermal_zone_get_temp()
214 * @tz: thermal zone device with the slope attribute
219 int thermal_zone_get_slope(struct thermal_zone_device *tz) in thermal_zone_get_slope() argument
221 if (tz && tz->tzp) in thermal_zone_get_slope()
222 return tz->tzp->slope; in thermal_zone_get_slope()
229 * @tz: thermal zone device with the offset attribute
234 int thermal_zone_get_offset(struct thermal_zone_device *tz) in thermal_zone_get_offset() argument
236 if (tz && tz->tzp) in thermal_zone_get_offset()
237 return tz->tzp->offset; in thermal_zone_get_offset()