/linux-6.8/drivers/thermal/ |
D | thermal_core.c | 65 * @tz: a valid pointer to a struct thermal_zone_device 71 static void bind_previous_governor(struct thermal_zone_device *tz, in bind_previous_governor() argument 74 if (tz->governor && tz->governor->bind_to_tz) { in bind_previous_governor() 75 if (tz->governor->bind_to_tz(tz)) { in bind_previous_governor() 76 dev_err(&tz->device, in bind_previous_governor() 78 failed_gov_name, tz->governor->name, tz->type); in bind_previous_governor() 79 tz->governor = NULL; in bind_previous_governor() 86 * @tz: a valid pointer to a struct thermal_zone_device 89 * Change the governor of thermal zone @tz. 93 static int thermal_set_governor(struct thermal_zone_device *tz, in thermal_set_governor() argument [all …]
|
D | thermal_trip.c | 12 int for_each_thermal_trip(struct thermal_zone_device *tz, in for_each_thermal_trip() argument 19 for_each_trip(tz, trip) { in for_each_thermal_trip() 29 int thermal_zone_for_each_trip(struct thermal_zone_device *tz, in thermal_zone_for_each_trip() argument 35 mutex_lock(&tz->lock); in thermal_zone_for_each_trip() 36 ret = for_each_thermal_trip(tz, cb, data); in thermal_zone_for_each_trip() 37 mutex_unlock(&tz->lock); in thermal_zone_for_each_trip() 43 int thermal_zone_get_num_trips(struct thermal_zone_device *tz) in thermal_zone_get_num_trips() argument 45 return tz->num_trips; in thermal_zone_get_num_trips() 51 * @tz: a pointer to a thermal zone device structure 59 * This function must be called with tz->lock held. Both tz and tz->ops [all …]
|
D | thermal_sysfs.c | 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 54 mutex_lock(&tz->lock); in mode_show() 55 enabled = thermal_zone_device_is_enabled(tz); in mode_show() 56 mutex_unlock(&tz->lock); in mode_show() 65 struct thermal_zone_device *tz = to_thermal_zone(dev); in mode_store() local 69 result = thermal_zone_device_enable(tz); in mode_store() [all …]
|
D | thermal_helpers.c | 25 int get_tz_trend(struct thermal_zone_device *tz, const struct thermal_trip *trip) in get_tz_trend() argument 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() 43 get_thermal_instance(struct thermal_zone_device *tz, in get_thermal_instance() argument 50 mutex_lock(&tz->lock); in get_thermal_instance() 53 trip = &tz->trips[trip_index]; in get_thermal_instance() 55 list_for_each_entry(pos, &tz->thermal_instances, tz_node) { in get_thermal_instance() 56 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { in get_thermal_instance() [all …]
|
D | gov_power_allocator.c | 107 * @tz: thermal zone we are operating in 116 static u32 estimate_sustainable_power(struct thermal_zone_device *tz) in estimate_sustainable_power() argument 118 struct power_allocator_params *params = tz->governor_data; in estimate_sustainable_power() 124 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in estimate_sustainable_power() 140 * @tz: thermal zone for which to estimate the constants 148 static void estimate_pid_constants(struct thermal_zone_device *tz, in estimate_pid_constants() argument 170 tz->tzp->k_po = int_to_frac(sustainable_power) / in estimate_pid_constants() 173 tz->tzp->k_pu = int_to_frac(2 * sustainable_power) / in estimate_pid_constants() 176 k_i = tz->tzp->k_pu / 10; in estimate_pid_constants() 177 tz->tzp->k_i = k_i > 0 ? k_i : 1; in estimate_pid_constants() [all …]
|
D | thermal_hwmon.c | 40 struct thermal_zone_device *tz; member 59 struct thermal_zone_device *tz = temp->tz; in temp_input_show() local 61 ret = thermal_zone_get_temp(tz, &temperature); in temp_input_show() 77 struct thermal_zone_device *tz = temp->tz; in temp_crit_show() local 81 mutex_lock(&tz->lock); in temp_crit_show() 83 ret = tz->ops->get_crit_temp(tz, &temperature); in temp_crit_show() 85 mutex_unlock(&tz->lock); in temp_crit_show() 95 thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz) in thermal_hwmon_lookup_by_type() argument 102 strcpy(type, tz->type); in thermal_hwmon_lookup_by_type() 117 const struct thermal_zone_device *tz) in thermal_hwmon_lookup_temp() argument [all …]
|
D | thermal_netlink.h | 21 int thermal_notify_tz_create(const struct thermal_zone_device *tz); 22 int thermal_notify_tz_delete(const struct thermal_zone_device *tz); 23 int thermal_notify_tz_enable(const struct thermal_zone_device *tz); 24 int thermal_notify_tz_disable(const struct thermal_zone_device *tz); 25 int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz, 27 int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz, 29 int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz, 35 int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz, 46 static inline int thermal_notify_tz_create(const struct thermal_zone_device *tz) in thermal_notify_tz_create() argument 51 static inline int thermal_notify_tz_delete(const struct thermal_zone_device *tz) in thermal_notify_tz_delete() argument [all …]
|
D | thermal_of.c | 172 struct device_node *np, *tz; in of_thermal_zone_find() local 185 for_each_available_child_of_node(np, tz) { in of_thermal_zone_find() 189 count = of_count_phandle_with_args(tz, "thermal-sensors", in of_thermal_zone_find() 192 pr_err("%pOFn: missing thermal sensor\n", tz); in of_thermal_zone_find() 193 tz = ERR_PTR(-EINVAL); in of_thermal_zone_find() 201 ret = of_parse_phandle_with_args(tz, "thermal-sensors", in of_thermal_zone_find() 205 pr_err("%pOFn: Failed to read thermal-sensors cells: %d\n", tz, ret); in of_thermal_zone_find() 206 tz = ERR_PTR(ret); in of_thermal_zone_find() 212 pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, tz); in of_thermal_zone_find() 217 tz = ERR_PTR(-ENODEV); in of_thermal_zone_find() [all …]
|
D | thermal_netlink.c | 307 int thermal_notify_tz_create(const struct thermal_zone_device *tz) in thermal_notify_tz_create() argument 309 struct param p = { .tz_id = tz->id, .name = tz->type }; in thermal_notify_tz_create() 314 int thermal_notify_tz_delete(const struct thermal_zone_device *tz) in thermal_notify_tz_delete() argument 316 struct param p = { .tz_id = tz->id }; in thermal_notify_tz_delete() 321 int thermal_notify_tz_enable(const struct thermal_zone_device *tz) in thermal_notify_tz_enable() argument 323 struct param p = { .tz_id = tz->id }; in thermal_notify_tz_enable() 328 int thermal_notify_tz_disable(const struct thermal_zone_device *tz) in thermal_notify_tz_disable() argument 330 struct param p = { .tz_id = tz->id }; in thermal_notify_tz_disable() 335 int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz, in thermal_notify_tz_trip_down() argument 338 struct param p = { .tz_id = tz->id, in thermal_notify_tz_trip_down() [all …]
|
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_trip_up(struct thermal_zone_device *tz, 12 void thermal_debug_tz_trip_down(struct thermal_zone_device *tz, 14 void thermal_debug_update_temp(struct thermal_zone_device *tz); 21 static inline void thermal_debug_tz_add(struct thermal_zone_device *tz) {} in thermal_debug_tz_add() argument 22 static inline void thermal_debug_tz_remove(struct thermal_zone_device *tz) {} in thermal_debug_tz_remove() argument 23 static inline void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, in thermal_debug_tz_trip_up() argument 25 static inline void thermal_debug_tz_trip_down(struct thermal_zone_device *tz, in thermal_debug_tz_trip_down() argument 27 static inline void thermal_debug_update_temp(struct thermal_zone_device *tz) {} in thermal_debug_update_temp() argument
|
D | gov_fair_share.c | 18 static int get_trip_level(struct thermal_zone_device *tz) in get_trip_level() argument 23 for_each_trip(tz, trip) { in get_trip_level() 24 if (trip->temperature >= tz->temperature) in get_trip_level() 34 trip_level = thermal_zone_trip_id(tz, level_trip); in get_trip_level() 36 trace_thermal_zone_trip(tz, trip_level, level_trip->type); in get_trip_level() 41 static long get_target_state(struct thermal_zone_device *tz, in get_target_state() argument 44 return (long)(percentage * level * cdev->max_state) / (100 * tz->num_trips); in get_target_state() 49 * @tz: thermal_zone_device 66 static int fair_share_throttle(struct thermal_zone_device *tz, in fair_share_throttle() argument 72 int cur_trip_level = get_trip_level(tz); in fair_share_throttle() [all …]
|
D | gov_bang_bang.c | 16 static int thermal_zone_trip_update(struct thermal_zone_device *tz, in thermal_zone_trip_update() argument 19 int trip_index = thermal_zone_trip_id(tz, trip); in thermal_zone_trip_update() 23 dev_info_once(&tz->device, in thermal_zone_trip_update() 24 "Zero hysteresis value for thermal zone %s\n", tz->type); in thermal_zone_trip_update() 26 dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n", in thermal_zone_trip_update() 27 trip_index, trip->temperature, tz->temperature, in thermal_zone_trip_update() 30 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update() 49 if (instance->target == 0 && tz->temperature >= trip->temperature) in thermal_zone_trip_update() 52 tz->temperature <= trip->temperature - trip->hysteresis) in thermal_zone_trip_update() 68 * @tz: thermal_zone_device [all …]
|
D | gov_step_wise.c | 71 static void thermal_zone_trip_update(struct thermal_zone_device *tz, in thermal_zone_trip_update() argument 74 int trip_id = thermal_zone_trip_id(tz, trip); in thermal_zone_trip_update() 80 trend = get_tz_trend(tz, trip); in thermal_zone_trip_update() 82 if (tz->temperature >= trip->temperature) { in thermal_zone_trip_update() 84 trace_thermal_zone_trip(tz, trip_id, trip->type); in thermal_zone_trip_update() 87 dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", in thermal_zone_trip_update() 90 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update() 106 tz->passive++; in thermal_zone_trip_update() 111 tz->passive--; in thermal_zone_trip_update() 123 * @tz: thermal_zone_device [all …]
|
D | thermal_core.h | 74 int get_tz_trend(struct thermal_zone_device *tz, const struct thermal_trip *trip); 77 get_thermal_instance(struct thermal_zone_device *tz, 89 struct thermal_zone_device *tz; member 100 struct list_head tz_node; /* node in tz->thermal_instances */ 116 void __thermal_zone_device_update(struct thermal_zone_device *tz, 118 void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz); 119 void thermal_governor_update_tz(struct thermal_zone_device *tz, 126 void __thermal_zone_set_trips(struct thermal_zone_device *tz); 127 int thermal_zone_trip_id(const struct thermal_zone_device *tz, 129 void thermal_zone_trip_updated(struct thermal_zone_device *tz, [all …]
|
D | gov_user_space.c | 18 static int user_space_bind(struct thermal_zone_device *tz) in user_space_bind() argument 27 * @tz: thermal_zone_device 32 static int notify_user_space(struct thermal_zone_device *tz, in notify_user_space() argument 38 lockdep_assert_held(&tz->lock); in notify_user_space() 40 thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); in notify_user_space() 41 thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); in notify_user_space() 43 thermal_zone_trip_id(tz, trip)); in notify_user_space() 44 thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", tz->notify_event); in notify_user_space() 46 kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); in notify_user_space()
|
D | thermal_debugfs.c | 120 * @node: a list element to be added to the list of tz events 521 static struct tz_episode *thermal_debugfs_tz_event_alloc(struct thermal_zone_device *tz, in thermal_debugfs_tz_event_alloc() argument 527 tze = kzalloc(struct_size(tze, trip_stats, tz->num_trips), GFP_KERNEL); in thermal_debugfs_tz_event_alloc() 534 for (i = 0; i < tz->num_trips; i++) { in thermal_debugfs_tz_event_alloc() 542 void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, in thermal_debug_tz_trip_up() argument 547 struct thermal_debugfs *thermal_dbg = tz->debugfs; in thermal_debug_tz_trip_up() 548 int temperature = tz->temperature; in thermal_debug_tz_trip_up() 549 int trip_id = thermal_zone_trip_id(tz, trip); in thermal_debug_tz_trip_up() 593 tze = thermal_debugfs_tz_event_alloc(tz, now); in thermal_debug_tz_trip_up() 627 void thermal_debug_tz_trip_down(struct thermal_zone_device *tz, in thermal_debug_tz_trip_down() argument [all …]
|
D | thermal_trace.h | 26 TP_PROTO(struct thermal_zone_device *tz), 28 TP_ARGS(tz), 31 __string(thermal_zone, tz->type) 38 __assign_str(thermal_zone, tz->type); 39 __entry->id = tz->id; 40 __entry->temp_prev = tz->last_temperature; 41 __entry->temp = tz->temperature; 70 TP_PROTO(struct thermal_zone_device *tz, int trip, 73 TP_ARGS(tz, trip, trip_type), 76 __string(thermal_zone, tz->type) [all …]
|
/linux-6.8/drivers/acpi/ |
D | thermal.c | 57 #define ACPI_THERMAL_TRIPS_EXCEPTION(tz, str) \ argument 59 acpi_handle_info(tz->device->handle, \ 127 static int acpi_thermal_get_temperature(struct acpi_thermal *tz) in acpi_thermal_get_temperature() argument 132 if (!tz) in acpi_thermal_get_temperature() 135 tz->last_temp_dk = tz->temp_dk; in acpi_thermal_get_temperature() 137 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); in acpi_thermal_get_temperature() 141 tz->temp_dk = tmp; in acpi_thermal_get_temperature() 143 acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", in acpi_thermal_get_temperature() 144 tz->temp_dk); in acpi_thermal_get_temperature() 149 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) in acpi_thermal_get_polling_frequency() argument [all …]
|
/linux-6.8/tools/lib/thermal/ |
D | thermal.c | 34 int for_each_thermal_zone(struct thermal_zone *tz, cb_tz_t cb, void *arg) in for_each_thermal_zone() argument 38 if (!tz) in for_each_thermal_zone() 41 for (i = 0; tz[i].id != -1; i++) in for_each_thermal_zone() 42 ret |= cb(&tz[i], arg); in for_each_thermal_zone() 47 struct thermal_zone *thermal_zone_find_by_name(struct thermal_zone *tz, in thermal_zone_find_by_name() argument 52 if (!tz || !name) in thermal_zone_find_by_name() 55 for (i = 0; tz[i].id != -1; i++) { in thermal_zone_find_by_name() 56 if (!strcmp(tz[i].name, name)) in thermal_zone_find_by_name() 57 return &tz[i]; in thermal_zone_find_by_name() 63 struct thermal_zone *thermal_zone_find_by_id(struct thermal_zone *tz, int id) in thermal_zone_find_by_id() argument [all …]
|
D | commands.c | 38 static int parse_tz_get(struct genl_info *info, struct thermal_zone **tz) in parse_tz_get() argument 67 *tz = __tz; in parse_tz_get() 112 static int parse_tz_get_trip(struct genl_info *info, struct thermal_zone *tz) in parse_tz_get_trip() argument 145 tz->trip = __tt; in parse_tz_get_trip() 150 static int parse_tz_get_temp(struct genl_info *info, struct thermal_zone *tz) in parse_tz_get_temp() argument 157 if (tz->id != id) in parse_tz_get_temp() 161 tz->temp = nla_get_u32(info->attrs[THERMAL_GENL_ATTR_TZ_TEMP]); in parse_tz_get_temp() 166 static int parse_tz_get_gov(struct genl_info *info, struct thermal_zone *tz) in parse_tz_get_gov() argument 173 if (tz->id != id) in parse_tz_get_gov() 177 nla_strlcpy(tz->governor, in parse_tz_get_gov() [all …]
|
/linux-6.8/tools/thermal/thermal-engine/ |
D | thermal-engine.c | 37 struct thermal_zone *tz; member 49 static int show_temp(struct thermal_zone *tz, __maybe_unused void *arg) in show_temp() argument 51 thermal_cmd_get_temp(arg, tz); in show_temp() 53 INFO("temperature: %d\n", tz->temp); in show_temp() 58 static int show_governor(struct thermal_zone *tz, __maybe_unused void *arg) in show_governor() argument 60 thermal_cmd_get_governor(arg, tz); in show_governor() 62 INFO("governor: '%s'\n", tz->governor); in show_governor() 67 static int show_tz(struct thermal_zone *tz, __maybe_unused void *arg) in show_tz() argument 69 INFO("thermal zone '%s', id=%d\n", tz->name, tz->id); in show_tz() 71 for_each_thermal_trip(tz->trip, show_trip, NULL); in show_tz() [all …]
|
/linux-6.8/tools/testing/selftests/timers/ |
D | set-tz.c | 1 /* Set tz value 30 struct timezone tz; in set_tz() local 32 tz.tz_minuteswest = min; in set_tz() 33 tz.tz_dsttime = dst; in set_tz() 35 return settimeofday(0, &tz); 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 [all …]
|
/linux-6.8/tools/thermal/thermometer/ |
D | thermometer.c | 57 struct tz { struct 66 struct tz *tz; argument 105 config_setting_t *tz; in configuration_init() local 127 tz = config_lookup(&cfg, "thermal-zones"); in configuration_init() 128 if (!tz) { in configuration_init() 133 length = config_setting_length(tz); in configuration_init() 143 node = config_setting_get_elem(tz, i); in configuration_init() 271 thermometer->tz = realloc(thermometer->tz, in thermometer_add_tz() 272 sizeof(*thermometer->tz) * (thermometer->nr_tz + 1)); in thermometer_add_tz() 273 if (!thermometer->tz) { in thermometer_add_tz() [all …]
|
/linux-6.8/include/linux/ |
D | thermal.h | 218 int (*bind_to_tz)(struct thermal_zone_device *tz); 219 void (*unbind_from_tz)(struct thermal_zone_device *tz); 220 int (*throttle)(struct thermal_zone_device *tz, 222 void (*update_tz)(struct thermal_zone_device *tz, 282 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz); 294 struct thermal_zone_device *tz) in devm_thermal_of_zone_unregister() argument 299 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 301 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 303 int for_each_thermal_trip(struct thermal_zone_device *tz, 306 int thermal_zone_for_each_trip(struct thermal_zone_device *tz, [all …]
|
/linux-6.8/drivers/thermal/broadcom/ |
D | bcm2835_thermal.c | 67 struct thermal_zone_device *tz; member 91 static int bcm2835_thermal_get_temp(struct thermal_zone_device *tz, int *temp) in bcm2835_thermal_get_temp() argument 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() 167 struct thermal_zone_device *tz; in bcm2835_thermal_probe() local 207 tz = devm_thermal_of_zone_register(&pdev->dev, 0, data, in bcm2835_thermal_probe() 209 if (IS_ERR(tz)) { in bcm2835_thermal_probe() 210 err = PTR_ERR(tz); in bcm2835_thermal_probe() 228 slope = thermal_zone_get_slope(tz); in bcm2835_thermal_probe() [all …]
|