aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-07-15 17:05:29 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-15 17:50:53 -0400
commited7c9870c9bc6ca50dc0d271a301410bc894f4b9 (patch)
tree06501c64473ffba176cc2746a7ea76e0cbf1afe3 /include/linux/input
parent345ded8ef489a888f6921c999f872848c96b5af8 (diff)
Input: of_touchscreen - add support for inverted / swapped axes
Extend touchscreen_parse_properties() with support for the touchscreen-inverted-x/y and touchscreen-swapped-x-y properties and add touchscreen_set_mt_pos() and touchscreen_report_pos() helper functions for storing coordinates into a input_mt_pos struct, or directly reporting them, taking these properties into account. This commit also modifies the existing callers of touchscreen_parse_properties() to pass in NULL for the new third argument, keeping the existing behavior. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/linux/input')
-rw-r--r--include/linux/input/touchscreen.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/input/touchscreen.h b/include/linux/input/touchscreen.h
index c91e1376132b..09d22ccb9e41 100644
--- a/include/linux/input/touchscreen.h
+++ b/include/linux/input/touchscreen.h
@@ -10,7 +10,26 @@
10#define _TOUCHSCREEN_H 10#define _TOUCHSCREEN_H
11 11
12struct input_dev; 12struct input_dev;
13struct input_mt_pos;
13 14
14void touchscreen_parse_properties(struct input_dev *dev, bool multitouch); 15struct touchscreen_properties {
16 unsigned int max_x;
17 unsigned int max_y;
18 bool invert_x;
19 bool invert_y;
20 bool swap_x_y;
21};
22
23void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
24 struct touchscreen_properties *prop);
25
26void touchscreen_set_mt_pos(struct input_mt_pos *pos,
27 const struct touchscreen_properties *prop,
28 unsigned int x, unsigned int y);
29
30void touchscreen_report_pos(struct input_dev *input,
31 const struct touchscreen_properties *prop,
32 unsigned int x, unsigned int y,
33 bool multitouch);
15 34
16#endif 35#endif