/linux-6.6.21/drivers/acpi/ |
D | thermal.c | 65 #define ACPI_THERMAL_TRIPS_EXCEPTION(flags, tz, str) \ argument 68 acpi_handle_info(tz->device->handle, \ 141 static int acpi_thermal_get_temperature(struct acpi_thermal *tz) in acpi_thermal_get_temperature() argument 146 if (!tz) in acpi_thermal_get_temperature() 149 tz->last_temperature = tz->temperature; in acpi_thermal_get_temperature() 151 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); in acpi_thermal_get_temperature() 155 tz->temperature = tmp; in acpi_thermal_get_temperature() 157 acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", in acpi_thermal_get_temperature() 158 tz->temperature); in acpi_thermal_get_temperature() 163 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) in acpi_thermal_get_polling_frequency() argument [all …]
|
/linux-6.6.21/drivers/thermal/ |
D | thermal_core.c | 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() 93 static int thermal_set_governor(struct thermal_zone_device *tz, in thermal_set_governor() argument 98 if (tz->governor && tz->governor->unbind_from_tz) in thermal_set_governor() 99 tz->governor->unbind_from_tz(tz); in thermal_set_governor() 102 ret = new_gov->bind_to_tz(tz); in thermal_set_governor() [all …]
|
D | thermal_trip.c | 12 int for_each_thermal_trip(struct thermal_zone_device *tz, in for_each_thermal_trip() argument 18 lockdep_assert_held(&tz->lock); in for_each_thermal_trip() 20 for (i = 0; i < tz->num_trips; i++) { in for_each_thermal_trip() 21 ret = cb(&tz->trips[i], data); in for_each_thermal_trip() 30 int thermal_zone_get_num_trips(struct thermal_zone_device *tz) in thermal_zone_get_num_trips() argument 32 return tz->num_trips; in thermal_zone_get_num_trips() 51 void __thermal_zone_set_trips(struct thermal_zone_device *tz) 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() 63 for (i = 0; i < tz->num_trips; i++) { in __thermal_zone_set_trips() [all …]
|
D | thermal_helpers.c | 25 int get_tz_trend(struct thermal_zone_device *tz, int trip_index) in get_tz_trend() argument 27 struct thermal_trip *trip = tz->trips ? &tz->trips[trip_index] : NULL; in get_tz_trend() 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 51 mutex_lock(&tz->lock); in get_thermal_instance() 54 trip = &tz->trips[trip_index]; in get_thermal_instance() 56 list_for_each_entry(pos, &tz->thermal_instances, tz_node) { in get_thermal_instance() [all …]
|
D | gov_power_allocator.c | 88 static u32 estimate_sustainable_power(struct thermal_zone_device *tz) in estimate_sustainable_power() argument 92 struct power_allocator_params *params = tz->governor_data; in estimate_sustainable_power() 94 &tz->trips[params->trip_max_desired_temperature]; in estimate_sustainable_power() 96 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in estimate_sustainable_power() 125 static void estimate_pid_constants(struct thermal_zone_device *tz, in estimate_pid_constants() argument 134 ret = __thermal_zone_get_trip(tz, trip_switch_on, &trip); 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() [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_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 if (device_is_registered(&tz->device)) in temp_crit_show() 84 ret = tz->ops->get_crit_temp(tz, &temperature); in temp_crit_show() 88 mutex_unlock(&tz->lock); in temp_crit_show() 98 thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz) in thermal_hwmon_lookup_by_type() argument 105 strcpy(type, tz->type); in thermal_hwmon_lookup_by_type() [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 | gov_fair_share.c | 22 static int get_trip_level(struct thermal_zone_device *tz) in get_trip_level() argument 27 for (count = 0; count < tz->num_trips; count++) { in get_trip_level() 28 __thermal_zone_get_trip(tz, count, &trip); in get_trip_level() 29 if (tz->temperature < trip.temperature) in get_trip_level() 38 trace_thermal_zone_trip(tz, count - 1, trip.type); in get_trip_level() 43 static long get_target_state(struct thermal_zone_device *tz, in get_target_state() argument 46 return (long)(percentage * level * cdev->max_state) / (100 * tz->num_trips); in get_target_state() 68 static int fair_share_throttle(struct thermal_zone_device *tz, int trip_index) in fair_share_throttle() argument 70 const struct thermal_trip *trip = &tz->trips[trip_index]; in fair_share_throttle() 74 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, int trip_index) in thermal_zone_trip_update() argument 18 const struct thermal_trip *trip = &tz->trips[trip_index]; in thermal_zone_trip_update() 22 dev_info_once(&tz->device, in thermal_zone_trip_update() 23 "Zero hysteresis value for thermal zone %s\n", tz->type); in thermal_zone_trip_update() 25 dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n", in thermal_zone_trip_update() 26 trip_index, trip->temperature, tz->temperature, in thermal_zone_trip_update() 29 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update() 48 if (instance->target == 0 && tz->temperature >= trip->temperature) in thermal_zone_trip_update() 51 tz->temperature <= trip->temperature - trip->hysteresis) in thermal_zone_trip_update() 92 static int bang_bang_control(struct thermal_zone_device *tz, int trip) in bang_bang_control() argument [all …]
|
D | gov_step_wise.c | 71 static void update_passive_instance(struct thermal_zone_device *tz, in update_passive_instance() argument 79 tz->passive += value; in update_passive_instance() 82 static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id) in thermal_zone_trip_update() argument 84 const struct thermal_trip *trip = &tz->trips[trip_id]; in thermal_zone_trip_update() 90 trend = get_tz_trend(tz, trip_id); in thermal_zone_trip_update() 92 if (tz->temperature >= trip->temperature) { in thermal_zone_trip_update() 94 trace_thermal_zone_trip(tz, trip_id, trip->type); in thermal_zone_trip_update() 97 dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", in thermal_zone_trip_update() 100 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update() 115 update_passive_instance(tz, trip->type, 1); in thermal_zone_trip_update() [all …]
|
D | gov_user_space.c | 18 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()
|
D | thermal_hwmon.h | 19 int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz); 20 int devm_thermal_add_hwmon_sysfs(struct device *dev, 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 device *dev, 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
|
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 …]
|
D | thermal_core.h | 73 int get_tz_trend(struct thermal_zone_device *tz, int trip_index); 76 get_thermal_instance(struct thermal_zone_device *tz, 88 struct thermal_zone_device *tz; member 115 void __thermal_zone_device_update(struct thermal_zone_device *tz, 119 void __thermal_zone_set_trips(struct thermal_zone_device *tz); 120 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 122 int thermal_zone_trip_id(struct thermal_zone_device *tz, 124 int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp); 148 int thermal_zone_device_is_enabled(struct thermal_zone_device *tz);
|
/linux-6.6.21/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.6.21/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.6.21/tools/testing/selftests/timers/ |
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() 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-6.6.21/include/linux/ |
D | thermal.h | 204 int (*bind_to_tz)(struct thermal_zone_device *tz); 205 void (*unbind_from_tz)(struct thermal_zone_device *tz); 206 int (*throttle)(struct thermal_zone_device *tz, int trip); 265 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz); 277 struct thermal_zone_device *tz) in devm_thermal_of_zone_unregister() argument 282 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 284 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 287 int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id, 290 int for_each_thermal_trip(struct thermal_zone_device *tz, 293 int thermal_zone_get_num_trips(struct thermal_zone_device *tz); [all …]
|
/linux-6.6.21/tools/thermal/thermometer/ |
D | thermometer.c | 57 struct tz { struct 66 struct tz *tz; member 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.6.21/fs/isofs/ |
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.6.21/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 …]
|
D | ns-thermal.c | 17 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.6.21/kernel/time/ |
D | time.c | 141 struct timezone __user *, tz) in SYSCALL_DEFINE2() argument 151 if (unlikely(tz != NULL)) { in SYSCALL_DEFINE2() 152 if (copy_to_user(tz, &sys_tz, sizeof(sys_tz))) in SYSCALL_DEFINE2() 169 int do_sys_settimeofday64(const struct timespec64 *tv, const struct timezone *tz) in do_sys_settimeofday64() argument 177 error = security_settime64(tv, tz); in do_sys_settimeofday64() 181 if (tz) { in do_sys_settimeofday64() 183 if (tz->tz_minuteswest > 15*60 || tz->tz_minuteswest < -15*60) in do_sys_settimeofday64() 186 sys_tz = *tz; in do_sys_settimeofday64() 200 struct timezone __user *, tz) in SYSCALL_DEFINE2() argument 215 if (tz) { in SYSCALL_DEFINE2() [all …]
|