diff options
author | Steve Kondik <shade@chemlab.org> | 2012-09-28 01:18:30 -0500 |
---|---|---|
committer | Daniel Bateman <jetison.24@gmail.com> | 2012-09-28 01:32:31 -0500 |
commit | e01be98b1a5528dc37fdab10ef87bc4969f5ea28 (patch) | |
tree | 4c6fe4616031e0c0b06dfa4de37137aed9f50cd4 /power | |
parent | 8a2b60a901b3efecd9f57d60d33e707e7f2993c3 (diff) | |
download | device_samsung_tuna-e01be98b1a5528dc37fdab10ef87bc4969f5ea28.zip device_samsung_tuna-e01be98b1a5528dc37fdab10ef87bc4969f5ea28.tar.gz device_samsung_tuna-e01be98b1a5528dc37fdab10ef87bc4969f5ea28.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.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/power/power_tuna.c b/power/power_tuna.c index 0789e8f..1676209 100644 --- a/power/power_tuna.c +++ b/power/power_tuna.c @@ -154,17 +154,23 @@ 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; 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: |