diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/input.h | 38 | ||||
-rw-r--r-- | include/linux/input/cma3000.h | 59 | ||||
-rw-r--r-- | include/linux/input/mt.h | 57 | ||||
-rw-r--r-- | include/linux/uinput.h | 1 |
4 files changed, 138 insertions, 17 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index f7a6e1966df3..c4e9d91ec979 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -112,6 +112,7 @@ struct input_keymap_entry { | |||
112 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ | 112 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ |
113 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ | 113 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ |
114 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ | 114 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ |
115 | #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) /* get device properties */ | ||
115 | 116 | ||
116 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ | 117 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ |
117 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ | 118 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ |
@@ -129,6 +130,18 @@ struct input_keymap_entry { | |||
129 | #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ | 130 | #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ |
130 | 131 | ||
131 | /* | 132 | /* |
133 | * Device properties and quirks | ||
134 | */ | ||
135 | |||
136 | #define INPUT_PROP_POINTER 0x00 /* needs a pointer */ | ||
137 | #define INPUT_PROP_DIRECT 0x01 /* direct input devices */ | ||
138 | #define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ | ||
139 | #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ | ||
140 | |||
141 | #define INPUT_PROP_MAX 0x1f | ||
142 | #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) | ||
143 | |||
144 | /* | ||
132 | * Event types | 145 | * Event types |
133 | */ | 146 | */ |
134 | 147 | ||
@@ -760,11 +773,12 @@ struct input_keymap_entry { | |||
760 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 773 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
761 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 774 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
762 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | 775 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ |
776 | #define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ | ||
763 | 777 | ||
764 | #ifdef __KERNEL__ | 778 | #ifdef __KERNEL__ |
765 | /* Implementation details, userspace should not care about these */ | 779 | /* Implementation details, userspace should not care about these */ |
766 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR | 780 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR |
767 | #define ABS_MT_LAST ABS_MT_PRESSURE | 781 | #define ABS_MT_LAST ABS_MT_DISTANCE |
768 | #endif | 782 | #endif |
769 | 783 | ||
770 | #define ABS_MAX 0x3f | 784 | #define ABS_MAX 0x3f |
@@ -875,6 +889,7 @@ struct input_keymap_entry { | |||
875 | */ | 889 | */ |
876 | #define MT_TOOL_FINGER 0 | 890 | #define MT_TOOL_FINGER 0 |
877 | #define MT_TOOL_PEN 1 | 891 | #define MT_TOOL_PEN 1 |
892 | #define MT_TOOL_MAX 1 | ||
878 | 893 | ||
879 | /* | 894 | /* |
880 | * Values describing the status of a force-feedback effect | 895 | * Values describing the status of a force-feedback effect |
@@ -1110,19 +1125,12 @@ struct ff_effect { | |||
1110 | #include <linux/mod_devicetable.h> | 1125 | #include <linux/mod_devicetable.h> |
1111 | 1126 | ||
1112 | /** | 1127 | /** |
1113 | * struct input_mt_slot - represents the state of an input MT slot | ||
1114 | * @abs: holds current values of ABS_MT axes for this slot | ||
1115 | */ | ||
1116 | struct input_mt_slot { | ||
1117 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
1118 | }; | ||
1119 | |||
1120 | /** | ||
1121 | * struct input_dev - represents an input device | 1128 | * struct input_dev - represents an input device |
1122 | * @name: name of the device | 1129 | * @name: name of the device |
1123 | * @phys: physical path to the device in the system hierarchy | 1130 | * @phys: physical path to the device in the system hierarchy |
1124 | * @uniq: unique identification code for the device (if device has it) | 1131 | * @uniq: unique identification code for the device (if device has it) |
1125 | * @id: id of the device (struct input_id) | 1132 | * @id: id of the device (struct input_id) |
1133 | * @propbit: bitmap of device properties and quirks | ||
1126 | * @evbit: bitmap of types of events supported by the device (EV_KEY, | 1134 | * @evbit: bitmap of types of events supported by the device (EV_KEY, |
1127 | * EV_REL, etc.) | 1135 | * EV_REL, etc.) |
1128 | * @keybit: bitmap of keys/buttons this device has | 1136 | * @keybit: bitmap of keys/buttons this device has |
@@ -1157,6 +1165,7 @@ struct input_mt_slot { | |||
1157 | * of tracked contacts | 1165 | * of tracked contacts |
1158 | * @mtsize: number of MT slots the device uses | 1166 | * @mtsize: number of MT slots the device uses |
1159 | * @slot: MT slot currently being transmitted | 1167 | * @slot: MT slot currently being transmitted |
1168 | * @trkid: stores MT tracking ID for the current contact | ||
1160 | * @absinfo: array of &struct input_absinfo elements holding information | 1169 | * @absinfo: array of &struct input_absinfo elements holding information |
1161 | * about absolute axes (current value, min, max, flat, fuzz, | 1170 | * about absolute axes (current value, min, max, flat, fuzz, |
1162 | * resolution) | 1171 | * resolution) |
@@ -1205,6 +1214,8 @@ struct input_dev { | |||
1205 | const char *uniq; | 1214 | const char *uniq; |
1206 | struct input_id id; | 1215 | struct input_id id; |
1207 | 1216 | ||
1217 | unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)]; | ||
1218 | |||
1208 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; | 1219 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; |
1209 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; | 1220 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; |
1210 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; | 1221 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; |
@@ -1241,6 +1252,7 @@ struct input_dev { | |||
1241 | struct input_mt_slot *mt; | 1252 | struct input_mt_slot *mt; |
1242 | int mtsize; | 1253 | int mtsize; |
1243 | int slot; | 1254 | int slot; |
1255 | int trkid; | ||
1244 | 1256 | ||
1245 | struct input_absinfo *absinfo; | 1257 | struct input_absinfo *absinfo; |
1246 | 1258 | ||
@@ -1490,11 +1502,6 @@ static inline void input_mt_sync(struct input_dev *dev) | |||
1490 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); | 1502 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); |
1491 | } | 1503 | } |
1492 | 1504 | ||
1493 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
1494 | { | ||
1495 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
1496 | } | ||
1497 | |||
1498 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); | 1505 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); |
1499 | 1506 | ||
1500 | /** | 1507 | /** |
@@ -1607,8 +1614,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | |||
1607 | int input_ff_create_memless(struct input_dev *dev, void *data, | 1614 | int input_ff_create_memless(struct input_dev *dev, void *data, |
1608 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | 1615 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); |
1609 | 1616 | ||
1610 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots); | ||
1611 | void input_mt_destroy_slots(struct input_dev *dev); | ||
1612 | |||
1613 | #endif | 1617 | #endif |
1614 | #endif | 1618 | #endif |
diff --git a/include/linux/input/cma3000.h b/include/linux/input/cma3000.h new file mode 100644 index 000000000000..cbbaac27d311 --- /dev/null +++ b/include/linux/input/cma3000.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * VTI CMA3000_Dxx Accelerometer driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * Author: Hemanth V <hemanthv@ti.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef _LINUX_CMA3000_H | ||
21 | #define _LINUX_CMA3000_H | ||
22 | |||
23 | #define CMAMODE_DEFAULT 0 | ||
24 | #define CMAMODE_MEAS100 1 | ||
25 | #define CMAMODE_MEAS400 2 | ||
26 | #define CMAMODE_MEAS40 3 | ||
27 | #define CMAMODE_MOTDET 4 | ||
28 | #define CMAMODE_FF100 5 | ||
29 | #define CMAMODE_FF400 6 | ||
30 | #define CMAMODE_POFF 7 | ||
31 | |||
32 | #define CMARANGE_2G 2000 | ||
33 | #define CMARANGE_8G 8000 | ||
34 | |||
35 | /** | ||
36 | * struct cma3000_i2c_platform_data - CMA3000 Platform data | ||
37 | * @fuzz_x: Noise on X Axis | ||
38 | * @fuzz_y: Noise on Y Axis | ||
39 | * @fuzz_z: Noise on Z Axis | ||
40 | * @g_range: G range in milli g i.e 2000 or 8000 | ||
41 | * @mode: Operating mode | ||
42 | * @mdthr: Motion detect threshold value | ||
43 | * @mdfftmr: Motion detect and free fall time value | ||
44 | * @ffthr: Free fall threshold value | ||
45 | */ | ||
46 | |||
47 | struct cma3000_platform_data { | ||
48 | int fuzz_x; | ||
49 | int fuzz_y; | ||
50 | int fuzz_z; | ||
51 | int g_range; | ||
52 | uint8_t mode; | ||
53 | uint8_t mdthr; | ||
54 | uint8_t mdfftmr; | ||
55 | uint8_t ffthr; | ||
56 | unsigned long irqflags; | ||
57 | }; | ||
58 | |||
59 | #endif | ||
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h new file mode 100644 index 000000000000..b3ac06a4435d --- /dev/null +++ b/include/linux/input/mt.h | |||
@@ -0,0 +1,57 @@ | |||
1 | #ifndef _INPUT_MT_H | ||
2 | #define _INPUT_MT_H | ||
3 | |||
4 | /* | ||
5 | * Input Multitouch Library | ||
6 | * | ||
7 | * Copyright (c) 2010 Henrik Rydberg | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published by | ||
11 | * the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/input.h> | ||
15 | |||
16 | #define TRKID_MAX 0xffff | ||
17 | |||
18 | /** | ||
19 | * struct input_mt_slot - represents the state of an input MT slot | ||
20 | * @abs: holds current values of ABS_MT axes for this slot | ||
21 | */ | ||
22 | struct input_mt_slot { | ||
23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
24 | }; | ||
25 | |||
26 | static inline void input_mt_set_value(struct input_mt_slot *slot, | ||
27 | unsigned code, int value) | ||
28 | { | ||
29 | slot->abs[code - ABS_MT_FIRST] = value; | ||
30 | } | ||
31 | |||
32 | static inline int input_mt_get_value(const struct input_mt_slot *slot, | ||
33 | unsigned code) | ||
34 | { | ||
35 | return slot->abs[code - ABS_MT_FIRST]; | ||
36 | } | ||
37 | |||
38 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); | ||
39 | void input_mt_destroy_slots(struct input_dev *dev); | ||
40 | |||
41 | static inline int input_mt_new_trkid(struct input_dev *dev) | ||
42 | { | ||
43 | return dev->trkid++ & TRKID_MAX; | ||
44 | } | ||
45 | |||
46 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
47 | { | ||
48 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
49 | } | ||
50 | |||
51 | void input_mt_report_slot_state(struct input_dev *dev, | ||
52 | unsigned int tool_type, bool active); | ||
53 | |||
54 | void input_mt_report_finger_count(struct input_dev *dev, int count); | ||
55 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); | ||
56 | |||
57 | #endif | ||
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 05f7fed2b173..d28c726ede4f 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -104,6 +104,7 @@ struct uinput_ff_erase { | |||
104 | #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) | 104 | #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) |
105 | #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) | 105 | #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) |
106 | #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) | 106 | #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) |
107 | #define UI_SET_PROPBIT _IOW(UINPUT_IOCTL_BASE, 110, int) | ||
107 | 108 | ||
108 | #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) | 109 | #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) |
109 | #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) | 110 | #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) |