1 /* cpufreq_pmqos_wc1b.c */
3 #include <linux/cpuidle.h>
6 #define ROTARY_BOOSTER_DELAY 200
7 static int rotary_min_cpu_freq = 600000;
8 static int rotary_min_mif_freq = 200000;
11 /* HARD KEY BOOSTER + */
12 static int hard_key_min_cpu_freq = 1000000;
13 #define KEY_BOOSTER_DELAY 200
14 /* HARD KEY BOOSTER - */
16 /* TOUCH WAKEUP BOOSTER + */
17 static int touch_wakeup_min_cpu_freq = 1000000;
18 #define TOUCH_WAKEUP_BOOSTER_DELAY 200
19 /* TOUCH WAKEUP BOOSTER - */
21 #define TOUCH_BOOSTER_OFF_TIME 100
22 #define TOUCH_BOOSTER_CHG_TIME 200
24 #define TOUCH_BOOSTER_MIF_PRESS 200000
25 #define TOUCH_BOOSTER_MIF_MOVE 200000
26 #define TOUCH_BOOSTER_MIF_RELEASE 200000
28 #define TOUCH_BOOSTER_INT_PRESS 100000
29 #define TOUCH_BOOSTER_INT_MOVE 100000
30 #define TOUCH_BOOSTER_INT_RELEASE 100000
32 static struct pm_qos_request pm_qos_cpu_req;
33 static struct pm_qos_request pm_qos_cpu_online_req;
35 static struct pm_qos_request pm_qos_mif_req;
36 static struct pm_qos_request pm_qos_int_req;
38 unsigned int press_cpu_freq, release_cpu_freq;
41 unsigned int press_mif_freq = TOUCH_BOOSTER_MIF_PRESS;
42 unsigned int release_mif_freq = TOUCH_BOOSTER_MIF_RELEASE;
44 unsigned int press_int_freq = TOUCH_BOOSTER_INT_PRESS;
45 unsigned int release_int_freq = TOUCH_BOOSTER_INT_RELEASE;
48 void touch_booster_press_sub(void)
50 press_cpu_freq = cpufreq_get_touch_boost_press();
51 touch_cpu_online = touch_cpu_get_online_min();
53 if (!pm_qos_request_active(&pm_qos_cpu_req))
54 pm_qos_add_request(&pm_qos_cpu_req
55 , PM_QOS_CPU_FREQ_MIN, press_cpu_freq);
57 if (!pm_qos_request_active(&pm_qos_mif_req))
58 pm_qos_add_request(&pm_qos_mif_req
59 , PM_QOS_BUS_THROUGHPUT, press_mif_freq);
61 if (!pm_qos_request_active(&pm_qos_int_req))
62 pm_qos_add_request(&pm_qos_int_req
63 , PM_QOS_DEVICE_THROUGHPUT, press_int_freq);
65 if (touch_cpu_online > 1) {
66 if (!pm_qos_request_active(&pm_qos_cpu_online_req))
67 pm_qos_add_request(&pm_qos_cpu_online_req
68 , PM_QOS_CPU_ONLINE_MIN, touch_cpu_online);
71 cpuidle_set_w_aftr_enable(0);
75 void touch_booster_move_sub(void)
77 unsigned int move_cpu_freq = cpufreq_get_touch_boost_move();
78 unsigned int move_mif_freq = TOUCH_BOOSTER_MIF_MOVE;
79 unsigned int move_int_freq = TOUCH_BOOSTER_INT_MOVE;
81 pm_qos_update_request(&pm_qos_cpu_req, move_cpu_freq);
82 pm_qos_update_request(&pm_qos_mif_req, move_mif_freq);
83 pm_qos_update_request(&pm_qos_int_req, move_int_freq);
87 void touch_booster_release_sub(void)
89 release_cpu_freq = cpufreq_get_touch_boost_release();
91 pm_qos_update_request(&pm_qos_cpu_req, release_cpu_freq);
92 pm_qos_update_request(&pm_qos_mif_req, release_mif_freq);
93 pm_qos_update_request(&pm_qos_int_req, release_int_freq);
98 void touch_booster_off_sub(void)
100 if (pm_qos_request_active(&pm_qos_cpu_req))
101 pm_qos_remove_request(&pm_qos_cpu_req);
103 if (pm_qos_request_active(&pm_qos_mif_req))
104 pm_qos_remove_request(&pm_qos_mif_req);
106 if (pm_qos_request_active(&pm_qos_int_req))
107 pm_qos_remove_request(&pm_qos_int_req);
109 if (pm_qos_request_active(&pm_qos_cpu_online_req))
110 pm_qos_remove_request(&pm_qos_cpu_online_req);
112 cpuidle_w_after_oneshot_log_en();
113 cpuidle_set_w_aftr_enable(1);