Lines Matching defs:governor

48  * the thermal core and by the thermal governor code.
66 * bind_previous_governor() - bind the previous governor of the thermal zone
68 * @failed_gov_name: the name of the governor that failed to register
70 * Register the previous governor of the thermal zone after a new
71 * governor has failed to be bound.
76 if (tz->governor && tz->governor->bind_to_tz) {
77 if (tz->governor->bind_to_tz(tz)) {
79 "governor %s failed to bind and the previous one (%s) failed to bind again, thermal zone %s has no governor\n",
80 failed_gov_name, tz->governor->name, tz->type);
81 tz->governor = NULL;
87 * thermal_set_governor() - Switch to another governor
89 * @new_gov: pointer to the new governor
91 * Change the governor of thermal zone @tz.
93 * Return: 0 on success, an error if the new governor's bind_to_tz() failed.
100 if (tz->governor && tz->governor->unbind_from_tz)
101 tz->governor->unbind_from_tz(tz);
112 tz->governor = new_gov;
117 int thermal_register_governor(struct thermal_governor *governor)
123 if (!governor)
129 if (!__find_governor(governor->name)) {
133 list_add(&governor->governor_list, &thermal_governor_list);
134 match_default = !strncmp(governor->name,
139 def_governor = governor;
149 if (pos->governor)
154 if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH)) {
157 ret = thermal_set_governor(pos, governor);
160 "Failed to set governor %s for thermal zone %s: %d\n",
161 governor->name, pos->type, ret);
168 void thermal_unregister_governor(struct thermal_governor *governor)
172 if (!governor)
177 if (!__find_governor(governor->name))
180 list_del(&governor->governor_list);
185 if (!strncasecmp(pos->governor->name, governor->name,
226 struct thermal_governor **governor;
228 for_each_governor_table(governor)
229 thermal_unregister_governor(*governor);
235 struct thermal_governor **governor;
237 for_each_governor_table(governor) {
238 ret = thermal_register_governor(*governor);
240 pr_err("Failed to register governor: '%s'",
241 (*governor)->name);
245 pr_info("Registered thermal governor '%s'",
246 (*governor)->name);
253 if (gov == governor)
306 * - Non-critical trips will invoke the governor responsible for that zone;
357 if (tz->governor)
358 return tz->governor;
366 if (!tz->governor || !tz->governor->update_tz)
369 tz->governor->update_tz(tz, reason);
456 static void thermal_governor_trip_crossed(struct thermal_governor *governor,
464 if (governor->trip_crossed)
465 governor->trip_crossed(tz, trip, upward);
470 struct thermal_governor *governor,
492 thermal_governor_trip_crossed(governor, tz, trip, upward);
562 struct thermal_governor *governor,
573 thermal_trip_crossed(tz, td, governor, false);
585 thermal_trip_crossed(tz, td, governor, true);
612 struct thermal_governor *governor = thermal_get_tz_governor(tz);
644 thermal_zone_handle_trips(tz, governor, &low, &high);
650 if (governor->manage)
651 governor->manage(tz);
1434 struct thermal_governor *governor;
1439 governor = __find_governor(tz->tzp->governor_name);
1441 governor = def_governor;
1443 return thermal_set_governor(tz, governor);