/* * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include #include #include static int governor_set(unsigned int cpu, bool active) { int err; if (active) err = cpuquiet_wake_cpu(cpu, true); else err = cpuquiet_quiesce_cpu(cpu, true); return err; } static struct cpuquiet_governor userspace_governor = { .name = "userspace", .store_active = governor_set, .owner = THIS_MODULE, }; static int __init init_usermode(void) { return cpuquiet_register_governor(&userspace_governor); } static void __exit exit_usermode(void) { cpuquiet_unregister_governor(&userspace_governor); } MODULE_LICENSE("GPL"); #ifdef CONFIG_CPU_QUIET_DEFAULT_GOV_USERSPACE fs_initcall(init_usermode); #else module_init(init_usermode); #endif module_exit(exit_usermode);