Lines Matching refs:tz
39 struct thermal_zone_device *tz; member
58 struct thermal_zone_device *tz = temp->tz; in temp_input_show() local
60 ret = thermal_zone_get_temp(tz, &temperature); in temp_input_show()
76 struct thermal_zone_device *tz = temp->tz; in temp_crit_show() local
80 mutex_lock(&tz->lock); in temp_crit_show()
82 if (device_is_registered(&tz->device)) in temp_crit_show()
83 ret = tz->ops->get_crit_temp(tz, &temperature); in temp_crit_show()
87 mutex_unlock(&tz->lock); in temp_crit_show()
97 thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz) in thermal_hwmon_lookup_by_type() argument
104 strcpy(type, tz->type); in thermal_hwmon_lookup_by_type()
119 const struct thermal_zone_device *tz) in thermal_hwmon_lookup_temp() argument
125 if (temp->tz == tz) { in thermal_hwmon_lookup_temp()
134 static bool thermal_zone_crit_temp_valid(struct thermal_zone_device *tz) in thermal_zone_crit_temp_valid() argument
137 return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp); in thermal_zone_crit_temp_valid()
140 int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) in thermal_add_hwmon_sysfs() argument
147 hwmon = thermal_hwmon_lookup_by_type(tz); in thermal_add_hwmon_sysfs()
158 strscpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); in thermal_add_hwmon_sysfs()
160 hwmon->device = hwmon_device_register_for_thermal(&tz->device, in thermal_add_hwmon_sysfs()
174 temp->tz = tz; in thermal_add_hwmon_sysfs()
187 if (thermal_zone_crit_temp_valid(tz)) { in thermal_add_hwmon_sysfs()
223 void thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) in thermal_remove_hwmon_sysfs() argument
228 hwmon = thermal_hwmon_lookup_by_type(tz); in thermal_remove_hwmon_sysfs()
231 dev_dbg(&tz->device, "hwmon device lookup failed!\n"); in thermal_remove_hwmon_sysfs()
235 temp = thermal_hwmon_lookup_temp(hwmon, tz); in thermal_remove_hwmon_sysfs()
238 dev_dbg(&tz->device, "temperature input lookup failed!\n"); in thermal_remove_hwmon_sysfs()
243 if (thermal_zone_crit_temp_valid(tz)) in thermal_remove_hwmon_sysfs()
266 int devm_thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) in devm_thermal_add_hwmon_sysfs() argument
276 ret = thermal_add_hwmon_sysfs(tz); in devm_thermal_add_hwmon_sysfs()
282 *ptr = tz; in devm_thermal_add_hwmon_sysfs()
283 devres_add(&tz->device, ptr); in devm_thermal_add_hwmon_sysfs()