Lines Matching full:governor
43 * Governor section: set of functions to handle thermal governors
46 * the thermal core and by the thermal governor code.
64 * bind_previous_governor() - bind the previous governor of the thermal zone
66 * @failed_gov_name: the name of the governor that failed to register
68 * Register the previous governor of the thermal zone after a new
69 * governor has failed to be bound.
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()
77 …"governor %s failed to bind and the previous one (%s) failed to bind again, thermal zone %s has no… 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()
85 * thermal_set_governor() - Switch to another governor
87 * @new_gov: pointer to the new governor
89 * Change the governor of thermal zone @tz.
91 * Return: 0 on success, an error if the new governor's bind_to_tz() failed.
98 if (tz->governor && tz->governor->unbind_from_tz) in thermal_set_governor()
99 tz->governor->unbind_from_tz(tz); in thermal_set_governor()
110 tz->governor = new_gov; in thermal_set_governor()
115 int thermal_register_governor(struct thermal_governor *governor) in thermal_register_governor() argument
121 if (!governor) in thermal_register_governor()
127 if (!__find_governor(governor->name)) { in thermal_register_governor()
131 list_add(&governor->governor_list, &thermal_governor_list); in thermal_register_governor()
132 match_default = !strncmp(governor->name, in thermal_register_governor()
137 def_governor = governor; in thermal_register_governor()
147 if (pos->governor) in thermal_register_governor()
152 if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH)) { in thermal_register_governor()
155 ret = thermal_set_governor(pos, governor); in thermal_register_governor()
158 "Failed to set governor %s for thermal zone %s: %d\n", in thermal_register_governor()
159 governor->name, pos->type, ret); in thermal_register_governor()
169 void thermal_unregister_governor(struct thermal_governor *governor) in thermal_unregister_governor() argument
173 if (!governor) in thermal_unregister_governor()
178 if (!__find_governor(governor->name)) in thermal_unregister_governor()
184 if (!strncasecmp(pos->governor->name, governor->name, in thermal_unregister_governor()
190 list_del(&governor->governor_list); in thermal_unregister_governor()
241 struct thermal_governor **governor; in thermal_unregister_governors() local
243 for_each_governor_table(governor) in thermal_unregister_governors()
244 thermal_unregister_governor(*governor); in thermal_unregister_governors()
250 struct thermal_governor **governor; in thermal_register_governors() local
252 for_each_governor_table(governor) { in thermal_register_governors()
253 ret = thermal_register_governor(*governor); in thermal_register_governors()
255 pr_err("Failed to register governor: '%s'", in thermal_register_governors()
256 (*governor)->name); in thermal_register_governors()
260 pr_info("Registered thermal governor '%s'", in thermal_register_governors()
261 (*governor)->name); in thermal_register_governors()
268 if (gov == governor) in thermal_register_governors()
284 * - Non-critical trips will invoke the governor responsible for that zone;
310 tz->governor ? tz->governor->throttle(tz, trip) : in handle_non_critical_trips()
1245 struct thermal_governor *governor; in thermal_zone_device_register_with_trips() local
1352 /* Update 'this' zone's governor information */ in thermal_zone_device_register_with_trips()
1356 governor = __find_governor(tz->tzp->governor_name); in thermal_zone_device_register_with_trips()
1358 governor = def_governor; in thermal_zone_device_register_with_trips()
1360 result = thermal_set_governor(tz, governor); in thermal_zone_device_register_with_trips()