diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-01-07 01:34:59 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-01-07 01:34:59 -0500 |
commit | 554738da71004d96e06fb75f4772dfc3b0f47810 (patch) | |
tree | 149a96ce3727025d3b9260961ec94ba8306db278 /include | |
parent | 7b4b30689d688d9ca2e5c3859db6bbe1c35e6014 (diff) | |
parent | a6d38f889750ed6290728a19d9dad577b147c6d0 (diff) |
Merge branch 'next' into for-linus
Conflicts:
include/linux/input.h
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 9777668883be..84d4ce0d983a 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 | ||
@@ -758,11 +771,12 @@ struct input_keymap_entry { | |||
758 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 771 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
759 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 772 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
760 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | 773 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ |
774 | #define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ | ||
761 | 775 | ||
762 | #ifdef __KERNEL__ | 776 | #ifdef __KERNEL__ |
763 | /* Implementation details, userspace should not care about these */ | 777 | /* Implementation details, userspace should not care about these */ |
764 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR | 778 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR |
765 | #define ABS_MT_LAST ABS_MT_PRESSURE | 779 | #define ABS_MT_LAST ABS_MT_DISTANCE |
766 | #endif | 780 | #endif |
767 | 781 | ||
768 | #define ABS_MAX 0x3f | 782 | #define ABS_MAX 0x3f |
@@ -873,6 +887,7 @@ struct input_keymap_entry { | |||
873 | */ | 887 | */ |
874 | #define MT_TOOL_FINGER 0 | 888 | #define MT_TOOL_FINGER 0 |
875 | #define MT_TOOL_PEN 1 | 889 | #define MT_TOOL_PEN 1 |
890 | #define MT_TOOL_MAX 1 | ||
876 | 891 | ||
877 | /* | 892 | /* |
878 | * Values describing the status of a force-feedback effect | 893 | * Values describing the status of a force-feedback effect |
@@ -1108,19 +1123,12 @@ struct ff_effect { | |||
1108 | #include <linux/mod_devicetable.h> | 1123 | #include <linux/mod_devicetable.h> |
1109 | 1124 | ||
1110 | /** | 1125 | /** |
1111 | * struct input_mt_slot - represents the state of an input MT slot | ||
1112 | * @abs: holds current values of ABS_MT axes for this slot | ||
1113 | */ | ||
1114 | struct input_mt_slot { | ||
1115 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
1116 | }; | ||
1117 | |||
1118 | /** | ||
1119 | * struct input_dev - represents an input device | 1126 | * struct input_dev - represents an input device |
1120 | * @name: name of the device | 1127 | * @name: name of the device |
1121 | * @phys: physical path to the device in the system hierarchy | 1128 | * @phys: physical path to the device in the system hierarchy |
1122 | * @uniq: unique identification code for the device (if device has it) | 1129 | * @uniq: unique identification code for the device (if device has it) |
1123 | * @id: id of the device (struct input_id) | 1130 | * @id: id of the device (struct input_id) |
1131 | * @propbit: bitmap of device properties and quirks | ||
1124 | * @evbit: bitmap of types of events supported by the device (EV_KEY, | 1132 | * @evbit: bitmap of types of events supported by the device (EV_KEY, |
1125 | * EV_REL, etc.) | 1133 | * EV_REL, etc.) |
1126 | * @keybit: bitmap of keys/buttons this device has | 1134 | * @keybit: bitmap of keys/buttons this device has |
@@ -1155,6 +1163,7 @@ struct input_mt_slot { | |||
1155 | * of tracked contacts | 1163 | * of tracked contacts |
1156 | * @mtsize: number of MT slots the device uses | 1164 | * @mtsize: number of MT slots the device uses |
1157 | * @slot: MT slot currently being transmitted | 1165 | * @slot: MT slot currently being transmitted |
1166 | * @trkid: stores MT tracking ID for the current contact | ||
1158 | * @absinfo: array of &struct input_absinfo elements holding information | 1167 | * @absinfo: array of &struct input_absinfo elements holding information |
1159 | * about absolute axes (current value, min, max, flat, fuzz, | 1168 | * about absolute axes (current value, min, max, flat, fuzz, |
1160 | * resolution) | 1169 | * resolution) |
@@ -1203,6 +1212,8 @@ struct input_dev { | |||
1203 | const char *uniq; | 1212 | const char *uniq; |
1204 | struct input_id id; | 1213 | struct input_id id; |
1205 | 1214 | ||
1215 | unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)]; | ||
1216 | |||
1206 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; | 1217 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; |
1207 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; | 1218 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; |
1208 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; | 1219 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; |
@@ -1239,6 +1250,7 @@ struct input_dev { | |||
1239 | struct input_mt_slot *mt; | 1250 | struct input_mt_slot *mt; |
1240 | int mtsize; | 1251 | int mtsize; |
1241 | int slot; | 1252 | int slot; |
1253 | int trkid; | ||
1242 | 1254 | ||
1243 | struct input_absinfo *absinfo; | 1255 | struct input_absinfo *absinfo; |
1244 | 1256 | ||
@@ -1488,11 +1500,6 @@ static inline void input_mt_sync(struct input_dev *dev) | |||
1488 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); | 1500 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); |
1489 | } | 1501 | } |
1490 | 1502 | ||
1491 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
1492 | { | ||
1493 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
1494 | } | ||
1495 | |||
1496 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); | 1503 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); |
1497 | 1504 | ||
1498 | /** | 1505 | /** |
@@ -1605,8 +1612,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | |||
1605 | int input_ff_create_memless(struct input_dev *dev, void *data, | 1612 | int input_ff_create_memless(struct input_dev *dev, void *data, |
1606 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | 1613 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); |
1607 | 1614 | ||
1608 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots); | ||
1609 | void input_mt_destroy_slots(struct input_dev *dev); | ||
1610 | |||
1611 | #endif | 1615 | #endif |
1612 | #endif | 1616 | #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) |