Home
last modified time | relevance | path

Searched refs:tz (Results 1 – 25 of 188) sorted by relevance

12345678

/Linux-v6.1/drivers/acpi/
Dthermal.c182 static int acpi_thermal_get_temperature(struct acpi_thermal *tz) in acpi_thermal_get_temperature() argument
187 if (!tz) in acpi_thermal_get_temperature()
190 tz->last_temperature = tz->temperature; in acpi_thermal_get_temperature()
192 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); in acpi_thermal_get_temperature()
196 tz->temperature = tmp; in acpi_thermal_get_temperature()
198 acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", in acpi_thermal_get_temperature()
199 tz->temperature); in acpi_thermal_get_temperature()
204 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) in acpi_thermal_get_polling_frequency() argument
209 if (!tz) in acpi_thermal_get_polling_frequency()
212 status = acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, &tmp); in acpi_thermal_get_polling_frequency()
[all …]
/Linux-v6.1/drivers/thermal/
Dthermal_helpers.c26 int get_tz_trend(struct thermal_zone_device *tz, int trip) in get_tz_trend() argument
30 if (tz->emul_temperature || !tz->ops->get_trend || in get_tz_trend()
31 tz->ops->get_trend(tz, trip, &trend)) { in get_tz_trend()
32 if (tz->temperature > tz->last_temperature) in get_tz_trend()
34 else if (tz->temperature < tz->last_temperature) in get_tz_trend()
44 get_thermal_instance(struct thermal_zone_device *tz, in get_thermal_instance() argument
50 mutex_lock(&tz->lock); in get_thermal_instance()
53 list_for_each_entry(pos, &tz->thermal_instances, tz_node) { in get_thermal_instance()
54 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { in get_thermal_instance()
61 mutex_unlock(&tz->lock); in get_thermal_instance()
[all …]
Dthermal_core.c73 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()
95 static int thermal_set_governor(struct thermal_zone_device *tz, in thermal_set_governor() argument
100 if (tz->governor && tz->governor->unbind_from_tz) in thermal_set_governor()
101 tz->governor->unbind_from_tz(tz); in thermal_set_governor()
104 ret = new_gov->bind_to_tz(tz); in thermal_set_governor()
[all …]
Dthermal_sysfs.c29 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 …]
Dgov_power_allocator.c89 static u32 estimate_sustainable_power(struct thermal_zone_device *tz) in estimate_sustainable_power() argument
93 struct power_allocator_params *params = tz->governor_data; in estimate_sustainable_power()
95 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in estimate_sustainable_power()
124 static void estimate_pid_constants(struct thermal_zone_device *tz, in estimate_pid_constants() argument
133 ret = tz->ops->get_trip_temp(tz, trip_switch_on, &switch_on_temp); in estimate_pid_constants()
149 tz->tzp->k_po = int_to_frac(sustainable_power) / in estimate_pid_constants()
152 tz->tzp->k_pu = int_to_frac(2 * sustainable_power) / in estimate_pid_constants()
155 k_i = tz->tzp->k_pu / 10; in estimate_pid_constants()
156 tz->tzp->k_i = k_i > 0 ? k_i : 1; in estimate_pid_constants()
175 static u32 get_sustainable_power(struct thermal_zone_device *tz, in get_sustainable_power() argument
[all …]
Dthermal_of.c32 int of_thermal_get_ntrips(struct thermal_zone_device *tz) in of_thermal_get_ntrips() argument
34 return tz->num_trips; in of_thermal_get_ntrips()
48 bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip) in of_thermal_is_trip_valid() argument
50 if (trip >= tz->num_trips || trip < 0) in of_thermal_is_trip_valid()
68 of_thermal_get_trip_points(struct thermal_zone_device *tz) in of_thermal_get_trip_points() argument
70 return tz->trips; in of_thermal_get_trip_points()
74 static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_type() argument
77 if (trip >= tz->num_trips || trip < 0) in of_thermal_get_trip_type()
80 *type = tz->trips[trip].type; in of_thermal_get_trip_type()
85 static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip, in of_thermal_get_trip_temp() argument
[all …]
Dgov_fair_share.c22 static int get_trip_level(struct thermal_zone_device *tz) in get_trip_level() argument
28 if (tz->num_trips == 0 || !tz->ops->get_trip_temp) in get_trip_level()
31 for (count = 0; count < tz->num_trips; count++) { in get_trip_level()
32 tz->ops->get_trip_temp(tz, count, &trip_temp); in get_trip_level()
33 if (tz->temperature < trip_temp) in get_trip_level()
42 tz->ops->get_trip_type(tz, count - 1, &trip_type); in get_trip_level()
43 trace_thermal_zone_trip(tz, count - 1, trip_type); in get_trip_level()
49 static long get_target_state(struct thermal_zone_device *tz, in get_target_state() argument
56 return (long)(percentage * level * max_state) / (100 * tz->num_trips); in get_target_state()
78 static int fair_share_throttle(struct thermal_zone_device *tz, int trip) in fair_share_throttle() argument
[all …]
Dthermal_hwmon.c39 struct thermal_zone_device *tz; member
58 struct thermal_zone_device *tz = temp->tz; in temp_input_show() local
60 ret = thermal_zone_get_temp(tz, &temperature); in temp_input_show()
76 struct thermal_zone_device *tz = temp->tz; in temp_crit_show() local
80 ret = tz->ops->get_crit_temp(tz, &temperature); in temp_crit_show()
89 thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz) in thermal_hwmon_lookup_by_type() argument
96 strcpy(type, tz->type); in thermal_hwmon_lookup_by_type()
111 const struct thermal_zone_device *tz) in thermal_hwmon_lookup_temp() argument
117 if (temp->tz == tz) { in thermal_hwmon_lookup_temp()
126 static bool thermal_zone_crit_temp_valid(struct thermal_zone_device *tz) in thermal_zone_crit_temp_valid() argument
[all …]
Dgov_bang_bang.c16 static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) in thermal_zone_trip_update() argument
21 tz->ops->get_trip_temp(tz, trip, &trip_temp); in thermal_zone_trip_update()
23 if (!tz->ops->get_trip_hyst) { in thermal_zone_trip_update()
25 "running with default hysteresis zero\n", tz->type); in thermal_zone_trip_update()
28 tz->ops->get_trip_hyst(tz, trip, &trip_hyst); in thermal_zone_trip_update()
30 dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n", in thermal_zone_trip_update()
31 trip, trip_temp, tz->temperature, in thermal_zone_trip_update()
34 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update()
53 if (instance->target == 0 && tz->temperature >= trip_temp) in thermal_zone_trip_update()
56 tz->temperature <= trip_temp - trip_hyst) in thermal_zone_trip_update()
[all …]
Dgov_step_wise.c87 static void update_passive_instance(struct thermal_zone_device *tz, in update_passive_instance() argument
95 tz->passive += value; in update_passive_instance()
98 static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) in thermal_zone_trip_update() argument
107 tz->ops->get_trip_temp(tz, trip, &trip_temp); in thermal_zone_trip_update()
108 tz->ops->get_trip_type(tz, trip, &trip_type); in thermal_zone_trip_update()
110 trend = get_tz_trend(tz, trip); in thermal_zone_trip_update()
112 if (tz->temperature >= trip_temp) { in thermal_zone_trip_update()
114 trace_thermal_zone_trip(tz, trip, trip_type); in thermal_zone_trip_update()
117 dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", in thermal_zone_trip_update()
120 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update()
[all …]
Dgov_user_space.c18 static int user_space_bind(struct thermal_zone_device *tz) in user_space_bind() argument
32 static int notify_user_space(struct thermal_zone_device *tz, int trip) in notify_user_space() argument
37 lockdep_assert_held(&tz->lock); in notify_user_space()
39 thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); in notify_user_space()
40 thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); in notify_user_space()
42 thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", tz->notify_event); in notify_user_space()
44 kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); in notify_user_space()
Dthermal_core.h71 int get_tz_trend(struct thermal_zone_device *tz, int trip);
74 get_thermal_instance(struct thermal_zone_device *tz,
86 struct thermal_zone_device *tz; member
114 void thermal_zone_set_trips(struct thermal_zone_device *tz);
115 void __thermal_zone_set_trips(struct thermal_zone_device *tz);
116 int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
145 static inline int of_thermal_get_ntrips(struct thermal_zone_device *tz) in of_thermal_get_ntrips() argument
149 static inline bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, in of_thermal_is_trip_valid() argument
155 of_thermal_get_trip_points(struct thermal_zone_device *tz) in of_thermal_get_trip_points() argument
161 int thermal_zone_device_is_enabled(struct thermal_zone_device *tz);
Dthermal_hwmon.h19 int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz);
20 int devm_thermal_add_hwmon_sysfs(struct thermal_zone_device *tz);
21 void thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz);
24 thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) in thermal_add_hwmon_sysfs() argument
30 devm_thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) in devm_thermal_add_hwmon_sysfs() argument
36 thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) in thermal_remove_hwmon_sysfs() argument
Dimx_thermal.c200 struct thermal_zone_device *tz; member
251 static int imx_get_temp(struct thermal_zone_device *tz, int *temp) in imx_get_temp() argument
253 struct imx_thermal_data *data = tz->devdata; in imx_get_temp()
267 dev_dbg(&tz->device, "temp measurement never finished\n"); in imx_get_temp()
288 dev_dbg(&tz->device, "thermal alarm off: T < %d\n", in imx_get_temp()
294 dev_dbg(&tz->device, "millicelsius: %d\n", *temp); in imx_get_temp()
309 static int imx_change_mode(struct thermal_zone_device *tz, in imx_change_mode() argument
312 struct imx_thermal_data *data = tz->devdata; in imx_change_mode()
333 static int imx_get_trip_type(struct thermal_zone_device *tz, int trip, in imx_get_trip_type() argument
341 static int imx_get_crit_temp(struct thermal_zone_device *tz, int *temp) in imx_get_crit_temp() argument
[all …]
/Linux-v6.1/tools/thermal/thermal-engine/
Dthermal-engine.c37 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-v6.1/tools/lib/thermal/
Dthermal.c34 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 …]
Dcommands.c38 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-v6.1/tools/testing/selftests/timers/
Dset-tz.c30 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
53 memset(&tz, 0, sizeof(tz)); in get_tz_dst()
[all …]
/Linux-v6.1/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()
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-v6.1/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 = tz->devdata; 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
209 tz = devm_thermal_of_zone_register(&pdev->dev, 0, data, in bcm2835_thermal_probe()
211 if (IS_ERR(tz)) { in bcm2835_thermal_probe()
212 err = PTR_ERR(tz); in bcm2835_thermal_probe()
229 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 = tz->devdata; 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-v6.1/include/linux/
Dthermal.h203 int (*bind_to_tz)(struct thermal_zone_device *tz);
204 void (*unbind_from_tz)(struct thermal_zone_device *tz);
205 int (*throttle)(struct thermal_zone_device *tz, int trip);
240 int (*match) (struct thermal_zone_device *tz,
305 void thermal_of_zone_unregister(struct thermal_zone_device *tz);
307 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz);
309 void thermal_of_zone_unregister(struct thermal_zone_device *tz);
326 static inline void thermal_of_zone_unregister(struct thermal_zone_device *tz) in thermal_of_zone_unregister() argument
331 struct thermal_zone_device *tz) in devm_thermal_of_zone_unregister() argument
369 int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
[all …]
/Linux-v6.1/fs/isofs/
Dutil.c21 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-v6.1/include/trace/events/
Dthermal.h26 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-v6.1/drivers/net/ethernet/mellanox/mlxsw/
Dcore_thermal.c137 mlxsw_thermal_module_trips_reset(struct mlxsw_thermal_module *tz) in mlxsw_thermal_module_trips_reset() argument
139 tz->trips[MLXSW_THERMAL_TEMP_TRIP_NORM].temp = 0; in mlxsw_thermal_module_trips_reset()
140 tz->trips[MLXSW_THERMAL_TEMP_TRIP_HIGH].temp = 0; in mlxsw_thermal_module_trips_reset()
141 tz->trips[MLXSW_THERMAL_TEMP_TRIP_HOT].temp = 0; in mlxsw_thermal_module_trips_reset()
146 struct mlxsw_thermal_module *tz, in mlxsw_thermal_module_trips_update() argument
155 err = mlxsw_env_module_temp_thresholds_get(core, tz->slot_index, in mlxsw_thermal_module_trips_update()
156 tz->module, in mlxsw_thermal_module_trips_update()
162 err = mlxsw_env_module_temp_thresholds_get(core, tz->slot_index, in mlxsw_thermal_module_trips_update()
163 tz->module, in mlxsw_thermal_module_trips_update()
172 tz->tzdev->type, crit_temp, emerg_temp); in mlxsw_thermal_module_trips_update()
[all …]

12345678