tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / include / linux / input-hook.h
1 /*
2  * Copyright (C) 2013 Spreadtrum Communications Inc.
3  *
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.
7  *
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.
12  */
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>
23
24 //#define HOOK_POWER_KEY
25
26 struct trigger_watch_event {
27         bool initialized;
28         bool disable_timer;
29         bool disable_clk_source;
30         bool repeated;
31 #define TRIGGER_WATCH_EVENT_REPEATED    (1 << 31)
32         u64 last_ts; /* last start timestamp */
33         char *name;
34         int period; /* ms */
35         struct hrtimer timer;
36         void (*trigger_watch_event_cb)(void *private);
37         void *private;
38 };
39
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);
45 #endif