Lines Matching refs:tz

12 int for_each_thermal_trip(struct thermal_zone_device *tz,
19 for_each_trip(tz, trip) {
29 int thermal_zone_for_each_trip(struct thermal_zone_device *tz,
35 mutex_lock(&tz->lock);
36 ret = for_each_thermal_trip(tz, cb, data);
37 mutex_unlock(&tz->lock);
43 int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
45 return tz->num_trips;
51 * @tz: a pointer to a thermal zone device structure
59 * This function must be called with tz->lock held. Both tz and tz->ops
64 void __thermal_zone_set_trips(struct thermal_zone_device *tz)
70 lockdep_assert_held(&tz->lock);
72 if (!tz->ops.set_trips)
75 for_each_trip(tz, trip) {
80 if (trip_low < tz->temperature && trip_low > low)
83 if (trip->temperature > tz->temperature &&
89 if (tz->prev_low_trip == low && tz->prev_high_trip == high)
92 tz->prev_low_trip = low;
93 tz->prev_high_trip = high;
95 dev_dbg(&tz->device,
102 ret = tz->ops.set_trips(tz, low, high);
104 dev_err(&tz->device, "Failed to set trips: %d\n", ret);
107 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
110 if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
113 *trip = tz->trips[trip_id];
118 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
123 mutex_lock(&tz->lock);
124 ret = __thermal_zone_get_trip(tz, trip_id, trip);
125 mutex_unlock(&tz->lock);
131 int thermal_zone_trip_id(const struct thermal_zone_device *tz,
138 return trip - tz->trips;
140 void thermal_zone_trip_updated(struct thermal_zone_device *tz,
143 thermal_notify_tz_trip_change(tz, trip);
144 __thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED);
147 void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
154 thermal_notify_tz_trip_change(tz, trip);