Lines Matching refs:tz
87 static int of_thermal_get_temp(struct thermal_zone_device *tz, in of_thermal_get_temp() argument
90 struct __thermal_zone *data = tz->devdata; in of_thermal_get_temp()
98 static int of_thermal_set_trips(struct thermal_zone_device *tz, in of_thermal_set_trips() argument
101 struct __thermal_zone *data = tz->devdata; in of_thermal_set_trips()
119 int of_thermal_get_ntrips(struct thermal_zone_device *tz) in of_thermal_get_ntrips() argument
121 struct __thermal_zone *data = tz->devdata; in of_thermal_get_ntrips()
140 bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip) in of_thermal_is_trip_valid() argument
142 struct __thermal_zone *data = tz->devdata; in of_thermal_is_trip_valid()
162 of_thermal_get_trip_points(struct thermal_zone_device *tz) in of_thermal_get_trip_points() argument
164 struct __thermal_zone *data = tz->devdata; in of_thermal_get_trip_points()
184 static int of_thermal_set_emul_temp(struct thermal_zone_device *tz, in of_thermal_set_emul_temp() argument
187 struct __thermal_zone *data = tz->devdata; in of_thermal_set_emul_temp()
192 static int of_thermal_get_trend(struct thermal_zone_device *tz, int trip, in of_thermal_get_trend() argument
195 struct __thermal_zone *data = tz->devdata; in of_thermal_get_trend()
270 static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_type() argument
273 struct __thermal_zone *data = tz->devdata; in of_thermal_get_trip_type()
283 static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_temp() argument
286 struct __thermal_zone *data = tz->devdata; in of_thermal_get_trip_temp()
296 static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip, in of_thermal_set_trip_temp() argument
299 struct __thermal_zone *data = tz->devdata; in of_thermal_set_trip_temp()
318 static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_hyst() argument
321 struct __thermal_zone *data = tz->devdata; in of_thermal_get_trip_hyst()
331 static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip, in of_thermal_set_trip_hyst() argument
334 struct __thermal_zone *data = tz->devdata; in of_thermal_set_trip_hyst()
345 static int of_thermal_get_crit_temp(struct thermal_zone_device *tz, in of_thermal_get_crit_temp() argument
348 struct __thermal_zone *data = tz->devdata; in of_thermal_get_crit_temp()
380 struct __thermal_zone *tz; in thermal_zone_of_add_sensor() local
386 tz = tzd->devdata; in thermal_zone_of_add_sensor()
392 tz->ops = ops; in thermal_zone_of_add_sensor()
393 tz->sensor_data = data; in thermal_zone_of_add_sensor()
551 struct __thermal_zone *tz; in thermal_zone_of_sensor_unregister() local
556 tz = tzd->devdata; in thermal_zone_of_sensor_unregister()
559 if (!tz) in thermal_zone_of_sensor_unregister()
567 tz->ops = NULL; in thermal_zone_of_sensor_unregister()
568 tz->sensor_data = NULL; in thermal_zone_of_sensor_unregister()
850 struct __thermal_zone *tz; in thermal_of_build_thermal_zone() local
859 tz = kzalloc(sizeof(*tz), GFP_KERNEL); in thermal_of_build_thermal_zone()
860 if (!tz) in thermal_of_build_thermal_zone()
868 tz->passive_delay = prop; in thermal_of_build_thermal_zone()
875 tz->polling_delay = prop; in thermal_of_build_thermal_zone()
884 tz->slope = coef[0]; in thermal_of_build_thermal_zone()
885 tz->offset = coef[1]; in thermal_of_build_thermal_zone()
887 tz->slope = 1; in thermal_of_build_thermal_zone()
888 tz->offset = 0; in thermal_of_build_thermal_zone()
898 tz->ntrips = of_get_child_count(child); in thermal_of_build_thermal_zone()
899 if (tz->ntrips == 0) /* must have at least one child */ in thermal_of_build_thermal_zone()
902 tz->trips = kcalloc(tz->ntrips, sizeof(*tz->trips), GFP_KERNEL); in thermal_of_build_thermal_zone()
903 if (!tz->trips) { in thermal_of_build_thermal_zone()
910 ret = thermal_of_populate_trip(gchild, &tz->trips[i++]); in thermal_of_build_thermal_zone()
924 tz->num_tbps = of_get_child_count(child); in thermal_of_build_thermal_zone()
925 if (tz->num_tbps == 0) in thermal_of_build_thermal_zone()
928 tz->tbps = kcalloc(tz->num_tbps, sizeof(*tz->tbps), GFP_KERNEL); in thermal_of_build_thermal_zone()
929 if (!tz->tbps) { in thermal_of_build_thermal_zone()
936 ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++], in thermal_of_build_thermal_zone()
937 tz->trips, tz->ntrips); in thermal_of_build_thermal_zone()
945 return tz; in thermal_of_build_thermal_zone()
949 struct __thermal_bind_params *tbp = tz->tbps + i; in thermal_of_build_thermal_zone()
958 kfree(tz->tbps); in thermal_of_build_thermal_zone()
960 for (i = 0; i < tz->ntrips; i++) in thermal_of_build_thermal_zone()
961 of_node_put(tz->trips[i].np); in thermal_of_build_thermal_zone()
962 kfree(tz->trips); in thermal_of_build_thermal_zone()
965 kfree(tz); in thermal_of_build_thermal_zone()
971 static __init void of_thermal_free_zone(struct __thermal_zone *tz) in of_thermal_free_zone() argument
976 for (i = 0; i < tz->num_tbps; i++) { in of_thermal_free_zone()
977 tbp = tz->tbps + i; in of_thermal_free_zone()
985 kfree(tz->tbps); in of_thermal_free_zone()
986 for (i = 0; i < tz->ntrips; i++) in of_thermal_free_zone()
987 of_node_put(tz->trips[i].np); in of_thermal_free_zone()
988 kfree(tz->trips); in of_thermal_free_zone()
989 kfree(tz); in of_thermal_free_zone()
1039 struct __thermal_zone *tz; in of_parse_thermal_zones() local
1054 tz = thermal_of_build_thermal_zone(child); in of_parse_thermal_zones()
1055 if (IS_ERR(tz)) { in of_parse_thermal_zones()
1058 PTR_ERR(tz)); in of_parse_thermal_zones()
1078 for (i = 0; i < tz->ntrips; i++) in of_parse_thermal_zones()
1082 tzp->slope = tz->slope; in of_parse_thermal_zones()
1083 tzp->offset = tz->offset; in of_parse_thermal_zones()
1085 zone = thermal_zone_device_register(child->name, tz->ntrips, in of_parse_thermal_zones()
1086 mask, tz, in of_parse_thermal_zones()
1088 tz->passive_delay, in of_parse_thermal_zones()
1089 tz->polling_delay); in of_parse_thermal_zones()
1095 of_thermal_free_zone(tz); in of_parse_thermal_zones()
1106 of_thermal_free_zone(tz); in of_parse_thermal_zones()