2 * Copyright (C) 2013 Spreadtrum Communications Inc.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 #ifndef __INPUT_HOOK_H
14 #define __INPUT_HOOK_H
15 #include <linux/hrtimer.h>
16 #include <linux/sched.h>
17 #include <linux/reboot.h>
18 #include <linux/input.h>
19 #include <linux/uaccess.h>
20 #include <linux/proc_fs.h>
21 #include <linux/sysrq.h>
22 #include <linux/sysctl.h>
24 //#define HOOK_POWER_KEY
26 struct trigger_watch_event {
29 bool disable_clk_source;
31 #define TRIGGER_WATCH_EVENT_REPEATED (1 << 31)
32 u64 last_ts; /* last start timestamp */
36 void (*trigger_watch_event_cb)(void *private);
40 void trigger_watch_event_start(struct trigger_watch_event *event, int ms);
41 int trigger_watch_event_stop(struct trigger_watch_event *event);
42 void input_report_key_hook(struct input_dev *dev, unsigned int code, int value);
43 void input_hook_init(void);
44 void input_hook_exit(void);