| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 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() 38 * @tz: a pointer to a thermal zone device structure 46 * This function must be called with tz->lock held. Both tz and tz->ops 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() [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 | 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 | gov_power_allocator.c | 79 * @tz: thermal zone we are operating in 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() 117 * @tz: thermal zone for which to estimate the constants 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() [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 | 20 * @tz: thermal zone device 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() 51 * @tz: thermal_zone_device 68 static int fair_share_throttle(struct thermal_zone_device *tz, int trip_index) in fair_share_throttle() argument [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() 67 * @tz: thermal_zone_device [all …]
|
| /kernel/linux/linux-5.10/drivers/acpi/ |
| D | thermal.c | 185 static int acpi_thermal_get_temperature(struct acpi_thermal *tz) in acpi_thermal_get_temperature() argument 190 if (!tz) in acpi_thermal_get_temperature() 193 tz->last_temperature = tz->temperature; in acpi_thermal_get_temperature() 195 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); in acpi_thermal_get_temperature() 199 tz->temperature = tmp; in acpi_thermal_get_temperature() 201 tz->temperature)); in acpi_thermal_get_temperature() 206 static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) in acpi_thermal_get_polling_frequency() argument 211 if (!tz) in acpi_thermal_get_polling_frequency() 214 status = acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, &tmp); in acpi_thermal_get_polling_frequency() 218 tz->polling_frequency = tmp; in acpi_thermal_get_polling_frequency() [all …]
|
| /kernel/linux/linux-5.10/drivers/thermal/ |
| D | thermal_core.c | 69 * @tz: a valid pointer to a struct thermal_zone_device 75 static void bind_previous_governor(struct thermal_zone_device *tz, in bind_previous_governor() argument 78 if (tz->governor && tz->governor->bind_to_tz) { in bind_previous_governor() 79 if (tz->governor->bind_to_tz(tz)) { in bind_previous_governor() 80 dev_err(&tz->device, in bind_previous_governor() 82 failed_gov_name, tz->governor->name, tz->type); in bind_previous_governor() 83 tz->governor = NULL; in bind_previous_governor() 90 * @tz: a valid pointer to a struct thermal_zone_device 93 * Change the governor of thermal zone @tz. 97 static int thermal_set_governor(struct thermal_zone_device *tz, in thermal_set_governor() argument [all …]
|
| D | thermal_helpers.c | 26 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() 45 get_thermal_instance(struct thermal_zone_device *tz, in get_thermal_instance() argument 51 mutex_lock(&tz->lock); in get_thermal_instance() 54 list_for_each_entry(pos, &tz->thermal_instances, tz_node) { in get_thermal_instance() 55 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { in get_thermal_instance() 62 mutex_unlock(&tz->lock); in get_thermal_instance() [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 52 int enabled = thermal_zone_device_is_enabled(tz); in mode_show() 61 struct thermal_zone_device *tz = to_thermal_zone(dev); in mode_store() local 65 result = thermal_zone_device_enable(tz); in mode_store() 67 result = thermal_zone_device_disable(tz); in mode_store() 81 struct thermal_zone_device *tz = to_thermal_zone(dev); in trip_point_type_show() local [all …]
|
| D | gov_power_allocator.c | 77 * @tz: thermal zone we are operating in 86 static u32 estimate_sustainable_power(struct thermal_zone_device *tz) in estimate_sustainable_power() argument 90 struct power_allocator_params *params = tz->governor_data; in estimate_sustainable_power() 92 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in estimate_sustainable_power() 110 * @tz: thermal zone for which to estimate the constants 127 static void estimate_pid_constants(struct thermal_zone_device *tz, in estimate_pid_constants() argument 135 ret = tz->ops->get_trip_temp(tz, trip_switch_on, &switch_on_temp); in estimate_pid_constants() 151 if (!tz->tzp->k_po || force) in estimate_pid_constants() 152 tz->tzp->k_po = int_to_frac(sustainable_power) / in estimate_pid_constants() 155 if (!tz->tzp->k_pu || force) in estimate_pid_constants() [all …]
|
| D | thermal_hwmon.c | 39 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 …]
|
| D | thermal_of.c | 87 static int of_thermal_get_temp(struct thermal_zone_device *tz, in of_thermal_get_temp() argument 90 struct __thermal_zone *data = tz->devdata; in of_thermal_get_temp() 98 static int of_thermal_set_trips(struct thermal_zone_device *tz, in of_thermal_set_trips() argument 101 struct __thermal_zone *data = tz->devdata; in of_thermal_set_trips() 112 * @tz: pointer to a thermal zone 119 int of_thermal_get_ntrips(struct thermal_zone_device *tz) in of_thermal_get_ntrips() argument 121 struct __thermal_zone *data = tz->devdata; in of_thermal_get_ntrips() 133 * @tz: pointer to a thermal zone 140 bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip) in of_thermal_is_trip_valid() argument 142 struct __thermal_zone *data = tz->devdata; in of_thermal_is_trip_valid() [all …]
|
| D | gov_bang_bang.c | 16 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 mutex_lock(&tz->lock); in thermal_zone_trip_update() 36 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update() 55 if (instance->target == 0 && tz->temperature >= trip_temp) in thermal_zone_trip_update() [all …]
|
| D | gov_fair_share.c | 20 * @tz: thermal zone device 22 static int get_trip_level(struct thermal_zone_device *tz) in get_trip_level() argument 28 if (tz->trips == 0 || !tz->ops->get_trip_temp) in get_trip_level() 31 for (count = 0; count < tz->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->trips); in get_target_state() [all …]
|
| D | gov_step_wise.c | 105 static void update_passive_instance(struct thermal_zone_device *tz, in update_passive_instance() argument 113 tz->passive += value; in update_passive_instance() 116 static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) in thermal_zone_trip_update() argument 126 trip_temp = tz->forced_passive; in thermal_zone_trip_update() 129 tz->ops->get_trip_temp(tz, trip, &trip_temp); in thermal_zone_trip_update() 130 tz->ops->get_trip_type(tz, trip, &trip_type); in thermal_zone_trip_update() 133 trend = get_tz_trend(tz, trip); in thermal_zone_trip_update() 135 if (tz->temperature >= trip_temp) { in thermal_zone_trip_update() 137 trace_thermal_zone_trip(tz, trip, trip_type); in thermal_zone_trip_update() 140 dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", in thermal_zone_trip_update() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|