diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2012-09-15 09:15:58 -0400 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2012-09-19 13:50:17 -0400 |
commit | 8d18fba282120a4a8e4416d1202522ffae8cad58 (patch) | |
tree | 22e3ddabba314c9ad544b9fefe004194205c2940 /include/linux/input | |
parent | 4cbe5a555fa58a79b6ecbb6c531b8bab0650778d (diff) |
Input: Break out MT data
Move all MT-related things to a separate place. This saves some
bytes for non-mt input devices, and prepares for new MT features.
Reviewed-and-tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Ping Cheng <pingc@wacom.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include/linux/input')
-rw-r--r-- | include/linux/input/mt.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index f86737586e19..63458bced77d 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
@@ -23,6 +23,20 @@ struct input_mt_slot { | |||
23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | 23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | /** | ||
27 | * struct input_mt - state of tracked contacts | ||
28 | * @trkid: stores MT tracking ID for the next contact | ||
29 | * @num_slots: number of MT slots the device uses | ||
30 | * @slot: MT slot currently being transmitted | ||
31 | * @slots: array of slots holding current values of tracked contacts | ||
32 | */ | ||
33 | struct input_mt { | ||
34 | int trkid; | ||
35 | int num_slots; | ||
36 | int slot; | ||
37 | struct input_mt_slot slots[]; | ||
38 | }; | ||
39 | |||
26 | static inline void input_mt_set_value(struct input_mt_slot *slot, | 40 | static inline void input_mt_set_value(struct input_mt_slot *slot, |
27 | unsigned code, int value) | 41 | unsigned code, int value) |
28 | { | 42 | { |
@@ -38,9 +52,9 @@ static inline int input_mt_get_value(const struct input_mt_slot *slot, | |||
38 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); | 52 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); |
39 | void input_mt_destroy_slots(struct input_dev *dev); | 53 | void input_mt_destroy_slots(struct input_dev *dev); |
40 | 54 | ||
41 | static inline int input_mt_new_trkid(struct input_dev *dev) | 55 | static inline int input_mt_new_trkid(struct input_mt *mt) |
42 | { | 56 | { |
43 | return dev->trkid++ & TRKID_MAX; | 57 | return mt->trkid++ & TRKID_MAX; |
44 | } | 58 | } |
45 | 59 | ||
46 | static inline void input_mt_slot(struct input_dev *dev, int slot) | 60 | static inline void input_mt_slot(struct input_dev *dev, int slot) |