summaryrefstree
path: root/kernel/include/linux/input/input_booster.h
blob: f04a00f5b58b45519ae9f22b60b3e69a4baff349 (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
76
77
78
79
80

#ifndef _INPUT_BOOSTER_H_
#define _INPUT_BOOSTER_H_

#include <linux/cpufreq.h>
#include <linux/device.h>

#define INPUT_BOOSTER_NAME	"input_booster"

enum input_booster_id {
	INPUT_BOOSTER_ID_TSP = 0,
	INPUT_BOOSTER_ID_TKEY,
	INPUT_BOOSTER_ID_WACOM,
};

#define DVFS_STAGE_NONE		1 << 0	// 0000 0000 0000 0001
#define DVFS_STAGE_SINGLE	1 << 1	// 0000 0000 0000 0010
#define DVFS_STAGE_DUAL		1 << 2	// 0000 0000 0000 0100
#define DVFS_STAGE_TRIPLE	1 << 3	// 0000 0000 0000 1000
#define DVFS_STAGE_PENTA	1 << 5	// 0000 0000 0010 0000
#define DVFS_STAGE_NINTH	1 << 9	// 0000 0010 0000 0000


/* Touchkey */
#define INPUT_BOOSTER_OFF_TIME_TKEY		500
#define INPUT_BOOSTER_CHG_TIME_TKEY		500


struct input_booster {
	struct delayed_work	work_dvfs_off;
	struct delayed_work	work_dvfs_chg;
	struct mutex		dvfs_lock;

	bool dvfs_lock_status;
	int dvfs_old_stauts;
	int dvfs_boost_mode;
	int dvfs_freq;
	int bimc_freq;
	int dvfs_id;
	int dvfs_stage;

	int (*dvfs_off)(struct input_booster *);
	void (*dvfs_set)(struct input_booster *, int);
};

struct dvfs {
	int time;
	s32 cpu_freq;
	s32 bimc_freq;
};

struct input_booster_dt_data {
	int tsp_stage;
	int tkey_stage;
	int wacom_stage;
	int level;
	struct dvfs head;
	struct dvfs tail;
};

struct input_booster_data {
	struct device *dev;
	struct input_booster_dt_data *dt_data;
	struct class *booster_class;
	int dbg_level;
	int level;
	struct dvfs head;
	struct dvfs tail;
};

struct input_booster *input_booster_allocate(int id);
void input_booster_free(struct input_booster *booster);
void input_booster_get_default_setting(const char *flag, struct dvfs *value);
int input_booster_set_level_change(int val);

#ifdef CONFIG_DEBUG_BUS_VOTER
extern int msm_bus_floor_vote(const char *name, u64 floor_hz);
#endif

#endif /* _INPUT_BOOSTER_H_ */