summaryrefstree
path: root/kernel/drivers/cpufreq/exynos-ufc.h
blob: 8dbd0c02f6468c227049c2685c51bed0eb0d3e6c (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * Copyright (c) 2016 DAEYEONG LEE, Samsung Electronics Co., Ltd <daeyeong.lee@samsung.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Exynos UFC(User Frequency Change) driver implementation
 */

enum exynos_ufc_execution_mode {
	AARCH64_MODE = 0,
	AARCH32_MODE,
	MODE_END,
};

enum exynos_ufc_ctrl_type {
	PM_QOS_MIN_LIMIT = 0,
	PM_QOS_MIN_WO_BOOST_LIMIT,
	PM_QOS_MAX_LIMIT,
	TYPE_END,
};

struct ufc_table_info {
	int			ctrl_type;
	int			mode;
	unsigned int		cur_index;
	u32			**ufc_table;
	struct list_head	list;

	struct kobject		kobj;
};

struct ufc_domain {
	struct cpumask		cpus;
	int			pm_qos_min_class;
	int			pm_qos_max_class;

	unsigned int		table_idx;
	unsigned int		min_freq;
	unsigned int		max_freq;
	unsigned int		clear_freq;

	struct pm_qos_request	user_min_qos_req;
	struct pm_qos_request	user_max_qos_req;
	struct pm_qos_request	user_min_qos_wo_boost_req;

	struct list_head	list;
};

struct exynos_ufc {
	unsigned int		table_row;
	unsigned int		table_col;
	unsigned int		lit_table_row;

	int			fill_flag;

	int			sse_mode;

	int			last_min_input;
	int			last_min_wo_boost_input;
	int			last_max_input;

	u32			**ufc_lit_table;
	struct list_head	ufc_domain_list;
	struct list_head	ufc_table_list;
};

#ifdef CONFIG_ARM_EXYNOS_UFC
extern void __init exynos_ufc_init(void);
extern unsigned int get_cpufreq_max_limit(void);
#else
static inline void __init exynos_ufc_init(void) { }
static inline unsigned int  get_cpufreq_max_limit(void) { return UINT_MAX; }
#endif