davinci: power: Support event-based dt2w node
Change-Id: I08c874f3ca50fad1db820ddd85ef0f5d7ccf0ed2
This commit is contained in:
parent
b2d6a22c11
commit
a0e115027a
@ -20,6 +20,9 @@ include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := power-feature.c
|
||||
LOCAL_SHARED_LIBRARIES := liblog libcutils
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
generated_kernel_headers \
|
||||
libhardware_headers
|
||||
|
||||
LOCAL_MODULE := libpower_feature.davinci
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
@ -14,10 +14,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "power-feature.h"
|
||||
|
||||
#include <hardware/power.h>
|
||||
#include <linux/input.h>
|
||||
#include <log/log.h>
|
||||
|
||||
void set_device_specific_feature(feature_t feature, int state) {
|
||||
// stub
|
||||
switch (feature) {
|
||||
case POWER_FEATURE_DOUBLE_TAP_TO_WAKE: {
|
||||
int fd = open(TAP_TO_WAKE_EVENT_NODE, O_WRONLY);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,3 +15,8 @@
|
||||
*/
|
||||
|
||||
#define LOG_TAG "libpower_feature.davinci"
|
||||
|
||||
#define TAP_TO_WAKE_EVENT_NODE "/dev/input/event2"
|
||||
|
||||
#define INPUT_EVENT_WAKUP_MODE_OFF 4
|
||||
#define INPUT_EVENT_WAKUP_MODE_ON 5
|
||||
|
Loading…
Reference in New Issue
Block a user