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