| /linux-6.15/drivers/thermal/ |
| H A D | thermal_core.c | 76 if (tz->governor && tz->governor->bind_to_tz) { in bind_previous_governor() 77 if (tz->governor->bind_to_tz(tz)) { in bind_previous_governor() 100 if (tz->governor && tz->governor->unbind_from_tz) in thermal_set_governor() 101 tz->governor->unbind_from_tz(tz); in thermal_set_governor() 268 ret = tz->ops.change_mode(tz, mode); in __thermal_zone_device_set_mode() 369 tz->governor->update_tz(tz, reason); in thermal_governor_update_tz() 409 tz->ops.critical(tz); in handle_critical_trips() 411 tz->ops.hot(tz); in handle_critical_trips() 635 tz->last_temperature = tz->temperature; in __thermal_zone_device_update() 1373 return tz->ops.get_crit_temp(tz, temp); in thermal_zone_get_crit_temp() [all …]
|
| H A D | thermal_helpers.c | 29 if (tz->emul_temperature || !tz->ops.get_trend || in get_tz_trend() 30 tz->ops.get_trend(tz, trip, &trend)) { in get_tz_trend() 31 if (tz->temperature > tz->last_temperature) in get_tz_trend() 33 else if (tz->temperature < tz->last_temperature) in get_tz_trend() 61 guard(thermal_zone)(tz); in thermal_trip_is_bound_to_cdev() 90 ret = tz->ops.get_temp(tz, temp); in __thermal_zone_get_temp() 131 if (IS_ERR_OR_NULL(tz)) in thermal_zone_get_temp() 136 if (!tz->ops.get_temp) in thermal_zone_get_temp() 221 if (tz && tz->tzp) in thermal_zone_get_slope() 222 return tz->tzp->slope; in thermal_zone_get_slope() [all …]
|
| H A D | thermal_netlink.h | 37 int thermal_notify_tz_create(const struct thermal_zone_device *tz); 38 int thermal_notify_tz_delete(const struct thermal_zone_device *tz); 39 int thermal_notify_tz_enable(const struct thermal_zone_device *tz); 40 int thermal_notify_tz_disable(const struct thermal_zone_device *tz); 41 int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz, 43 int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz, 45 int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz, 51 int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz, 56 int thermal_notify_threshold_add(const struct thermal_zone_device *tz, 61 int thermal_notify_threshold_down(const struct thermal_zone_device *tz); [all …]
|
| H A D | gov_power_allocator.c | 177 k_i = tz->tzp->k_pu / 10; in estimate_pid_constants() 256 p = mul_frac(err < 0 ? tz->tzp->k_po : tz->tzp->k_pu, err); in pid_controller() 722 if (!tz->tzp) { in power_allocator_bind() 723 tz->tzp = kzalloc(sizeof(*tz->tzp), GFP_KERNEL); in power_allocator_bind() 724 if (!tz->tzp) { in power_allocator_bind() 738 estimate_pid_constants(tz, tz->tzp->sustainable_power, in power_allocator_bind() 761 dev_dbg(&tz->device, "Unbinding from thermal zone %d\n", tz->id); in power_allocator_unbind() 764 kfree(tz->tzp); in power_allocator_unbind() 765 tz->tzp = NULL; in power_allocator_unbind() 769 kfree(tz->governor_data); in power_allocator_unbind() [all …]
|
| H A D | thermal_thresholds.c | 18 INIT_LIST_HEAD(&tz->user_thresholds); in thermal_thresholds_init() 36 lockdep_assert_held(&tz->lock); in thermal_thresholds_flush() 38 __thermal_thresholds_flush(tz); in thermal_thresholds_flush() 40 thermal_notify_threshold_flush(tz); in thermal_thresholds_flush() 47 __thermal_thresholds_flush(tz); in thermal_thresholds_exit() 132 int temperature = tz->temperature; in thermal_thresholds_handle() 135 lockdep_assert_held(&tz->lock); in thermal_thresholds_handle() 160 thermal_notify_threshold_up(tz); in thermal_thresholds_handle() 174 lockdep_assert_held(&tz->lock); in thermal_thresholds_add() 208 lockdep_assert_held(&tz->lock); in thermal_thresholds_delete() [all …]
|
| H A D | thermal_trip.c | 34 for_each_trip_desc(tz, td) { in for_each_thermal_trip() 48 guard(thermal_zone)(tz); in thermal_zone_for_each_trip() 50 return for_each_thermal_trip(tz, cb, data); in thermal_zone_for_each_trip() 58 lockdep_assert_held(&tz->lock); in thermal_zone_set_trips() 60 if (!tz->ops.set_trips) in thermal_zone_set_trips() 64 if (tz->prev_low_trip == low && tz->prev_high_trip == high) in thermal_zone_set_trips() 67 tz->prev_low_trip = low; in thermal_zone_set_trips() 68 tz->prev_high_trip = high; in thermal_zone_set_trips() 70 dev_dbg(&tz->device, in thermal_zone_set_trips() 77 ret = tz->ops.set_trips(tz, low, high); in thermal_zone_set_trips() [all …]
|
| H A D | thermal_hwmon.c | 40 struct thermal_zone_device *tz; member 59 struct thermal_zone_device *tz = temp->tz; in temp_input_show() local 77 struct thermal_zone_device *tz = temp->tz; in temp_crit_show() local 81 guard(thermal_zone)(tz); in temp_crit_show() 83 ret = tz->ops.get_crit_temp(tz, &temperature); in temp_crit_show() 99 strcpy(type, tz->type); in thermal_hwmon_lookup_by_type() 120 if (temp->tz == tz) { in thermal_hwmon_lookup_temp() 132 return tz->ops.get_crit_temp && !tz->ops.get_crit_temp(tz, &temp); in thermal_zone_crit_temp_valid() 169 temp->tz = tz; in thermal_add_hwmon_sysfs() 273 ret = thermal_add_hwmon_sysfs(tz); in devm_thermal_add_hwmon_sysfs() [all …]
|
| H A D | thermal_sysfs.c | 54 guard(thermal_zone)(tz); in mode_show() 124 ret = tz->ops.set_trip_temp(tz, trip, temp); in trip_point_temp_store() 239 ret = tz->ops.set_emul_temp(tz, temperature); in emul_temp_store() 259 if (tz->tzp) in sustainable_power_show() 272 if (!tz->tzp) in sustainable_power_store() 290 if (tz->tzp) \ 303 if (!tz->tzp) \ 453 if (tz) in destroy_trip_attrs() 472 if (tz->num_trips) { in thermal_zone_create_device_groups() 490 if (!tz) in thermal_zone_destroy_device_groups() [all …]
|
| H A D | thermal_debugfs.h | 8 void thermal_debug_tz_add(struct thermal_zone_device *tz); 9 void thermal_debug_tz_remove(struct thermal_zone_device *tz); 10 void thermal_debug_tz_resume(struct thermal_zone_device *tz); 11 void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, 13 void thermal_debug_tz_trip_down(struct thermal_zone_device *tz, 15 void thermal_debug_update_trip_stats(struct thermal_zone_device *tz); 22 static inline void thermal_debug_tz_add(struct thermal_zone_device *tz) {} in thermal_debug_tz_add() argument 23 static inline void thermal_debug_tz_remove(struct thermal_zone_device *tz) {} in thermal_debug_tz_remove() argument 24 static inline void thermal_debug_tz_resume(struct thermal_zone_device *tz) {} in thermal_debug_tz_resume() argument 25 static inline void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, in thermal_debug_tz_trip_up() argument [all …]
|
| H A D | thermal_netlink.c | 353 struct param p = { .tz_id = tz->id, .name = tz->type }; in thermal_notify_tz_create() 476 struct param p = { .tz_id = tz->id, .temp = tz->temperature, .prev_temp = tz->last_temperature }; in thermal_notify_threshold_down() 483 struct param p = { .tz_id = tz->id, .temp = tz->temperature, .prev_temp = tz->last_temperature }; in thermal_notify_threshold_up() 539 if (!tz) in thermal_genl_cmd_tz_get_trip() 546 guard(thermal_zone)(tz); in thermal_genl_cmd_tz_get_trip() 575 if (!tz) in thermal_genl_cmd_tz_get_temp() 600 if (!tz) in thermal_genl_cmd_tz_get_gov() 673 if (!tz) in thermal_genl_cmd_threshold_get() 706 if (!tz) in thermal_genl_cmd_threshold_add() 731 if (!tz) in thermal_genl_cmd_threshold_delete() [all …]
|
| H A D | gov_fair_share.c | 18 static int get_trip_level(struct thermal_zone_device *tz) in get_trip_level() argument 24 for_each_trip_desc(tz, td) { in get_trip_level() 25 if (td->threshold > tz->temperature) in get_trip_level() 38 trace_thermal_zone_trip(tz, thermal_zone_trip_id(tz, &level_td->trip), in get_trip_level() 63 static void fair_share_throttle(struct thermal_zone_device *tz, in fair_share_throttle() argument 83 divisor = tz->num_trips; in fair_share_throttle() 96 static void fair_share_manage(struct thermal_zone_device *tz) in fair_share_manage() argument 98 int trip_level = get_trip_level(tz); in fair_share_manage() 101 lockdep_assert_held(&tz->lock); in fair_share_manage() 103 for_each_trip_desc(tz, td) { in fair_share_manage() [all …]
|
| H A D | gov_bang_bang.c | 70 lockdep_assert_held(&tz->lock); in bang_bang_trip_crossed() 72 dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n", in bang_bang_trip_crossed() 73 thermal_zone_trip_id(tz, trip), trip->temperature, in bang_bang_trip_crossed() 74 tz->temperature, trip->hysteresis); in bang_bang_trip_crossed() 80 static void bang_bang_manage(struct thermal_zone_device *tz) in bang_bang_manage() argument 86 if (tz->governor_data) in bang_bang_manage() 89 for_each_trip_desc(tz, td) { in bang_bang_manage() 102 turn_on = tz->temperature >= td->threshold; in bang_bang_manage() 109 tz->governor_data = (void *)true; in bang_bang_manage() 112 static void bang_bang_update_tz(struct thermal_zone_device *tz, in bang_bang_update_tz() argument [all …]
|
| H A D | gov_user_space.c | 18 static int user_space_bind(struct thermal_zone_device *tz) in user_space_bind() argument 33 static void user_space_trip_crossed(struct thermal_zone_device *tz, in user_space_trip_crossed() argument 40 lockdep_assert_held(&tz->lock); in user_space_trip_crossed() 42 thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); in user_space_trip_crossed() 43 thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); in user_space_trip_crossed() 45 thermal_zone_trip_id(tz, trip)); in user_space_trip_crossed() 46 thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", tz->notify_event); in user_space_trip_crossed() 48 kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); in user_space_trip_crossed()
|
| H A D | gov_step_wise.c | 68 static void thermal_zone_trip_update(struct thermal_zone_device *tz, in thermal_zone_trip_update() argument 73 enum thermal_trend trend = get_tz_trend(tz, trip); in thermal_zone_trip_update() 74 int trip_id = thermal_zone_trip_id(tz, trip); in thermal_zone_trip_update() 78 if (tz->temperature >= trip_threshold) { in thermal_zone_trip_update() 80 trace_thermal_zone_trip(tz, trip_id, trip->type); in thermal_zone_trip_update() 83 dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", in thermal_zone_trip_update() 106 static void step_wise_manage(struct thermal_zone_device *tz) in step_wise_manage() argument 111 lockdep_assert_held(&tz->lock); in step_wise_manage() 120 for_each_trip_desc(tz, td) { in step_wise_manage() 128 thermal_zone_trip_update(tz, td, td->threshold); in step_wise_manage() [all …]
|
| H A D | thermal_thresholds.h | 11 int thermal_thresholds_init(struct thermal_zone_device *tz); 12 void thermal_thresholds_exit(struct thermal_zone_device *tz); 13 void thermal_thresholds_handle(struct thermal_zone_device *tz, int *low, int *high); 14 void thermal_thresholds_flush(struct thermal_zone_device *tz); 15 int thermal_thresholds_add(struct thermal_zone_device *tz, int temperature, int direction); 16 int thermal_thresholds_delete(struct thermal_zone_device *tz, int temperature, int direction); 17 int thermal_thresholds_for_each(struct thermal_zone_device *tz,
|
| H A D | thermal_core.h | 55 int (*bind_to_tz)(struct thermal_zone_device *tz); 56 void (*unbind_from_tz)(struct thermal_zone_device *tz); 57 void (*trip_crossed)(struct thermal_zone_device *tz, 60 void (*manage)(struct thermal_zone_device *tz); 61 void (*update_tz)(struct thermal_zone_device *tz, 262 void __thermal_zone_device_update(struct thermal_zone_device *tz, 266 void thermal_governor_update_tz(struct thermal_zone_device *tz, 279 int thermal_zone_trip_id(const struct thermal_zone_device *tz, 281 int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp); 282 void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz, [all …]
|
| /linux-6.15/drivers/acpi/ |
| H A D | thermal.c | 133 if (!tz) in acpi_thermal_get_temperature() 136 tz->last_temp_dk = tz->temp_dk; in acpi_thermal_get_temperature() 155 if (!tz) in acpi_thermal_get_polling_frequency() 301 struct acpi_thermal *tz = atd->tz; in acpi_thermal_adjust_trip() local 483 if (!tz) in thermal_get_temp() 512 t = tz->trips.passive.tc1 * (tz->temp_dk - in thermal_get_trend() 514 tz->trips.passive.tc2 * (tz->temp_dk - in thermal_get_trend() 526 t = acpi_thermal_temp(tz, tz->temp_dk); in thermal_get_trend() 676 if (!tz) in acpi_thermal_notify() 795 if (!tz) in acpi_thermal_add() [all …]
|
| /linux-6.15/tools/thermal/thermal-engine/ |
| H A D | thermal-engine.c | 37 struct thermal_zone *tz; member 77 INFO("thermal zone '%s', id=%d\n", tz->name, tz->id); in show_tz() 83 show_temp(tz, arg); in show_tz() 131 struct thermal_zone *tz = thermal_zone_find_by_id(td->tz, tz_id); in tz_disable() local 141 struct thermal_zone *tz = thermal_zone_find_by_id(td->tz, tz_id); in tz_enable() local 151 struct thermal_zone *tz = thermal_zone_find_by_id(td->tz, tz_id); in trip_high() local 162 struct thermal_zone *tz = thermal_zone_find_by_id(td->tz, tz_id); in trip_low() local 189 struct thermal_zone *tz = thermal_zone_find_by_id(td->tz, tz_id); in trip_change() local 225 struct thermal_zone *tz = thermal_zone_find_by_id(td->tz, tz_id); in gov_change() local 227 INFO("%s: governor changed %s -> %s\n", tz->name, tz->governor, name); in gov_change() [all …]
|
| /linux-6.15/tools/lib/thermal/ |
| H A D | thermal.c | 52 if (!tz) in for_each_thermal_zone() 55 for (i = 0; tz[i].id != -1; i++) in for_each_thermal_zone() 56 ret |= cb(&tz[i], arg); in for_each_thermal_zone() 66 if (!tz || !name) in thermal_zone_find_by_name() 70 if (!strcmp(tz[i].name, name)) in thermal_zone_find_by_name() 71 return &tz[i]; in thermal_zone_find_by_name() 81 if (!tz || id < 0) in thermal_zone_find_by_id() 85 if (tz[i].id == id) in thermal_zone_find_by_id() 86 return &tz[i]; in thermal_zone_find_by_id() 108 struct thermal_zone *tz; in thermal_zone_discover() local [all …]
|
| H A D | commands.c | 73 *tz = __tz; in parse_tz_get() 151 tz->trip = __tt; in parse_tz_get_trip() 163 if (tz->id != id) in parse_tz_get_temp() 179 if (tz->id != id) in parse_tz_get_gov() 183 nla_strlcpy(tz->governor, in parse_tz_get_gov() 228 tz->thresholds = __tt; in parse_threshold_get() 407 NLM_F_DUMP | NLM_F_ACK, tz); in thermal_cmd_get_tz() 418 struct cmd_param p = { .tz_id = tz->id }; in thermal_cmd_get_trip() 421 THERMAL_GENL_CMD_TZ_GET_TRIP, 0, tz); in thermal_cmd_get_trip() 426 struct cmd_param p = { .tz_id = tz->id }; in thermal_cmd_get_governor() [all …]
|
| /linux-6.15/tools/testing/selftests/timers/ |
| H A D | set-tz.c | 30 struct timezone tz; in set_tz() local 32 tz.tz_minuteswest = min; in set_tz() 33 tz.tz_dsttime = dst; in set_tz() 40 struct timezone tz; in get_tz_min() local 43 memset(&tz, 0, sizeof(tz)); in get_tz_min() 44 gettimeofday(&tv, &tz); in get_tz_min() 45 return tz.tz_minuteswest; in get_tz_min() 50 struct timezone tz; in get_tz_dst() local 53 memset(&tz, 0, sizeof(tz)); in get_tz_dst() 54 gettimeofday(&tv, &tz); in get_tz_dst() [all …]
|
| /linux-6.15/tools/thermal/thermometer/ |
| H A D | thermometer.c | 57 struct tz { struct 66 struct tz *tz; argument 105 config_setting_t *tz; in configuration_init() local 128 if (!tz) { in configuration_init() 262 struct tz *tz; in thermometer_add_tz() local 272 tz = realloc(thermometer->tz, sizeof(*thermometer->tz) * (thermometer->nr_tz + 1)); in thermometer_add_tz() 273 if (!tz) { in thermometer_add_tz() 278 thermometer->tz = tz; in thermometer_add_tz() 344 struct tz *tz = arg; in timer_temperature_callback() local 404 thermometer->tz[i].name, thermometer->tz[i].polling); in thermometer_start() [all …]
|
| /linux-6.15/include/linux/ |
| H A D | thermal.h | 211 struct thermal_zone_device *tz) in devm_thermal_of_zone_unregister() argument 216 int for_each_thermal_trip(struct thermal_zone_device *tz, 219 int thermal_zone_for_each_trip(struct thermal_zone_device *tz, 222 void thermal_zone_set_trip_temp(struct thermal_zone_device *tz, 267 int thermal_zone_get_slope(struct thermal_zone_device *tz); 268 int thermal_zone_get_offset(struct thermal_zone_device *tz); 273 int thermal_zone_device_enable(struct thermal_zone_device *tz); 274 int thermal_zone_device_disable(struct thermal_zone_device *tz); 324 struct thermal_zone_device *tz, int *temp) in thermal_zone_get_temp() argument 327 struct thermal_zone_device *tz) in thermal_zone_get_slope() argument [all …]
|
| /linux-6.15/fs/isofs/ |
| H A D | util.c | 21 int year, month, day, hour, minute, second, tz; in iso_date() local 30 if (flag == 0) tz = p[6]; /* High sierra has no time zone */ in iso_date() 31 else tz = 0; in iso_date() 39 if (tz & 0x80) in iso_date() 40 tz |= (-1 << 8); in iso_date() 67 if (-52 <= tz && tz <= 52) in iso_date() 68 crtime -= tz * 15 * 60; in iso_date()
|
| /linux-6.15/drivers/thermal/broadcom/ |
| H A D | bcm2835_thermal.c | 67 struct thermal_zone_device *tz; member 93 struct bcm2835_thermal_data *data = thermal_zone_device_priv(tz); in bcm2835_thermal_get_temp() 103 thermal_zone_get_offset(data->tz), in bcm2835_thermal_get_temp() 104 thermal_zone_get_slope(data->tz)); in bcm2835_thermal_get_temp() 168 struct thermal_zone_device *tz; in bcm2835_thermal_probe() local 200 if (IS_ERR(tz)) in bcm2835_thermal_probe() 213 slope = thermal_zone_get_slope(tz); in bcm2835_thermal_probe() 214 offset = thermal_zone_get_offset(tz); in bcm2835_thermal_probe() 219 err = thermal_zone_get_crit_temp(tz, &crit_temp); in bcm2835_thermal_probe() 245 data->tz = tz; in bcm2835_thermal_probe() [all …]
|