Lines Matching refs:tz
171 struct device_node *np, *tz; in of_thermal_zone_find() local
184 for_each_available_child_of_node(np, tz) { in of_thermal_zone_find()
188 count = of_count_phandle_with_args(tz, "thermal-sensors", in of_thermal_zone_find()
191 pr_err("%pOFn: missing thermal sensor\n", tz); in of_thermal_zone_find()
192 tz = ERR_PTR(-EINVAL); in of_thermal_zone_find()
200 ret = of_parse_phandle_with_args(tz, "thermal-sensors", in of_thermal_zone_find()
204 pr_err("%pOFn: Failed to read thermal-sensors cells: %d\n", tz, ret); in of_thermal_zone_find()
205 tz = ERR_PTR(ret); in of_thermal_zone_find()
211 pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, tz); in of_thermal_zone_find()
216 tz = ERR_PTR(-ENODEV); in of_thermal_zone_find()
219 return tz; in of_thermal_zone_find()
274 static struct device_node *thermal_of_zone_get_by_name(struct thermal_zone_device *tz) in thermal_of_zone_get_by_name() argument
282 tz_np = of_get_child_by_name(np, tz->type); in thermal_of_zone_get_by_name()
293 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev) in __thermal_of_unbind() argument
316 ret = thermal_zone_unbind_cooling_device(tz, trip_id, cdev); in __thermal_of_unbind()
318 pr_err("Failed to unbind '%s' with '%s': %d\n", tz->type, cdev->type, ret); in __thermal_of_unbind()
324 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev) in __thermal_of_bind() argument
349 ret = thermal_zone_bind_cooling_device(tz, trip_id, cdev, cooling_spec.args[1], in __thermal_of_bind()
353 pr_err("Failed to bind '%s' with '%s': %d\n", tz->type, cdev->type, ret); in __thermal_of_bind()
359 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev, in thermal_of_for_each_cooling_device() argument
386 action(map_np, i, trip_id, tz, cdev); in thermal_of_for_each_cooling_device()
391 static int thermal_of_for_each_cooling_maps(struct thermal_zone_device *tz, in thermal_of_for_each_cooling_maps() argument
399 tz_np = thermal_of_zone_get_by_name(tz); in thermal_of_for_each_cooling_maps()
410 ret = thermal_of_for_each_cooling_device(tz_np, child, tz, cdev, action); in thermal_of_for_each_cooling_maps()
422 static int thermal_of_bind(struct thermal_zone_device *tz, in thermal_of_bind() argument
425 return thermal_of_for_each_cooling_maps(tz, cdev, __thermal_of_bind); in thermal_of_bind()
428 static int thermal_of_unbind(struct thermal_zone_device *tz, in thermal_of_unbind() argument
431 return thermal_of_for_each_cooling_maps(tz, cdev, __thermal_of_unbind); in thermal_of_unbind()
442 void thermal_of_zone_unregister(struct thermal_zone_device *tz) in thermal_of_zone_unregister() argument
444 struct thermal_trip *trips = tz->trips; in thermal_of_zone_unregister()
445 struct thermal_zone_params *tzp = tz->tzp; in thermal_of_zone_unregister()
446 struct thermal_zone_device_ops *ops = tz->ops; in thermal_of_zone_unregister()
448 thermal_zone_device_disable(tz); in thermal_of_zone_unregister()
449 thermal_zone_device_unregister(tz); in thermal_of_zone_unregister()
479 struct thermal_zone_device *tz; in thermal_of_zone_register() local
525 tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips, in thermal_of_zone_register()
528 if (IS_ERR(tz)) { in thermal_of_zone_register()
529 ret = PTR_ERR(tz); in thermal_of_zone_register()
534 ret = thermal_zone_device_enable(tz); in thermal_of_zone_register()
537 tz->type, tz->id, ret); in thermal_of_zone_register()
538 thermal_of_zone_unregister(tz); in thermal_of_zone_register()
542 return tz; in thermal_of_zone_register()
617 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz) in devm_thermal_of_zone_unregister() argument
620 devm_thermal_of_zone_match, tz)); in devm_thermal_of_zone_unregister()