Lines Matching full:tz
12 int for_each_thermal_trip(struct thermal_zone_device *tz, in for_each_thermal_trip() argument
19 for_each_trip(tz, trip) { in for_each_thermal_trip()
29 int thermal_zone_for_each_trip(struct thermal_zone_device *tz, in thermal_zone_for_each_trip() argument
35 mutex_lock(&tz->lock); in thermal_zone_for_each_trip()
36 ret = for_each_thermal_trip(tz, cb, data); in thermal_zone_for_each_trip()
37 mutex_unlock(&tz->lock); in thermal_zone_for_each_trip()
43 int thermal_zone_get_num_trips(struct thermal_zone_device *tz) in thermal_zone_get_num_trips() argument
45 return tz->num_trips; in thermal_zone_get_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) in __thermal_zone_set_trips() argument
71 lockdep_assert_held(&tz->lock); in __thermal_zone_set_trips()
73 if (!tz->ops->set_trips) in __thermal_zone_set_trips()
76 for_each_trip(tz, trip) { in __thermal_zone_set_trips()
82 if (trip_low < tz->temperature && trip_low > low) { in __thermal_zone_set_trips()
88 if (trip->temperature > tz->temperature && in __thermal_zone_set_trips()
96 if (tz->prev_low_trip == low && tz->prev_high_trip == high) in __thermal_zone_set_trips()
103 if (same_trip && (tz->prev_low_trip != -INT_MAX || in __thermal_zone_set_trips()
104 tz->prev_high_trip != INT_MAX)) in __thermal_zone_set_trips()
107 tz->prev_low_trip = low; in __thermal_zone_set_trips()
108 tz->prev_high_trip = high; in __thermal_zone_set_trips()
110 dev_dbg(&tz->device, in __thermal_zone_set_trips()
117 ret = tz->ops->set_trips(tz, low, high); in __thermal_zone_set_trips()
119 dev_err(&tz->device, "Failed to set trips: %d\n", ret); in __thermal_zone_set_trips()
122 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, in __thermal_zone_get_trip() argument
125 if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip) in __thermal_zone_get_trip()
128 *trip = tz->trips[trip_id]; in __thermal_zone_get_trip()
133 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, in thermal_zone_get_trip() argument
138 mutex_lock(&tz->lock); in thermal_zone_get_trip()
139 ret = __thermal_zone_get_trip(tz, trip_id, trip); in thermal_zone_get_trip()
140 mutex_unlock(&tz->lock); in thermal_zone_get_trip()
146 int thermal_zone_trip_id(const struct thermal_zone_device *tz, in thermal_zone_trip_id() argument
153 return trip - tz->trips; in thermal_zone_trip_id()
155 void thermal_zone_trip_updated(struct thermal_zone_device *tz, in thermal_zone_trip_updated() argument
158 thermal_notify_tz_trip_change(tz, trip); in thermal_zone_trip_updated()
159 __thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED); in thermal_zone_trip_updated()
162 void thermal_zone_set_trip_temp(struct thermal_zone_device *tz, in thermal_zone_set_trip_temp() argument
169 thermal_notify_tz_trip_change(tz, trip); in thermal_zone_set_trip_temp()