summaryrefslogtreecommitdiffstats
path: root/power
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-09-28 01:18:30 -0500
committerZiyann <jaraidaniel@gmail.com>2014-11-14 09:05:50 +0100
commite040b45c8e4e54c8df9d6c714fc8164427f8a33b (patch)
tree0e98b7a1347b06a74fa3e01415da8f75303a5dd3 /power
parent6e32ac8570fb2dab88589f26466ab53e268b5828 (diff)
downloaddevice_samsung_tuna-e040b45c8e4e54c8df9d6c714fc8164427f8a33b.zip
device_samsung_tuna-e040b45c8e4e54c8df9d6c714fc8164427f8a33b.tar.gz
device_samsung_tuna-e040b45c8e4e54c8df9d6c714fc8164427f8a33b.tar.bz2
tuna: add cpu boost hint
Code copied from Steve Kondik's commit. Change-Id: I7576534132940ef0820af91f2d314055fbd84411
Diffstat (limited to 'power')
-rw-r--r--power/power_tuna.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/power/power_tuna.c b/power/power_tuna.c
index 4562bc1..bc996cb 100644
--- a/power/power_tuna.c
+++ b/power/power_tuna.c
@@ -154,6 +154,7 @@ static void tuna_power_hint(struct power_module *module, power_hint_t hint,
struct tuna_power_module *tuna = (struct tuna_power_module *) module;
char buf[80];
int len;
+ int duration = 1;
if (!tuna->inited) {
return;
@@ -161,14 +162,19 @@ static void tuna_power_hint(struct power_module *module, power_hint_t hint,
switch (hint) {
case POWER_HINT_INTERACTION:
+ case POWER_HINT_CPU_BOOST:
+ if (data != NULL)
+ duration = (int) data;
+
if (boostpulse_open(tuna) >= 0) {
- len = write(tuna->boostpulse_fd, "1", 1);
+ snprintf(buf, sizeof(buf), "%d", duration);
+ len = write(tuna->boostpulse_fd, buf, strlen(buf));
- if (len < 0) {
- strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error writing to %s: %s\n", BOOSTPULSE_PATH, buf);
- }
- }
+ if (len < 0) {
+ strerror_r(errno, buf, sizeof(buf));
+ ALOGE("Error writing to %s: %s\n", BOOSTPULSE_PATH, buf);
+ }
+ }
break;
case POWER_HINT_VSYNC: