• Home
  • Raw
  • Download

Lines Matching full:tz

29 	struct thermal_zone_device *tz = to_thermal_zone(dev);  in type_show()  local
31 return sprintf(buf, "%s\n", tz->type); in type_show()
37 struct thermal_zone_device *tz = to_thermal_zone(dev); in temp_show() local
40 ret = thermal_zone_get_temp(tz, &temperature); in temp_show()
51 struct thermal_zone_device *tz = to_thermal_zone(dev); in mode_show() local
52 int enabled = thermal_zone_device_is_enabled(tz); in mode_show()
61 struct thermal_zone_device *tz = to_thermal_zone(dev); in mode_store() local
65 result = thermal_zone_device_enable(tz); in mode_store()
67 result = thermal_zone_device_disable(tz); in mode_store()
81 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_type_show() local
85 if (!tz->ops->get_trip_type) in trip_point_type_show()
91 result = tz->ops->get_trip_type(tz, trip, &type); in trip_point_type_show()
113 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_temp_store() local
118 if (!tz->ops->set_trip_temp) in trip_point_temp_store()
127 ret = tz->ops->set_trip_temp(tz, trip, temperature); in trip_point_temp_store()
131 if (tz->ops->get_trip_hyst) { in trip_point_temp_store()
132 ret = tz->ops->get_trip_hyst(tz, trip, &hyst); in trip_point_temp_store()
137 ret = tz->ops->get_trip_type(tz, trip, &type); in trip_point_temp_store()
141 thermal_notify_tz_trip_change(tz->id, trip, type, temperature, hyst); in trip_point_temp_store()
143 thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); in trip_point_temp_store()
152 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_temp_show() local
156 if (!tz->ops->get_trip_temp) in trip_point_temp_show()
162 ret = tz->ops->get_trip_temp(tz, trip, &temperature); in trip_point_temp_show()
174 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_hyst_store() local
178 if (!tz->ops->set_trip_hyst) in trip_point_hyst_store()
192 ret = tz->ops->set_trip_hyst(tz, trip, temperature); in trip_point_hyst_store()
195 thermal_zone_set_trips(tz); in trip_point_hyst_store()
204 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_hyst_show() local
208 if (!tz->ops->get_trip_hyst) in trip_point_hyst_show()
214 ret = tz->ops->get_trip_hyst(tz, trip, &temperature); in trip_point_hyst_show()
223 struct thermal_zone_device *tz = to_thermal_zone(dev); in passive_store() local
235 if (state && !tz->forced_passive) { in passive_store()
236 if (!tz->passive_delay) in passive_store()
237 tz->passive_delay = 1000; in passive_store()
238 thermal_zone_device_rebind_exception(tz, "Processor", in passive_store()
240 } else if (!state && tz->forced_passive) { in passive_store()
241 tz->passive_delay = 0; in passive_store()
242 thermal_zone_device_unbind_exception(tz, "Processor", in passive_store()
246 tz->forced_passive = state; in passive_store()
248 thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); in passive_store()
257 struct thermal_zone_device *tz = to_thermal_zone(dev); in passive_show() local
259 return sprintf(buf, "%d\n", tz->forced_passive); in passive_show()
266 struct thermal_zone_device *tz = to_thermal_zone(dev); in policy_store() local
272 ret = thermal_zone_device_set_policy(tz, name); in policy_store()
282 struct thermal_zone_device *tz = to_thermal_zone(dev); in policy_show() local
284 return sprintf(buf, "%s\n", tz->governor->name); in policy_show()
299 struct thermal_zone_device *tz = to_thermal_zone(dev); in emul_temp_store() local
306 if (!tz->ops->set_emul_temp) { in emul_temp_store()
307 mutex_lock(&tz->lock); in emul_temp_store()
308 tz->emul_temperature = temperature; in emul_temp_store()
309 mutex_unlock(&tz->lock); in emul_temp_store()
311 ret = tz->ops->set_emul_temp(tz, temperature); in emul_temp_store()
315 thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); in emul_temp_store()
326 struct thermal_zone_device *tz = to_thermal_zone(dev); in sustainable_power_show() local
328 if (tz->tzp) in sustainable_power_show()
329 return sprintf(buf, "%u\n", tz->tzp->sustainable_power); in sustainable_power_show()
338 struct thermal_zone_device *tz = to_thermal_zone(dev); in sustainable_power_store() local
341 if (!tz->tzp) in sustainable_power_store()
347 tz->tzp->sustainable_power = sustainable_power; in sustainable_power_store()
357 struct thermal_zone_device *tz = to_thermal_zone(dev); \
359 if (tz->tzp) \
360 return sprintf(buf, "%d\n", tz->tzp->name); \
369 struct thermal_zone_device *tz = to_thermal_zone(dev); \
372 if (!tz->tzp) \
378 tz->tzp->name = value; \
452 struct thermal_zone_device *tz; in thermal_zone_passive_is_visible() local
456 tz = container_of(dev, struct thermal_zone_device, device); in thermal_zone_passive_is_visible()
458 for (count = 0; count < tz->trips && !passive; count++) { in thermal_zone_passive_is_visible()
459 tz->ops->get_trip_type(tz, count, &trip_type); in thermal_zone_passive_is_visible()
485 * @tz: the thermal zone device
493 static int create_trip_attrs(struct thermal_zone_device *tz, int mask) in create_trip_attrs() argument
499 if (tz->trips <= 0) in create_trip_attrs()
502 tz->trip_type_attrs = kcalloc(tz->trips, sizeof(*tz->trip_type_attrs), in create_trip_attrs()
504 if (!tz->trip_type_attrs) in create_trip_attrs()
507 tz->trip_temp_attrs = kcalloc(tz->trips, sizeof(*tz->trip_temp_attrs), in create_trip_attrs()
509 if (!tz->trip_temp_attrs) { in create_trip_attrs()
510 kfree(tz->trip_type_attrs); in create_trip_attrs()
514 if (tz->ops->get_trip_hyst) { in create_trip_attrs()
515 tz->trip_hyst_attrs = kcalloc(tz->trips, in create_trip_attrs()
516 sizeof(*tz->trip_hyst_attrs), in create_trip_attrs()
518 if (!tz->trip_hyst_attrs) { in create_trip_attrs()
519 kfree(tz->trip_type_attrs); in create_trip_attrs()
520 kfree(tz->trip_temp_attrs); in create_trip_attrs()
525 attrs = kcalloc(tz->trips * 3 + 1, sizeof(*attrs), GFP_KERNEL); in create_trip_attrs()
527 kfree(tz->trip_type_attrs); in create_trip_attrs()
528 kfree(tz->trip_temp_attrs); in create_trip_attrs()
529 if (tz->ops->get_trip_hyst) in create_trip_attrs()
530 kfree(tz->trip_hyst_attrs); in create_trip_attrs()
534 for (indx = 0; indx < tz->trips; indx++) { in create_trip_attrs()
536 snprintf(tz->trip_type_attrs[indx].name, THERMAL_NAME_LENGTH, in create_trip_attrs()
539 sysfs_attr_init(&tz->trip_type_attrs[indx].attr.attr); in create_trip_attrs()
540 tz->trip_type_attrs[indx].attr.attr.name = in create_trip_attrs()
541 tz->trip_type_attrs[indx].name; in create_trip_attrs()
542 tz->trip_type_attrs[indx].attr.attr.mode = S_IRUGO; in create_trip_attrs()
543 tz->trip_type_attrs[indx].attr.show = trip_point_type_show; in create_trip_attrs()
544 attrs[indx] = &tz->trip_type_attrs[indx].attr.attr; in create_trip_attrs()
547 snprintf(tz->trip_temp_attrs[indx].name, THERMAL_NAME_LENGTH, in create_trip_attrs()
550 sysfs_attr_init(&tz->trip_temp_attrs[indx].attr.attr); in create_trip_attrs()
551 tz->trip_temp_attrs[indx].attr.attr.name = in create_trip_attrs()
552 tz->trip_temp_attrs[indx].name; in create_trip_attrs()
553 tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO; in create_trip_attrs()
554 tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show; in create_trip_attrs()
557 tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR; in create_trip_attrs()
558 tz->trip_temp_attrs[indx].attr.store = in create_trip_attrs()
561 attrs[indx + tz->trips] = &tz->trip_temp_attrs[indx].attr.attr; in create_trip_attrs()
564 if (!tz->ops->get_trip_hyst) in create_trip_attrs()
566 snprintf(tz->trip_hyst_attrs[indx].name, THERMAL_NAME_LENGTH, in create_trip_attrs()
569 sysfs_attr_init(&tz->trip_hyst_attrs[indx].attr.attr); in create_trip_attrs()
570 tz->trip_hyst_attrs[indx].attr.attr.name = in create_trip_attrs()
571 tz->trip_hyst_attrs[indx].name; in create_trip_attrs()
572 tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; in create_trip_attrs()
573 tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; in create_trip_attrs()
574 if (tz->ops->set_trip_hyst) { in create_trip_attrs()
575 tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; in create_trip_attrs()
576 tz->trip_hyst_attrs[indx].attr.store = in create_trip_attrs()
579 attrs[indx + tz->trips * 2] = in create_trip_attrs()
580 &tz->trip_hyst_attrs[indx].attr.attr; in create_trip_attrs()
582 attrs[tz->trips * 3] = NULL; in create_trip_attrs()
584 tz->trips_attribute_group.attrs = attrs; in create_trip_attrs()
591 * @tz: the thermal zone device
595 static void destroy_trip_attrs(struct thermal_zone_device *tz) in destroy_trip_attrs() argument
597 if (!tz) in destroy_trip_attrs()
600 kfree(tz->trip_type_attrs); in destroy_trip_attrs()
601 kfree(tz->trip_temp_attrs); in destroy_trip_attrs()
602 if (tz->ops->get_trip_hyst) in destroy_trip_attrs()
603 kfree(tz->trip_hyst_attrs); in destroy_trip_attrs()
604 kfree(tz->trips_attribute_group.attrs); in destroy_trip_attrs()
607 int thermal_zone_create_device_groups(struct thermal_zone_device *tz, in thermal_zone_create_device_groups() argument
623 if (tz->trips) { in thermal_zone_create_device_groups()
624 result = create_trip_attrs(tz, mask); in thermal_zone_create_device_groups()
631 groups[size - 2] = &tz->trips_attribute_group; in thermal_zone_create_device_groups()
634 tz->device.groups = groups; in thermal_zone_create_device_groups()
639 void thermal_zone_destroy_device_groups(struct thermal_zone_device *tz) in thermal_zone_destroy_device_groups() argument
641 if (!tz) in thermal_zone_destroy_device_groups()
644 if (tz->trips) in thermal_zone_destroy_device_groups()
645 destroy_trip_attrs(tz); in thermal_zone_destroy_device_groups()
647 kfree(tz->device.groups); in thermal_zone_destroy_device_groups()