Home
last modified time | relevance | path

Searched full:tz (Results 1 – 25 of 251) sorted by relevance

1234567891011

/linux-6.14.4/drivers/thermal/
Dthermal_core.c67 * @tz: a valid pointer to a struct thermal_zone_device
73 static void bind_previous_governor(struct thermal_zone_device *tz, in bind_previous_governor() argument
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()
78 dev_err(&tz->device, in bind_previous_governor()
80 failed_gov_name, tz->governor->name, tz->type); in bind_previous_governor()
81 tz->governor = NULL; in bind_previous_governor()
88 * @tz: a valid pointer to a struct thermal_zone_device
91 * Change the governor of thermal zone @tz.
95 static int thermal_set_governor(struct thermal_zone_device *tz, in thermal_set_governor() argument
[all …]
Dthermal_helpers.c25 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()
42 static bool thermal_instance_present(struct thermal_zone_device *tz, in thermal_instance_present() argument
57 bool thermal_trip_is_bound_to_cdev(struct thermal_zone_device *tz, in thermal_trip_is_bound_to_cdev() argument
61 guard(thermal_zone)(tz); in thermal_trip_is_bound_to_cdev()
64 return thermal_instance_present(tz, cdev, trip); in thermal_trip_is_bound_to_cdev()
70 * @tz: a valid pointer to a struct thermal_zone_device
[all …]
Dthermal_thresholds.c16 int thermal_thresholds_init(struct thermal_zone_device *tz) in thermal_thresholds_init() argument
18 INIT_LIST_HEAD(&tz->user_thresholds); in thermal_thresholds_init()
23 static void __thermal_thresholds_flush(struct thermal_zone_device *tz) in __thermal_thresholds_flush() argument
25 struct list_head *thresholds = &tz->user_thresholds; in __thermal_thresholds_flush()
34 void thermal_thresholds_flush(struct thermal_zone_device *tz) in thermal_thresholds_flush() argument
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()
42 __thermal_zone_device_update(tz, THERMAL_TZ_FLUSH_THRESHOLDS); in thermal_thresholds_flush()
45 void thermal_thresholds_exit(struct thermal_zone_device *tz) in thermal_thresholds_exit() argument
[all …]
Dthermal_netlink.h37 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,
58 int thermal_notify_threshold_delete(const struct thermal_zone_device *tz,
[all …]
Dgov_power_allocator.c107 * @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()
141 * @tz: thermal zone for which to estimate the constants
149 static void estimate_pid_constants(struct thermal_zone_device *tz, in estimate_pid_constants() argument
171 tz->tzp->k_po = int_to_frac(sustainable_power) / in estimate_pid_constants()
174 tz->tzp->k_pu = int_to_frac(2 * sustainable_power) / in estimate_pid_constants()
177 k_i = tz->tzp->k_pu / 10; in estimate_pid_constants()
178 tz->tzp->k_i = k_i > 0 ? k_i : 1; in estimate_pid_constants()
188 * @tz: thermal zone for which to estimate the constants
[all …]
Dthermal_hwmon.c40 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 guard(thermal_zone)(tz); in temp_crit_show()
83 ret = tz->ops.get_crit_temp(tz, &temperature); in temp_crit_show()
92 thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz) in thermal_hwmon_lookup_by_type() argument
99 strcpy(type, tz->type); in thermal_hwmon_lookup_by_type()
114 const struct thermal_zone_device *tz) in thermal_hwmon_lookup_temp() argument
120 if (temp->tz == tz) { in thermal_hwmon_lookup_temp()
[all …]
Dthermal_sysfs.c30 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()
[all …]
Dthermal_trip.c27 int for_each_thermal_trip(struct thermal_zone_device *tz, in for_each_thermal_trip() argument
34 for_each_trip_desc(tz, td) { in for_each_thermal_trip()
44 int thermal_zone_for_each_trip(struct thermal_zone_device *tz, in thermal_zone_for_each_trip() argument
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()
54 void thermal_zone_set_trips(struct thermal_zone_device *tz, int low, int high) in thermal_zone_set_trips() argument
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()
[all …]
Dthermal_netlink.c351 int thermal_notify_tz_create(const struct thermal_zone_device *tz) in thermal_notify_tz_create() argument
353 struct param p = { .tz_id = tz->id, .name = tz->type }; in thermal_notify_tz_create()
358 int thermal_notify_tz_delete(const struct thermal_zone_device *tz) in thermal_notify_tz_delete() argument
360 struct param p = { .tz_id = tz->id }; in thermal_notify_tz_delete()
365 int thermal_notify_tz_enable(const struct thermal_zone_device *tz) in thermal_notify_tz_enable() argument
367 struct param p = { .tz_id = tz->id }; in thermal_notify_tz_enable()
372 int thermal_notify_tz_disable(const struct thermal_zone_device *tz) in thermal_notify_tz_disable() argument
374 struct param p = { .tz_id = tz->id }; in thermal_notify_tz_disable()
379 int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz, in thermal_notify_tz_trip_down() argument
382 struct param p = { .tz_id = tz->id, in thermal_notify_tz_trip_down()
[all …]
Dthermal_debugfs.h8 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 …]
Dgov_bang_bang.c59 * @tz: thermal_zone_device
63 static void bang_bang_trip_crossed(struct thermal_zone_device *tz, in bang_bang_trip_crossed() argument
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()
[all …]
Dgov_fair_share.c18 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()
46 * @tz: thermal_zone_device
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()
[all …]
Dthermal_thresholds.h11 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,
Dgov_user_space.c18 static int user_space_bind(struct thermal_zone_device *tz) in user_space_bind() argument
27 * @tz: thermal_zone_device
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()
Dthermal_debugfs.c122 * @node: a list element to be added to the list of tz events
146 * @tz: thermal zone this object belongs to
152 struct thermal_zone_device *tz; member
556 static struct tz_episode *thermal_debugfs_tz_event_alloc(struct thermal_zone_device *tz, in thermal_debugfs_tz_event_alloc() argument
562 tze = kzalloc(struct_size(tze, trip_stats, tz->num_trips), GFP_KERNEL); in thermal_debugfs_tz_event_alloc()
571 for (i = 0; i < tz->num_trips; i++) { in thermal_debugfs_tz_event_alloc()
579 void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, in thermal_debug_tz_trip_up() argument
582 struct thermal_debugfs *thermal_dbg = tz->debugfs; in thermal_debug_tz_trip_up()
583 int trip_id = thermal_zone_trip_id(tz, trip); in thermal_debug_tz_trip_up()
630 tze = thermal_debugfs_tz_event_alloc(tz, now); in thermal_debug_tz_trip_up()
[all …]
/linux-6.14.4/drivers/acpi/
Dthermal.c59 #define ACPI_THERMAL_TRIPS_EXCEPTION(tz, str) \ argument
61 acpi_handle_info(tz->device->handle, \
128 static int acpi_thermal_get_temperature(struct acpi_thermal *tz) in acpi_thermal_get_temperature() argument
133 if (!tz) in acpi_thermal_get_temperature()
136 tz->last_temp_dk = tz->temp_dk; in acpi_thermal_get_temperature()
138 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); in acpi_thermal_get_temperature()
142 tz->temp_dk = tmp; in acpi_thermal_get_temperature()
144 acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", in acpi_thermal_get_temperature()
145 tz->temp_dk); in acpi_thermal_get_temperature()
150 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) in acpi_thermal_get_polling_frequency() argument
[all …]
/linux-6.14.4/tools/thermal/thermal-engine/
Dthermal-engine.c37 struct thermal_zone *tz; member
57 static int show_temp(struct thermal_zone *tz, __maybe_unused void *arg) in show_temp() argument
59 thermal_cmd_get_temp(arg, tz); in show_temp()
61 INFO("temperature: %d\n", tz->temp); in show_temp()
66 static int show_governor(struct thermal_zone *tz, __maybe_unused void *arg) in show_governor() argument
68 thermal_cmd_get_governor(arg, tz); in show_governor()
70 INFO("governor: '%s'\n", tz->governor); in show_governor()
75 static int show_tz(struct thermal_zone *tz, __maybe_unused void *arg) in show_tz() argument
77 INFO("thermal zone '%s', id=%d\n", tz->name, tz->id); in show_tz()
79 for_each_thermal_trip(tz->trip, show_trip, NULL); in show_tz()
[all …]
/linux-6.14.4/tools/lib/thermal/
Dthermal.c48 int for_each_thermal_zone(struct thermal_zone *tz, cb_tz_t cb, void *arg) in for_each_thermal_zone() argument
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()
61 struct thermal_zone *thermal_zone_find_by_name(struct thermal_zone *tz, in thermal_zone_find_by_name() argument
66 if (!tz || !name) in thermal_zone_find_by_name()
69 for (i = 0; tz[i].id != -1; i++) { 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()
77 struct thermal_zone *thermal_zone_find_by_id(struct thermal_zone *tz, int id) in thermal_zone_find_by_id() argument
[all …]
Dcommands.c44 static int parse_tz_get(struct genl_info *info, struct thermal_zone **tz) in parse_tz_get() argument
73 *tz = __tz; in parse_tz_get()
118 static int parse_tz_get_trip(struct genl_info *info, struct thermal_zone *tz) in parse_tz_get_trip() argument
151 tz->trip = __tt; in parse_tz_get_trip()
156 static int parse_tz_get_temp(struct genl_info *info, struct thermal_zone *tz) in parse_tz_get_temp() argument
163 if (tz->id != id) in parse_tz_get_temp()
167 tz->temp = nla_get_u32(info->attrs[THERMAL_GENL_ATTR_TZ_TEMP]); in parse_tz_get_temp()
172 static int parse_tz_get_gov(struct genl_info *info, struct thermal_zone *tz) in parse_tz_get_gov() argument
179 if (tz->id != id) in parse_tz_get_gov()
183 nla_strlcpy(tz->governor, in parse_tz_get_gov()
[all …]
/linux-6.14.4/tools/thermal/thermometer/
Dthermometer.c57 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()
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()
[all …]
/linux-6.14.4/tools/testing/selftests/timers/
Dset-tz.c1 /* 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.14.4/include/linux/
Dthermal.h199 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz);
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,
225 int thermal_zone_get_crit_temp(struct thermal_zone_device *tz, int *temp);
243 void thermal_zone_device_unregister(struct thermal_zone_device *tz);
266 int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
267 int thermal_zone_get_slope(struct thermal_zone_device *tz);
268 int thermal_zone_get_offset(struct thermal_zone_device *tz);
[all …]
/linux-6.14.4/drivers/thermal/broadcom/
Dbcm2835_thermal.c67 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()
168 struct thermal_zone_device *tz; in bcm2835_thermal_probe() local
199 tz = devm_thermal_of_zone_register(dev, 0, data, &bcm2835_thermal_ops); in bcm2835_thermal_probe()
200 if (IS_ERR(tz)) in bcm2835_thermal_probe()
201 return dev_err_probe(dev, PTR_ERR(tz), "Failed to register the thermal device\n"); in bcm2835_thermal_probe()
213 slope = thermal_zone_get_slope(tz); in bcm2835_thermal_probe()
[all …]
Dns-thermal.c17 static int ns_thermal_get_temp(struct thermal_zone_device *tz, int *temp) in ns_thermal_get_temp() argument
19 void __iomem *pvtmon = thermal_zone_device_priv(tz); in ns_thermal_get_temp()
20 int offset = thermal_zone_get_offset(tz); in ns_thermal_get_temp()
21 int slope = thermal_zone_get_slope(tz); in ns_thermal_get_temp()
48 struct thermal_zone_device *tz; in ns_thermal_probe() local
55 tz = devm_thermal_of_zone_register(dev, 0, in ns_thermal_probe()
58 if (IS_ERR(tz)) { in ns_thermal_probe()
60 return PTR_ERR(tz); in ns_thermal_probe()
/linux-6.14.4/drivers/thermal/testing/
Dzone.c31 * @tz: Test thermal zone based on this template, if present.
44 struct thermal_zone_device *tz; member
116 if (!tt_zone->tz) in tt_zone_tz_temp_get()
129 if (!tt_zone->tz) in tt_zone_tz_temp_set()
133 thermal_zone_device_update(tt_zone->tz, THERMAL_EVENT_TEMP_SAMPLE); in tt_zone_tz_temp_set()
167 snprintf(f_name, TT_MAX_FILE_NAME_LENGTH, "tz%d", tt_zone->id); in tt_add_tz_work_fn()
232 if (tt_zone->tz) { in tt_zone_unregister_tz()
233 thermal_zone_device_unregister(tt_zone->tz); in tt_zone_unregister_tz()
234 tt_zone->tz = NULL; in tt_zone_unregister_tz()
372 static int tt_zone_get_temp(struct thermal_zone_device *tz, int *temp) in tt_zone_get_temp() argument
[all …]

1234567891011