Skip to content
Snippets Groups Projects
Commit f9ed2384 authored by TheScarastic's avatar TheScarastic Committed by Dhina17
Browse files

onclite: Switch to more generic dt2w node


Signed-off-by: default avatarDhina17 <dhinalogu@gmail.com>
parent 5f3d6a22
No related branches found
No related tags found
No related merge requests found
......@@ -191,6 +191,7 @@ BOARD_ROOT_EXTRA_SYMLINKS := \
TARGET_PER_MGR_ENABLED := true
# Power
TARGET_TAP_TO_WAKE_NODE := "/dev/input/event2"
TARGET_USES_INTERACTION_BOOST := true
# Qualcomm
......
......@@ -12,6 +12,7 @@ LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SHARED_LIBRARIES := liblog libcutils libdl libxml2
LOCAL_HEADER_LIBRARIES += libutils_headers
LOCAL_HEADER_LIBRARIES += libhardware_headers
LOCAL_HEADER_LIBRARIES += generated_kernel_headers
LOCAL_SRC_FILES := power-8953.c power.c metadata-parser.c utils.c list.c hint-data.c powerhintparser.c
LOCAL_C_INCLUDES := external/libxml2/include \
external/icu/icu4c/source/common
......
......@@ -42,6 +42,9 @@
#define HINT_HANDLED (0)
#define HINT_NONE (-1)
#define INPUT_EVENT_WAKUP_MODE_OFF 4
#define INPUT_EVENT_WAKUP_MODE_ON 5
enum CPU_GOV_CHECK {
CPU0 = 0,
CPU1 = 1,
......
......@@ -42,6 +42,7 @@
#include <utils/Log.h>
#include <hardware/hardware.h>
#include <hardware/power.h>
#include <linux/input.h>
#include "utils.h"
#include "hint-data.h"
......@@ -145,9 +146,15 @@ void set_interactive(struct power_module *module, int on)
void set_feature(struct power_module* module, feature_t feature, int state) {
switch (feature) {
#ifdef TAP_TO_WAKE_NODE
case POWER_FEATURE_DOUBLE_TAP_TO_WAKE:
sysfs_write(TAP_TO_WAKE_NODE, state ? "1" : "0");
break;
case POWER_FEATURE_DOUBLE_TAP_TO_WAKE: {
int fd = open(TAP_TO_WAKE_NODE, O_RDWR);
struct input_event ev;
ev.type = EV_SYN;
ev.code = SYN_CONFIG;
ev.value = state ? INPUT_EVENT_WAKUP_MODE_ON : INPUT_EVENT_WAKUP_MODE_OFF;
write(fd, &ev, sizeof(ev));
close(fd);
} break;
#endif
default:
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment