diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-15 19:40:34 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:28:08 +0200 |
| commit | 4583da1ad81b59b2a8cd2ae51c32b1bc8d32f1c4 (patch) | |
| tree | 5041c40ec1d899aa135a3030413b919b2dad0384 /include | |
| parent | ff88de5cd38b5b51bad0e63d373d66745f1f8d31 (diff) | |
refactor: Generate code for ABS_MT mapping
Use the kernel-provided list MT_SLOT_ABS_EVENTS to generate
code mappings between ABS_MT space and MT space. This patch
adds the program mapgen that does the mapping, and adds two
include files generated with it.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include')
| -rw-r--r-- | include/abs2mt.h | 39 | ||||
| -rw-r--r-- | include/mtbit.h | 14 |
2 files changed, 53 insertions, 0 deletions
diff --git a/include/abs2mt.h b/include/abs2mt.h new file mode 100644 index 0000000..6021d8d --- /dev/null +++ b/include/abs2mt.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* generated by mapgen - do not edit */ | ||
| 2 | |||
| 3 | #ifndef ABS2MT_H | ||
| 4 | #define ABS2MT_H | ||
| 5 | |||
| 6 | #include "common.h" | ||
| 7 | |||
| 8 | static const unsigned int map_abs2mt[ABS_CNT] = { | ||
| 9 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 10 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 11 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 12 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 13 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 14 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 15 | 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, | ||
| 16 | 0x0009, 0x000a, 0x000b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
| 17 | }; | ||
| 18 | |||
| 19 | static const unsigned int map_mt2abs[MT_ABS_SIZE] = { | ||
| 20 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, | ||
| 21 | 0x0038, 0x0039, 0x003a, | ||
| 22 | }; | ||
| 23 | |||
| 24 | static inline int has_abs2mt(unsigned int code) | ||
| 25 | { | ||
| 26 | return map_abs2mt[code]; | ||
| 27 | } | ||
| 28 | |||
| 29 | static inline unsigned int abs2mt(unsigned int code) | ||
| 30 | { | ||
| 31 | return map_abs2mt[code] - 1; | ||
| 32 | } | ||
| 33 | |||
| 34 | static inline unsigned int mt2abs(unsigned int mtcode) | ||
| 35 | { | ||
| 36 | return map_mt2abs[mtcode]; | ||
| 37 | } | ||
| 38 | |||
| 39 | #endif | ||
diff --git a/include/mtbit.h b/include/mtbit.h new file mode 100644 index 0000000..2c4dacb --- /dev/null +++ b/include/mtbit.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | /* generated by mapgen - do not edit */ | ||
| 2 | |||
| 3 | #ifndef MTBIT_H | ||
| 4 | #define MTBIT_H | ||
| 5 | |||
| 6 | #define BIT_TRACKING_ID 9 | ||
| 7 | #define BIT_POSITION_X 5 | ||
| 8 | #define BIT_POSITION_Y 6 | ||
| 9 | #define BIT_TOUCH_MAJOR 0 | ||
| 10 | #define BIT_TOUCH_MINOR 1 | ||
| 11 | #define BIT_WIDTH_MAJOR 2 | ||
| 12 | #define BIT_WIDTH_MINOR 3 | ||
| 13 | |||
| 14 | #endif | ||
