summaryrefslogtreecommitdiff
path: root/include/linux/input-hook.h
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
committerYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
commit8e4bff4cab0ddac6060645b0715210484d02ff40 (patch)
tree3a5c3024371a04692a3a6d9974d001cdff8ebf84 /include/linux/input-hook.h
Initial file dump from open source releaseHEADmaster
Diffstat (limited to 'include/linux/input-hook.h')
-rw-r--r--include/linux/input-hook.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/input-hook.h b/include/linux/input-hook.h
new file mode 100644
index 00000000..6078e8d2
--- /dev/null
+++ b/include/linux/input-hook.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 Spreadtrum Communications Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#ifndef __INPUT_HOOK_H
+#define __INPUT_HOOK_H
+#include <linux/hrtimer.h>
+#include <linux/sched.h>
+#include <linux/reboot.h>
+#include <linux/input.h>
+#include <linux/uaccess.h>
+#include <linux/proc_fs.h>
+#include <linux/sysrq.h>
+#include <linux/sysctl.h>
+
+//#define HOOK_POWER_KEY
+
+struct trigger_watch_event {
+ bool initialized;
+ bool disable_timer;
+ bool disable_clk_source;
+ bool repeated;
+#define TRIGGER_WATCH_EVENT_REPEATED (1 << 31)
+ u64 last_ts; /* last start timestamp */
+ char *name;
+ int period; /* ms */
+ struct hrtimer timer;
+ void (*trigger_watch_event_cb)(void *private);
+ void *private;
+};
+
+void trigger_watch_event_start(struct trigger_watch_event *event, int ms);
+int trigger_watch_event_stop(struct trigger_watch_event *event);
+void input_report_key_hook(struct input_dev *dev, unsigned int code, int value);
+void input_hook_init(void);
+void input_hook_exit(void);
+#endif