Lines Matching defs:governor

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) {
75 if (tz->governor->bind_to_tz(tz)) {
77 "governor %s failed to bind and the previous one (%s) failed to bind again, thermal zone %s has no governor\n",
78 failed_gov_name, tz->governor->name, tz->type);
79 tz->governor = NULL;
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)
99 tz->governor->unbind_from_tz(tz);
110 tz->governor = new_gov;
115 int thermal_register_governor(struct thermal_governor *governor)
121 if (!governor)
127 if (!__find_governor(governor->name)) {
131 list_add(&governor->governor_list, &thermal_governor_list);
132 match_default = !strncmp(governor->name,
137 def_governor = governor;
147 if (pos->governor)
152 if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH)) {
155 ret = thermal_set_governor(pos, governor);
158 "Failed to set governor %s for thermal zone %s: %d\n",
159 governor->name, pos->type, ret);
169 void thermal_unregister_governor(struct thermal_governor *governor)
173 if (!governor)
178 if (!__find_governor(governor->name))
184 if (!strncasecmp(pos->governor->name, governor->name,
190 list_del(&governor->governor_list);
238 struct thermal_governor **governor;
240 for_each_governor_table(governor)
241 thermal_unregister_governor(*governor);
247 struct thermal_governor **governor;
249 for_each_governor_table(governor) {
250 ret = thermal_register_governor(*governor);
252 pr_err("Failed to register governor: '%s'",
253 (*governor)->name);
257 pr_info("Registered thermal governor '%s'",
258 (*governor)->name);
265 if (gov == governor)
280 * - Non-critical trips will invoke the governor responsible for that zone;
307 tz->governor ? tz->governor->throttle(tz, trip) :
314 if (!tz->governor || !tz->governor->update_tz)
317 tz->governor->update_tz(tz, reason);
1280 struct thermal_governor *governor;
1365 /* Update 'this' zone's governor information */
1369 governor = __find_governor(tz->tzp->governor_name);
1371 governor = def_governor;
1373 result = thermal_set_governor(tz, governor);