Lines Matching refs:governor
294 struct devfreq_governor *governor; in try_then_request_governor() local
304 governor = find_devfreq_governor(name); in try_then_request_governor()
305 if (IS_ERR(governor)) { in try_then_request_governor()
318 governor = find_devfreq_governor(name); in try_then_request_governor()
321 return governor; in try_then_request_governor()
411 if (!devfreq->governor) in devfreq_update_target()
415 err = devfreq->governor->get_target_freq(devfreq, &freq); in devfreq_update_target()
482 if (IS_SUPPORTED_FLAG(devfreq->governor->flags, IRQ_DRIVEN)) in devfreq_monitor_start()
512 if (IS_SUPPORTED_FLAG(devfreq->governor->flags, IRQ_DRIVEN)) in devfreq_monitor_stop()
543 if (IS_SUPPORTED_FLAG(devfreq->governor->flags, IRQ_DRIVEN)) in devfreq_monitor_suspend()
564 if (IS_SUPPORTED_FLAG(devfreq->governor->flags, IRQ_DRIVEN)) in devfreq_monitor_resume()
604 if (IS_SUPPORTED_FLAG(devfreq->governor->flags, IRQ_DRIVEN)) in devfreq_update_interval()
787 struct devfreq_governor *governor; in devfreq_add_device() local
925 governor = try_then_request_governor(governor_name); in devfreq_add_device()
926 if (IS_ERR(governor)) { in devfreq_add_device()
929 err = PTR_ERR(governor); in devfreq_add_device()
933 devfreq->governor = governor; in devfreq_add_device()
934 err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, in devfreq_add_device()
942 create_sysfs_files(devfreq, devfreq->governor); in devfreq_add_device()
981 if (devfreq->governor) { in devfreq_remove_device()
982 devfreq->governor->event_handler(devfreq, in devfreq_remove_device()
984 remove_sysfs_files(devfreq, devfreq->governor); in devfreq_remove_device()
1145 if (devfreq->governor) { in devfreq_suspend_device()
1146 ret = devfreq->governor->event_handler(devfreq, in devfreq_suspend_device()
1190 if (devfreq->governor) { in devfreq_resume_device()
1191 ret = devfreq->governor->event_handler(devfreq, in devfreq_resume_device()
1249 int devfreq_add_governor(struct devfreq_governor *governor) in devfreq_add_governor() argument
1255 if (!governor) { in devfreq_add_governor()
1261 g = find_devfreq_governor(governor->name); in devfreq_add_governor()
1269 list_add(&governor->node, &devfreq_governor_list); in devfreq_add_governor()
1275 if (!strncmp(devfreq->governor->name, governor->name, in devfreq_add_governor()
1278 if (devfreq->governor) { in devfreq_add_governor()
1281 __func__, devfreq->governor->name); in devfreq_add_governor()
1282 ret = devfreq->governor->event_handler(devfreq, in devfreq_add_governor()
1288 devfreq->governor->name, ret); in devfreq_add_governor()
1292 devfreq->governor = governor; in devfreq_add_governor()
1293 ret = devfreq->governor->event_handler(devfreq, in devfreq_add_governor()
1297 __func__, devfreq->governor->name, in devfreq_add_governor()
1310 static void devm_devfreq_remove_governor(void *governor) in devm_devfreq_remove_governor() argument
1312 WARN_ON(devfreq_remove_governor(governor)); in devm_devfreq_remove_governor()
1323 struct devfreq_governor *governor) in devm_devfreq_add_governor() argument
1327 err = devfreq_add_governor(governor); in devm_devfreq_add_governor()
1332 governor); in devm_devfreq_add_governor()
1340 int devfreq_remove_governor(struct devfreq_governor *governor) in devfreq_remove_governor() argument
1346 if (!governor) { in devfreq_remove_governor()
1352 g = find_devfreq_governor(governor->name); in devfreq_remove_governor()
1355 governor->name); in devfreq_remove_governor()
1363 if (!strncmp(devfreq->governor->name, governor->name, in devfreq_remove_governor()
1366 if (!devfreq->governor) { in devfreq_remove_governor()
1368 __func__, governor->name); in devfreq_remove_governor()
1372 ret = devfreq->governor->event_handler(devfreq, in devfreq_remove_governor()
1376 __func__, devfreq->governor->name, in devfreq_remove_governor()
1379 devfreq->governor = NULL; in devfreq_remove_governor()
1383 list_del(&governor->node); in devfreq_remove_governor()
1404 if (!df->governor) in governor_show()
1407 return sprintf(buf, "%s\n", df->governor->name); in governor_show()
1416 const struct devfreq_governor *governor, *prev_governor; in governor_store() local
1418 if (!df->governor) in governor_store()
1426 governor = try_then_request_governor(str_governor); in governor_store()
1427 if (IS_ERR(governor)) { in governor_store()
1428 ret = PTR_ERR(governor); in governor_store()
1431 if (df->governor == governor) { in governor_store()
1434 } else if (IS_SUPPORTED_FLAG(df->governor->flags, IMMUTABLE) in governor_store()
1435 || IS_SUPPORTED_FLAG(governor->flags, IMMUTABLE)) { in governor_store()
1444 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL); in governor_store()
1447 __func__, df->governor->name, ret); in governor_store()
1450 remove_sysfs_files(df, df->governor); in governor_store()
1456 prev_governor = df->governor; in governor_store()
1457 df->governor = governor; in governor_store()
1458 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); in governor_store()
1461 __func__, df->governor->name, ret); in governor_store()
1464 df->governor = prev_governor; in governor_store()
1465 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); in governor_store()
1470 df->governor = NULL; in governor_store()
1479 create_sysfs_files(df, df->governor); in governor_store()
1488 static DEVICE_ATTR_RW(governor);
1497 if (!df->governor) in available_governors_show()
1506 if (IS_SUPPORTED_FLAG(df->governor->flags, IMMUTABLE)) { in available_governors_show()
1508 "%s ", df->governor->name); in available_governors_show()
1514 struct devfreq_governor *governor; in available_governors_show() local
1516 list_for_each_entry(governor, &devfreq_governor_list, node) { in available_governors_show()
1517 if (IS_SUPPORTED_FLAG(governor->flags, IMMUTABLE)) in available_governors_show()
1520 "%s ", governor->name); in available_governors_show()
1800 if (!df->governor) in polling_interval_store()
1807 df->governor->event_handler(df, DEVFREQ_GOV_UPDATE_INTERVAL, &value); in polling_interval_store()
1833 if (!df->governor || !df->profile) in timer_store()
1861 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL); in timer_store()
1864 __func__, df->governor->name, ret); in timer_store()
1868 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL); in timer_store()
1871 __func__, df->governor->name, ret); in timer_store()
1949 if (!strncmp(devfreq->governor->name, DEVFREQ_GOV_PASSIVE, in devfreq_summary_show()
1965 if (IS_SUPPORTED_ATTR(devfreq->governor->attrs, POLLING_INTERVAL)) in devfreq_summary_show()
1975 devfreq->governor->name, in devfreq_summary_show()