summaryrefslogtreecommitdiffstats
path: root/power-8937.c
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2019-10-06 01:34:17 +0300
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:57 +0300
commit43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f (patch)
treea5e102806cc781d39a35512d47c0b1a0781d3391 /power-8937.c
parent7af0fea40b41e90123908e0ea104f70dfc370edb (diff)
downloadvendor_qcom_opensource_power-43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f.tar.gz
vendor_qcom_opensource_power-43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f.tar.bz2
vendor_qcom_opensource_power-43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f.zip
power: Clean up and fix set_interactive_override
* Remove debug logs and useless comments * Consistent return values * Add back display hints for legacy platforms, they used to live in power-common.c but removed in commit 561cffcbfa66192e839e040d2da3bff2ecf8dcac * Check if set_interactive_override handled hints and print info message if it didn't Change-Id: Iff9f7327ba71c282e34ff3143c45a3f40f72fc92
Diffstat (limited to 'power-8937.c')
-rw-r--r--power-8937.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/power-8937.c b/power-8937.c
index 98431d3..9963eb4 100644
--- a/power-8937.c
+++ b/power-8937.c
@@ -170,47 +170,38 @@ int set_interactive_override(int on) {
static const char* display_off = "0";
char err_buf[80];
static int init_interactive_hint = 0;
- static int set_i_count = 0;
-
- ALOGI("Got set_interactive hint");
if (get_scaling_governor(governor, sizeof(governor)) == -1) {
ALOGE("Can't obtain scaling governor.");
- return HINT_HANDLED;
+ return HINT_NONE;
}
if (!on) {
- /* Display off. */
+ /* Display off */
if (is_interactive_governor(governor)) {
int resource_values[] = {INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_50,
INT_OP_CLUSTER1_TIMER_RATE, BIG_LITTLE_TR_MS_50,
INT_OP_NOTIFY_ON_MIGRATE, 0x00};
-
perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
ARRAY_SIZE(resource_values));
- } /* Perf time rate set for CORE0,CORE4 8952 target*/
-
+ }
} else {
- /* Display on. */
+ /* Display on */
if (is_interactive_governor(governor)) {
undo_hint_action(DISPLAY_STATE_HINT_ID);
}
}
- set_i_count++;
- ALOGI("Got set_interactive hint on= %d, count= %d\n", on, set_i_count);
-
if (init_interactive_hint == 0) {
// First time the display is turned off
display_fd = TEMP_FAILURE_RETRY(open(SYS_DISPLAY_PWR, O_RDWR));
if (display_fd < 0) {
strerror_r(errno, err_buf, sizeof(err_buf));
ALOGE("Error opening %s: %s\n", SYS_DISPLAY_PWR, err_buf);
- return HINT_HANDLED;
} else
init_interactive_hint = 1;
} else if (!on) {
- /* Display off. */
+ /* Display off */
rc = TEMP_FAILURE_RETRY(write(display_fd, display_off, strlen(display_off)));
if (rc < 0) {
strerror_r(errno, err_buf, sizeof(err_buf));
@@ -224,6 +215,5 @@ int set_interactive_override(int on) {
ALOGE("Error writing %s to %s: %s\n", display_on, SYS_DISPLAY_PWR, err_buf);
}
}
-
return HINT_HANDLED;
}