summaryrefstree
path: root/kernel/include/linux/sec_pm_cpufreq.h
blob: f371b83e1667e759d23fdade2a6b4ff9fe428e87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* drivers/samsung/pm/sec_pm_cpufreq.c
 *
 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
 * Author: Minsung Kim <ms925.kim@samsung.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * 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.
 *
 */

#ifndef _LINUX_SEC_PM_CPUFREQ_H
#define _LINUX_SEC_PM_CPUFREQ_H

#include <linux/cpufreq.h>

struct sec_pm_cpufreq_dev {
	unsigned int id;
	unsigned int max_freq;
	unsigned int min_freq;
	struct cpufreq_frequency_table *freq_table;
	unsigned int max_level;
	unsigned int cur_level;
	struct cpufreq_policy *policy;
	struct list_head node;
};

#ifdef CONFIG_SEC_PM_CPUFREQ
struct sec_pm_cpufreq_dev *
sec_pm_cpufreq_register(struct cpufreq_policy *policy);
void sec_pm_cpufreq_unregister(struct sec_pm_cpufreq_dev *cdev);
int sec_pm_cpufreq_throttle_by_one_step(void);
void sec_pm_cpufreq_unthrottle(void);
#else
static inline struct sec_pm_cpufreq_dev *
sec_pm_cpufreq_register(struct cpufreq_policy *policy)
{
	return ERR_PTR(-ENOSYS);
}

static inline void sec_pm_cpufreq_unregister(struct sec_pm_cpufreq_dev *cdev)
{
	return;
}

static inline int sec_pm_cpufreq_throttle_by_one_step(void) { return 0; }
static inline void sec_pm_cpufreq_unthrottle(void) { }
#endif /* CONFIG_SEC_PM_FREQ */
#endif /* _LINUX_SEC_PM_CPUFREQ_H */