Lines Matching +full:cooling +full:- +full:levels

1 // SPDX-License-Identifier: GPL-2.0-only
3 * fair_share.c - A simple weight based Thermal governor
19 * get_trip_level: - obtains the current trip level for a zone
27 for (count = 0; count < tz->num_trips; count++) { in get_trip_level()
29 if (tz->temperature < trip.temperature) in get_trip_level()
35 * point, in which case, trip_point = count - 1 in get_trip_level()
38 trace_thermal_zone_trip(tz, count - 1, trip.type); in get_trip_level()
46 return (long)(percentage * level * cdev->max_state) / (100 * tz->num_trips); in get_target_state()
50 * fair_share_throttle - throttles devices associated with the given zone
55 * throttle state of the cooling devices associated with the given zone.
58 * P1. max_state: Maximum throttle state exposed by the cooling device.
60 * How 'effective' the 'i'th device is, in cooling the given zone.
64 * whereas the throttling is at full swing if we trip critical levels.
66 * new_state of cooling device = P3 * P2 * P1
70 const struct thermal_trip *trip = &tz->trips[trip_index]; in fair_share_throttle()
76 lockdep_assert_held(&tz->lock); in fair_share_throttle()
78 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in fair_share_throttle()
79 if (instance->trip != trip) in fair_share_throttle()
82 total_weight += instance->weight; in fair_share_throttle()
86 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in fair_share_throttle()
88 struct thermal_cooling_device *cdev = instance->cdev; in fair_share_throttle()
90 if (instance->trip != trip) in fair_share_throttle()
96 percentage = (instance->weight * 100) / total_weight; in fair_share_throttle()
98 instance->target = get_target_state(tz, cdev, percentage, in fair_share_throttle()
101 mutex_lock(&cdev->lock); in fair_share_throttle()
103 mutex_unlock(&cdev->lock); in fair_share_throttle()