Lines Matching +full:higher +full:- +full:than +full:- +full:threshold
1 // SPDX-License-Identifier: GPL-2.0-only
3 * step_wise.c - A step-by-step Thermal throttling governor
20 * If the temperature is higher than a trip point,
21 * a. if the trend is THERMAL_TREND_RAISING, use higher cooling
24 * If the temperature is lower than a trip point,
33 struct thermal_cooling_device *cdev = instance->cdev; in get_target_state()
41 cdev->ops->get_cur_state(cdev, &cur_state); in get_target_state()
42 dev_dbg(&cdev->device, "cur_state=%ld\n", cur_state); in get_target_state()
44 if (!instance->initialized) { in get_target_state()
46 return clamp(cur_state + 1, instance->lower, instance->upper); in get_target_state()
53 return clamp(cur_state + 1, instance->lower, instance->upper); in get_target_state()
55 if (cur_state <= instance->lower) in get_target_state()
62 return instance->lower; in get_target_state()
65 return instance->target; in get_target_state()
77 if (tz->temperature >= trip_threshold) { in thermal_zone_trip_update()
79 trace_thermal_zone_trip(tz, trip_id, trip->type); in thermal_zone_trip_update()
82 dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", in thermal_zone_trip_update()
83 trip_id, trip->type, trip_threshold, trend, throttle); in thermal_zone_trip_update()
85 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in thermal_zone_trip_update()
88 if (instance->trip != trip) in thermal_zone_trip_update()
91 old_target = instance->target; in thermal_zone_trip_update()
92 instance->target = get_target_state(instance, trend, throttle); in thermal_zone_trip_update()
94 dev_dbg(&instance->cdev->device, "old_target=%d, target=%ld\n", in thermal_zone_trip_update()
95 old_target, instance->target); in thermal_zone_trip_update()
97 if (instance->initialized && old_target == instance->target) in thermal_zone_trip_update()
100 instance->initialized = true; in thermal_zone_trip_update()
102 mutex_lock(&instance->cdev->lock); in thermal_zone_trip_update()
103 instance->cdev->updated = false; /* cdev needs update */ in thermal_zone_trip_update()
104 mutex_unlock(&instance->cdev->lock); in thermal_zone_trip_update()
113 lockdep_assert_held(&tz->lock); in step_wise_manage()
123 const struct thermal_trip *trip = &td->trip; in step_wise_manage()
125 if (trip->temperature == THERMAL_TEMP_INVALID || in step_wise_manage()
126 trip->type == THERMAL_TRIP_CRITICAL || in step_wise_manage()
127 trip->type == THERMAL_TRIP_HOT) in step_wise_manage()
130 thermal_zone_trip_update(tz, trip, td->threshold); in step_wise_manage()
133 list_for_each_entry(instance, &tz->thermal_instances, tz_node) in step_wise_manage()
134 thermal_cdev_update(instance->cdev); in step_wise_manage()