power: Add support for POWER_HINT_CPU_BOOST

Change-Id: I75030eb2dabfed518e961d71efb9d55670d2808a
tirimbino
Christopher N. Hesse 8 years ago
parent c7dd07ab9b
commit 5fada9b0c8
  1. 1
      power/include/samsung_power.h
  2. 25
      power/power.c

@ -24,6 +24,7 @@
* symlink to the locations given here, or override this header in your
* device tree.
*/
#define BOOST_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/boost"
#define BOOSTPULSE_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse"
#define IO_IS_BUSY_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy"

@ -119,6 +119,26 @@ static void sysfs_write(const char *path, char *s)
close(fd);
}
static void boost(int32_t duration_us)
{
int fd;
if (duration_us <= 0)
return;
fd = open(BOOST_PATH, O_WRONLY);
if (fd < 0) {
ALOGE("Error opening %s\n", BOOST_PATH);
return;
}
write(fd, "1", 1);
usleep(duration_us);
write(fd, "0", 1);
close(fd);
}
/**********************************************************
*** POWER FUNCTIONS
**********************************************************/
@ -393,6 +413,11 @@ static void samsung_power_hint(struct power_module *module,
ALOGV("%s: POWER_HINT_VSYNC", __func__);
break;
}
#ifdef POWER_HINT_CPU_BOOST
case POWER_HINT_CPU_BOOST:
boost((*(int32_t *)data));
break;
#endif
case POWER_HINT_SET_PROFILE: {
int profile = *((intptr_t *)data);

Loading…
Cancel
Save