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()
43 get_thermal_instance(struct thermal_zone_device *tz, in get_thermal_instance() argument
50 mutex_lock(&tz->lock); in get_thermal_instance()
53 trip = &tz->trips[trip_index]; in get_thermal_instance()
55 list_for_each_entry(pos, &tz->thermal_instances, tz_node) { in get_thermal_instance()
56 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { in get_thermal_instance()
63 mutex_unlock(&tz->lock); in get_thermal_instance()
71 * @tz: a valid pointer to a struct thermal_zone_device
77 * Both tz and tz->ops must be valid pointers when calling this function,
78 * and the tz->ops->get_temp callback must be provided.
79 * The function must be called under tz->lock.
83 int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) in __thermal_zone_get_temp() argument
89 lockdep_assert_held(&tz->lock); in __thermal_zone_get_temp()
91 ret = tz->ops->get_temp(tz, temp); in __thermal_zone_get_temp()
93 if (IS_ENABLED(CONFIG_THERMAL_EMULATION) && tz->emul_temperature) { in __thermal_zone_get_temp()
94 for_each_trip(tz, trip) { in __thermal_zone_get_temp()
107 *temp = tz->emul_temperature; in __thermal_zone_get_temp()
111 dev_dbg(&tz->device, "Failed to get temperature: %d\n", ret); in __thermal_zone_get_temp()
118 * @tz: a valid pointer to a struct thermal_zone_device
126 int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) in thermal_zone_get_temp() argument
130 if (IS_ERR_OR_NULL(tz)) in thermal_zone_get_temp()
133 mutex_lock(&tz->lock); in thermal_zone_get_temp()
135 if (!tz->ops->get_temp) { in thermal_zone_get_temp()
140 ret = __thermal_zone_get_temp(tz, temp); in thermal_zone_get_temp()
143 mutex_unlock(&tz->lock); in thermal_zone_get_temp()
176 instance->tz->id, instance->target); in __thermal_cdev_update()
207 * @tz: thermal zone device with the slope attribute
212 int thermal_zone_get_slope(struct thermal_zone_device *tz) in thermal_zone_get_slope() argument
214 if (tz && tz->tzp) in thermal_zone_get_slope()
215 return tz->tzp->slope; in thermal_zone_get_slope()
222 * @tz: thermal zone device with the offset attribute
227 int thermal_zone_get_offset(struct thermal_zone_device *tz) in thermal_zone_get_offset() argument
229 if (tz && tz->tzp) in thermal_zone_get_offset()
230 return tz->tzp->offset; in thermal_zone_get_offset()