cpuquiet: public interfaces for cpuquiet
[firefly-linux-kernel-4.4.55.git] / include / linux / cpuquiet.h
1 /*
2  * Copyright (c) 2012 NVIDIA CORPORATION.  All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16  *
17  */
18
19 #ifndef _LINUX_CPUONLINE_H
20 #define _LINUX_CPUONLINE_H
21
22 #include <linux/sysfs.h>
23 #include <linux/kobject.h>
24
25 #define CPUQUIET_NAME_LEN 16
26
27 struct cpuquiet_governor {
28         char                    name[CPUQUIET_NAME_LEN];
29         struct list_head        governor_list;
30         int (*start)            (void);
31         void (*stop)            (void);
32         int (*store_active)     (unsigned int cpu, bool active);
33         struct module           *owner;
34 };
35
36 struct cpuquiet_driver {
37         char                    name[CPUQUIET_NAME_LEN];
38         int (*quiesence_cpu)    (unsigned int cpunumber);
39         int (*wake_cpu)         (unsigned int cpunumber);
40 };
41
42 extern int cpuquiet_register_governor(struct cpuquiet_governor *gov);
43 extern void cpuquiet_unregister_governor(struct cpuquiet_governor *gov);
44 extern int cpuquiet_quiesence_cpu(unsigned int cpunumber);
45 extern int cpuquiet_wake_cpu(unsigned int cpunumber);
46 extern int cpuquiet_register_driver(struct cpuquiet_driver *drv);
47 extern void cpuquiet_unregister_driver(struct cpuquiet_driver *drv);
48 extern int cpuquiet_add_group(struct attribute_group *attrs);
49 extern void cpuquiet_remove_group(struct attribute_group *attrs);
50 int cpuquiet_kobject_init(struct kobject *kobj, struct kobj_type *type,
51                                 char *name);
52 extern unsigned int nr_cluster_ids;
53 #endif