Lines Matching refs:tz
172 struct device_node *np, *tz;
185 for_each_available_child_of_node(np, tz) {
189 count = of_count_phandle_with_args(tz, "thermal-sensors",
192 pr_err("%pOFn: missing thermal sensor\n", tz);
193 tz = ERR_PTR(-EINVAL);
201 ret = of_parse_phandle_with_args(tz, "thermal-sensors",
205 pr_err("%pOFn: Failed to read thermal-sensors cells: %d\n", tz, ret);
206 tz = ERR_PTR(ret);
212 pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, tz);
217 tz = ERR_PTR(-ENODEV);
220 return tz;
269 static struct device_node *thermal_of_zone_get_by_name(struct thermal_zone_device *tz)
277 tz_np = of_get_child_by_name(np, tz->type);
288 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev)
311 ret = thermal_zone_unbind_cooling_device(tz, trip_id, cdev);
313 pr_err("Failed to unbind '%s' with '%s': %d\n", tz->type, cdev->type, ret);
319 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev)
344 ret = thermal_zone_bind_cooling_device(tz, trip_id, cdev, cooling_spec.args[1],
348 pr_err("Failed to bind '%s' with '%s': %d\n", tz->type, cdev->type, ret);
354 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev,
381 action(map_np, i, trip_id, tz, cdev);
386 static int thermal_of_for_each_cooling_maps(struct thermal_zone_device *tz,
394 tz_np = thermal_of_zone_get_by_name(tz);
396 pr_err("Failed to get node tz by name\n");
405 ret = thermal_of_for_each_cooling_device(tz_np, child, tz, cdev, action);
419 static int thermal_of_bind(struct thermal_zone_device *tz,
422 return thermal_of_for_each_cooling_maps(tz, cdev, __thermal_of_bind);
425 static int thermal_of_unbind(struct thermal_zone_device *tz,
428 return thermal_of_for_each_cooling_maps(tz, cdev, __thermal_of_unbind);
437 * @tz: a pointer to the thermal zone structure
439 static void thermal_of_zone_unregister(struct thermal_zone_device *tz)
441 struct thermal_trip *trips = tz->trips;
442 struct thermal_zone_device_ops *ops = tz->ops;
444 thermal_zone_device_disable(tz);
445 thermal_zone_device_unregister(tz);
473 struct thermal_zone_device *tz;
514 tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
517 if (IS_ERR(tz)) {
518 ret = PTR_ERR(tz);
523 ret = thermal_zone_device_enable(tz);
526 tz->type, tz->id, ret);
527 thermal_of_zone_unregister(tz);
531 return tz;
594 * @tz: a pointer to struct thermal_zone where the sensor is registered.
603 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz)
606 devm_thermal_of_zone_match, tz));