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
24 if (trip->temperature >= tz->temperature) in get_trip_level()
36 trace_thermal_zone_trip(tz, trip_level, level_trip->type); in get_trip_level()
44 return (long)(percentage * level * cdev->max_state) / (100 * tz->num_trips); in get_target_state()
48 * fair_share_throttle - throttles devices associated with the given zone
53 * throttle state of the cooling devices associated with the given zone.
56 * P1. max_state: Maximum throttle state exposed by the cooling device.
58 * How 'effective' the 'i'th device is, in cooling the given zone.
62 * whereas the throttling is at full swing if we trip critical levels.
64 * new_state of cooling device = P3 * P2 * P1
74 lockdep_assert_held(&tz->lock); in fair_share_throttle()
76 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in fair_share_throttle()
77 if (instance->trip != trip) in fair_share_throttle()
80 total_weight += instance->weight; in fair_share_throttle()
84 list_for_each_entry(instance, &tz->thermal_instances, tz_node) { in fair_share_throttle()
86 struct thermal_cooling_device *cdev = instance->cdev; in fair_share_throttle()
88 if (instance->trip != trip) in fair_share_throttle()
94 percentage = (instance->weight * 100) / total_weight; in fair_share_throttle()
96 instance->target = get_target_state(tz, cdev, percentage, in fair_share_throttle()
99 mutex_lock(&cdev->lock); in fair_share_throttle()
101 mutex_unlock(&cdev->lock); in fair_share_throttle()