Lines Matching full:tz

30 	struct thermal_zone_device *tz = to_thermal_zone(dev);  in type_show()  local
32 return sprintf(buf, "%s\n", tz->type); in type_show()
38 struct thermal_zone_device *tz = to_thermal_zone(dev); in temp_show() local
41 ret = thermal_zone_get_temp(tz, &temperature); in temp_show()
52 struct thermal_zone_device *tz = to_thermal_zone(dev); in mode_show() local
54 guard(thermal_zone)(tz); in mode_show()
56 if (tz->mode == THERMAL_DEVICE_ENABLED) in mode_show()
66 struct thermal_zone_device *tz = to_thermal_zone(dev); in mode_store() local
70 result = thermal_zone_device_enable(tz); in mode_store()
72 result = thermal_zone_device_disable(tz); in mode_store()
105 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_temp_store() local
111 guard(thermal_zone)(tz); in trip_point_temp_store()
121 if (tz->ops.set_trip_temp) { in trip_point_temp_store()
124 ret = tz->ops.set_trip_temp(tz, trip, temp); in trip_point_temp_store()
129 thermal_zone_set_trip_temp(tz, trip, temp); in trip_point_temp_store()
131 __thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED); in trip_point_temp_store()
150 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_hyst_store() local
156 guard(thermal_zone)(tz); in trip_point_hyst_store()
175 thermal_zone_set_trip_hyst(tz, trip, hyst); in trip_point_hyst_store()
177 __thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED); in trip_point_hyst_store()
195 struct thermal_zone_device *tz = to_thermal_zone(dev); in policy_store() local
201 ret = thermal_zone_device_set_policy(tz, name); in policy_store()
211 struct thermal_zone_device *tz = to_thermal_zone(dev); in policy_show() local
213 return sprintf(buf, "%s\n", tz->governor->name); in policy_show()
228 struct thermal_zone_device *tz = to_thermal_zone(dev); in emul_temp_store() local
234 guard(thermal_zone)(tz); in emul_temp_store()
236 if (tz->ops.set_emul_temp) { in emul_temp_store()
239 ret = tz->ops.set_emul_temp(tz, temperature); in emul_temp_store()
243 tz->emul_temperature = temperature; in emul_temp_store()
246 __thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); in emul_temp_store()
257 struct thermal_zone_device *tz = to_thermal_zone(dev); in sustainable_power_show() local
259 if (tz->tzp) in sustainable_power_show()
260 return sprintf(buf, "%u\n", tz->tzp->sustainable_power); in sustainable_power_show()
269 struct thermal_zone_device *tz = to_thermal_zone(dev); in sustainable_power_store() local
272 if (!tz->tzp) in sustainable_power_store()
278 tz->tzp->sustainable_power = sustainable_power; in sustainable_power_store()
288 struct thermal_zone_device *tz = to_thermal_zone(dev); \
290 if (tz->tzp) \
291 return sprintf(buf, "%d\n", tz->tzp->name); \
300 struct thermal_zone_device *tz = to_thermal_zone(dev); \
303 if (!tz->tzp) \
309 tz->tzp->name = value; \
379 * @tz: the thermal zone device
386 static int create_trip_attrs(struct thermal_zone_device *tz) in create_trip_attrs() argument
392 attrs = kcalloc(tz->num_trips * 3 + 1, sizeof(*attrs), GFP_KERNEL); in create_trip_attrs()
397 for_each_trip_desc(tz, td) { in create_trip_attrs()
422 attrs[i + tz->num_trips] = &trip_attrs->temp.attr.attr; in create_trip_attrs()
435 attrs[i + 2 * tz->num_trips] = &trip_attrs->hyst.attr.attr; in create_trip_attrs()
438 attrs[tz->num_trips * 3] = NULL; in create_trip_attrs()
440 tz->trips_attribute_group.attrs = attrs; in create_trip_attrs()
447 * @tz: the thermal zone device
451 static void destroy_trip_attrs(struct thermal_zone_device *tz) in destroy_trip_attrs() argument
453 if (tz) in destroy_trip_attrs()
454 kfree(tz->trips_attribute_group.attrs); in destroy_trip_attrs()
457 int thermal_zone_create_device_groups(struct thermal_zone_device *tz) in thermal_zone_create_device_groups() argument
472 if (tz->num_trips) { in thermal_zone_create_device_groups()
473 result = create_trip_attrs(tz); in thermal_zone_create_device_groups()
480 groups[size - 2] = &tz->trips_attribute_group; in thermal_zone_create_device_groups()
483 tz->device.groups = groups; in thermal_zone_create_device_groups()
488 void thermal_zone_destroy_device_groups(struct thermal_zone_device *tz) in thermal_zone_destroy_device_groups() argument
490 if (!tz) in thermal_zone_destroy_device_groups()
493 if (tz->num_trips) in thermal_zone_destroy_device_groups()
494 destroy_trip_attrs(tz); in thermal_zone_destroy_device_groups()
496 kfree(tz->device.groups); in thermal_zone_destroy_device_groups()
841 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_show() local
846 return sprintf(buf, "%d\n", thermal_zone_trip_id(tz, instance->trip)); in trip_point_show()
862 struct thermal_zone_device *tz = to_thermal_zone(dev); in weight_store() local
873 guard(thermal_zone)(tz); in weight_store()
877 thermal_governor_update_tz(tz, THERMAL_INSTANCE_WEIGHT_CHANGED); in weight_store()