diff options
| author | Dave Daynard <nardholio@gmail.com> | 2015-07-20 04:04:14 -0700 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-07-20 04:04:32 -0700 |
| commit | fb368f8877e88eb9189977d7b55187853930dbd0 (patch) | |
| tree | 33f493b4d5cf78ec107016b09a021b3d55852fcf | |
| parent | c90f7c1f3ccb9a4b59867320cb7378e3d76d420f (diff) | |
Revert "device: Disable hispeed_freq while screen is off"
Makes UI laggy and unresponsive at times on wakeup, especially when answering incoming calls.
This reverts commit 6e7c4a0c82907bdc971b583b0d434ab60299e143.
Change-Id: I2629e1e24e38153196e58e809782b3acef0b3775
| -rw-r--r-- | BoardConfigCommon.mk | 3 | ||||
| -rw-r--r-- | power/power_ext.c | 101 |
2 files changed, 1 insertions, 103 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 6b7cdc0..2e13e0f 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -136,5 +136,4 @@ BOARD_VOLD_MAX_PARTITIONS := 28 TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun%d/file # Build our own PowerHAL -TARGET_POWERHAL_VARIANT := -TARGET_POWERHAL_SET_INTERACTIVE_EXT := device/samsung/msm8960-common/power/power_ext.c +TARGET_POWERHAL_VARIANT :=
\ No newline at end of file diff --git a/power/power_ext.c b/power/power_ext.c deleted file mode 100644 index 6d15fca..0000000 --- a/power/power_ext.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2015 The CyanogenMod Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <errno.h> -#include <string.h> -#include <fcntl.h> -#include <utils/Log.h> - -#define NODE_MAX 64 - -#define GO_HISPEED_LOAD_PATH "/sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load" -#define OFF_HIGHSPEED_LOAD 110 - -static int go_hispeed_load = 0; -static int off_hispeed_load = OFF_HIGHSPEED_LOAD; - -static int sysfs_read(char *path, char *s, int num_bytes) -{ - char buf[80]; - int count; - int ret = 0; - int fd = open(path, O_RDONLY); - - if (fd < 0) { - strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error opening %s: %s\n", path, buf); - - return -1; - } - - if ((count = read(fd, s, num_bytes - 1)) < 0) { - strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error reading %s: %s\n", path, buf); - - ret = -1; - } else { - s[count] = '\0'; - } - - close(fd); - - return ret; -} - -static int sysfs_write(char *path, char *s) -{ - char buf[80]; - int len; - int ret = 0; - int fd = open(path, O_WRONLY); - - if (fd < 0) { - strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error opening %s: %s\n", path, buf); - - return -1; - } - - len = write(fd, s, strlen(s)); - if (len < 0) { - strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error writing to %s: %s\n", path, buf); - - ret = -1; - } - - close(fd); - - return ret; -} - -void cm_power_set_interactive_ext(int on) -{ - char tmp_str[NODE_MAX]; - int tmp; - - if (sysfs_read(GO_HISPEED_LOAD_PATH, tmp_str, NODE_MAX - 1)) { - return; - } - - tmp = atoi(tmp_str); - if (!go_hispeed_load || (go_hispeed_load != tmp && off_hispeed_load != tmp)) { - go_hispeed_load = tmp; - } - - snprintf(tmp_str, NODE_MAX, "%d", on ? go_hispeed_load : off_hispeed_load); - sysfs_write(GO_HISPEED_LOAD_PATH, tmp_str); -} |
