/openbmc/linux/drivers/thermal/ |
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A D | thermal_of.c | 168 struct device_node *np, *tz; in of_thermal_zone_find() local 189 tz = ERR_PTR(-EINVAL); in of_thermal_zone_find() 202 tz = ERR_PTR(ret); in of_thermal_zone_find() 210 tz = no_free_ptr(child); in of_thermal_zone_find() 215 tz = ERR_PTR(-ENODEV); in of_thermal_zone_find() 218 return tz; in of_thermal_zone_find() 271 static struct device_node *thermal_of_zone_get_by_name(struct thermal_zone_device *tz) in thermal_of_zone_get_by_name() argument 279 tz_np = of_get_child_by_name(np, tz->type); in thermal_of_zone_get_by_name() 290 struct thermal_zone_device *tz, struct thermal_cooling_device *cdev) in __thermal_of_unbind() argument 313 ret = thermal_zone_unbind_cooling_device(tz, trip_id, cdev); in __thermal_of_unbind() [all …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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, 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()
|
H A 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 99 struct list_head tz_node; /* node in tz->thermal_instances */ 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);
|
H A 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
|
/openbmc/linux/drivers/acpi/ |
H A 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 …]
|
/openbmc/linux/tools/lib/thermal/ |
H A 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 …]
|
H A 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 …]
|
/openbmc/linux/tools/thermal/thermal-engine/ |
H A 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 …]
|
/openbmc/linux/tools/testing/selftests/timers/ |
H A 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 …]
|
/openbmc/linux/tools/thermal/thermometer/ |
H A 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 …]
|
/openbmc/linux/include/linux/ |
H A D | thermal.h | 206 int (*bind_to_tz)(struct thermal_zone_device *tz); 207 void (*unbind_from_tz)(struct thermal_zone_device *tz); 208 int (*throttle)(struct thermal_zone_device *tz, int trip); 267 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz); 279 struct thermal_zone_device *tz) in devm_thermal_of_zone_unregister() argument 284 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 286 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, 289 int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id, 292 int for_each_thermal_trip(struct thermal_zone_device *tz, 295 int thermal_zone_get_num_trips(struct thermal_zone_device *tz); [all …]
|
/openbmc/openbmc/poky/meta/recipes-core/busybox/files/ |
H A D | hwclock.sh | 18 # partition! The workaround is to define TZ either 25 [ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime" 36 if [ -z "$TZ" ] 38 hwclock $tz --hctosys 40 TZ="$TZ" hwclock $tz --hctosys 63 hwclock $tz --systohc 74 hwclock $tz --show
|
/openbmc/linux/drivers/thermal/broadcom/ |
H A 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 203 tz = devm_thermal_of_zone_register(&pdev->dev, 0, data, in bcm2835_thermal_probe() 205 if (IS_ERR(tz)) { in bcm2835_thermal_probe() 206 err = PTR_ERR(tz); in bcm2835_thermal_probe() 224 slope = thermal_zone_get_slope(tz); in bcm2835_thermal_probe() [all …]
|
H A 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()
|
/openbmc/linux/fs/isofs/ |
H A 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()
|