Lines Matching full:governor

45  * Governor section: set of functions to handle thermal governors
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) { in bind_previous_governor()
77 if (tz->governor->bind_to_tz(tz)) { in bind_previous_governor()
79 …"governor %s failed to bind and the previous one (%s) failed to bind again, thermal zone %s has no… in bind_previous_governor()
80 failed_gov_name, tz->governor->name, tz->type); in bind_previous_governor()
81 tz->governor = NULL; in bind_previous_governor()
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) in thermal_set_governor()
101 tz->governor->unbind_from_tz(tz); in thermal_set_governor()
112 tz->governor = new_gov; in thermal_set_governor()
117 int thermal_register_governor(struct thermal_governor *governor) in thermal_register_governor() argument
123 if (!governor) in thermal_register_governor()
129 if (!__find_governor(governor->name)) { in thermal_register_governor()
133 list_add(&governor->governor_list, &thermal_governor_list); in thermal_register_governor()
134 match_default = !strncmp(governor->name, in thermal_register_governor()
139 def_governor = governor; in thermal_register_governor()
149 if (pos->governor) in thermal_register_governor()
154 if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH)) { in thermal_register_governor()
157 ret = thermal_set_governor(pos, governor); in thermal_register_governor()
160 "Failed to set governor %s for thermal zone %s: %d\n", in thermal_register_governor()
161 governor->name, pos->type, ret); in thermal_register_governor()
168 void thermal_unregister_governor(struct thermal_governor *governor) in thermal_unregister_governor() argument
172 if (!governor) in thermal_unregister_governor()
177 if (!__find_governor(governor->name)) in thermal_unregister_governor()
180 list_del(&governor->governor_list); in thermal_unregister_governor()
185 if (!strncasecmp(pos->governor->name, governor->name, in thermal_unregister_governor()
226 struct thermal_governor **governor; in thermal_unregister_governors() local
228 for_each_governor_table(governor) in thermal_unregister_governors()
229 thermal_unregister_governor(*governor); in thermal_unregister_governors()
235 struct thermal_governor **governor; in thermal_register_governors() local
237 for_each_governor_table(governor) { in thermal_register_governors()
238 ret = thermal_register_governor(*governor); in thermal_register_governors()
240 pr_err("Failed to register governor: '%s'", in thermal_register_governors()
241 (*governor)->name); in thermal_register_governors()
245 pr_info("Registered thermal governor '%s'", in thermal_register_governors()
246 (*governor)->name); in thermal_register_governors()
253 if (gov == governor) in thermal_register_governors()
306 * - Non-critical trips will invoke the governor responsible for that zone;
357 if (tz->governor) in thermal_get_tz_governor()
358 return tz->governor; in thermal_get_tz_governor()
366 if (!tz->governor || !tz->governor->update_tz) in thermal_governor_update_tz()
369 tz->governor->update_tz(tz, reason); in thermal_governor_update_tz()
453 static void thermal_governor_trip_crossed(struct thermal_governor *governor, in thermal_governor_trip_crossed() argument
461 if (governor->trip_crossed) in thermal_governor_trip_crossed()
462 governor->trip_crossed(tz, trip, upward); in thermal_governor_trip_crossed()
467 struct thermal_governor *governor, in thermal_trip_crossed() argument
489 thermal_governor_trip_crossed(governor, tz, trip, upward); in thermal_trip_crossed()
559 struct thermal_governor *governor, in thermal_zone_handle_trips() argument
570 thermal_trip_crossed(tz, td, governor, false); in thermal_zone_handle_trips()
582 thermal_trip_crossed(tz, td, governor, true); in thermal_zone_handle_trips()
609 struct thermal_governor *governor = thermal_get_tz_governor(tz); in __thermal_zone_device_update() local
641 thermal_zone_handle_trips(tz, governor, &low, &high); in __thermal_zone_device_update()
647 if (governor->manage) in __thermal_zone_device_update()
648 governor->manage(tz); in __thermal_zone_device_update()
1431 struct thermal_governor *governor; in thermal_zone_init_governor() local
1436 governor = __find_governor(tz->tzp->governor_name); in thermal_zone_init_governor()
1438 governor = def_governor; in thermal_zone_init_governor()
1440 return thermal_set_governor(tz, governor); in thermal_zone_init_governor()