Lines Matching refs:tz
87 static int of_thermal_get_temp(struct thermal_zone_device *tz,
90 struct __thermal_zone *data = tz->devdata;
98 static int of_thermal_set_trips(struct thermal_zone_device *tz,
101 struct __thermal_zone *data = tz->devdata;
112 * @tz: pointer to a thermal zone
119 int of_thermal_get_ntrips(struct thermal_zone_device *tz)
121 struct __thermal_zone *data = tz->devdata;
133 * @tz: pointer to a thermal zone
140 bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip)
142 struct __thermal_zone *data = tz->devdata;
155 * @tz: pointer to a thermal zone
162 of_thermal_get_trip_points(struct thermal_zone_device *tz)
164 struct __thermal_zone *data = tz->devdata;
176 * @tz: pointer to a thermal zone
184 static int of_thermal_set_emul_temp(struct thermal_zone_device *tz,
187 struct __thermal_zone *data = tz->devdata;
195 static int of_thermal_get_trend(struct thermal_zone_device *tz, int trip,
198 struct __thermal_zone *data = tz->devdata;
273 static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip,
276 struct __thermal_zone *data = tz->devdata;
286 static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
289 struct __thermal_zone *data = tz->devdata;
299 static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
302 struct __thermal_zone *data = tz->devdata;
321 static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip,
324 struct __thermal_zone *data = tz->devdata;
334 static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
337 struct __thermal_zone *data = tz->devdata;
348 static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
351 struct __thermal_zone *data = tz->devdata;
383 struct __thermal_zone *tz;
389 tz = tzd->devdata;
395 tz->ops = ops;
396 tz->sensor_data = data;
554 struct __thermal_zone *tz;
559 tz = tzd->devdata;
562 if (!tz)
573 tz->ops = NULL;
574 tz->sensor_data = NULL;
859 struct __thermal_zone *tz;
868 tz = kzalloc(sizeof(*tz), GFP_KERNEL);
869 if (!tz)
877 tz->passive_delay = prop;
884 tz->polling_delay = prop;
893 tz->slope = coef[0];
894 tz->offset = coef[1];
896 tz->slope = 1;
897 tz->offset = 0;
907 tz->ntrips = of_get_child_count(child);
908 if (tz->ntrips == 0) /* must have at least one child */
911 tz->trips = kcalloc(tz->ntrips, sizeof(*tz->trips), GFP_KERNEL);
912 if (!tz->trips) {
919 ret = thermal_of_populate_trip(gchild, &tz->trips[i++]);
933 tz->num_tbps = of_get_child_count(child);
934 if (tz->num_tbps == 0)
937 tz->tbps = kcalloc(tz->num_tbps, sizeof(*tz->tbps), GFP_KERNEL);
938 if (!tz->tbps) {
945 ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++],
946 tz->trips, tz->ntrips);
954 return tz;
958 struct __thermal_bind_params *tbp = tz->tbps + i;
967 kfree(tz->tbps);
969 for (i = 0; i < tz->ntrips; i++)
970 of_node_put(tz->trips[i].np);
971 kfree(tz->trips);
974 kfree(tz);
980 static __init void of_thermal_free_zone(struct __thermal_zone *tz)
985 for (i = 0; i < tz->num_tbps; i++) {
986 tbp = tz->tbps + i;
994 kfree(tz->tbps);
995 for (i = 0; i < tz->ntrips; i++)
996 of_node_put(tz->trips[i].np);
997 kfree(tz->trips);
998 kfree(tz);
1048 struct __thermal_zone *tz;
1063 tz = thermal_of_build_thermal_zone(child);
1064 if (IS_ERR(tz)) {
1067 PTR_ERR(tz));
1087 for (i = 0; i < tz->ntrips; i++)
1091 tzp->slope = tz->slope;
1092 tzp->offset = tz->offset;
1094 zone = thermal_zone_device_register(child->name, tz->ntrips,
1095 mask, tz,
1097 tz->passive_delay,
1098 tz->polling_delay);
1104 of_thermal_free_zone(tz);
1115 of_thermal_free_zone(tz);