Lines Matching full:tz

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