aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2015-03-21 23:17:57 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-03-24 15:00:40 -0400
commit0a363a380954e10fece7cd9931b66056eeb07d56 (patch)
tree6df78a4102996226ff88a68c5b3dc94506f0571d /drivers/input
parent3eea8b5d68c801fec788b411582b803463834752 (diff)
Input: of_touchscreen - register multitouch axes
So far, the DT parsing code was only setting up the regular input axes, completely ignoring their multitouch counter parts. Fill them with the same parameters than the regular axes. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/of_touchscreen.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
index fe80d8ba7efa..b82b5207c78b 100644
--- a/drivers/input/touchscreen/of_touchscreen.c
+++ b/drivers/input/touchscreen/of_touchscreen.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/of.h> 12#include <linux/of.h>
13#include <linux/input.h> 13#include <linux/input.h>
14#include <linux/input/mt.h>
14#include <linux/input/touchscreen.h> 15#include <linux/input/touchscreen.h>
15 16
16static u32 of_get_optional_u32(struct device_node *np, 17static u32 of_get_optional_u32(struct device_node *np,
@@ -30,8 +31,13 @@ static void touchscreen_set_params(struct input_dev *dev,
30 struct input_absinfo *absinfo; 31 struct input_absinfo *absinfo;
31 32
32 if (!test_bit(axis, dev->absbit)) { 33 if (!test_bit(axis, dev->absbit)) {
33 dev_warn(&dev->dev, 34 /*
34 "DT specifies parameters but the axis is not set up\n"); 35 * Emit a warning only if the axis is not a multitouch
36 * axis, which might not be set by the driver.
37 */
38 if (!input_is_mt_axis(axis))
39 dev_warn(&dev->dev,
40 "DT specifies parameters but the axis is not set up\n");
35 return; 41 return;
36 } 42 }
37 43
@@ -59,17 +65,23 @@ void touchscreen_parse_of_params(struct input_dev *dev)
59 65
60 maximum = of_get_optional_u32(np, "touchscreen-size-x"); 66 maximum = of_get_optional_u32(np, "touchscreen-size-x");
61 fuzz = of_get_optional_u32(np, "touchscreen-fuzz-x"); 67 fuzz = of_get_optional_u32(np, "touchscreen-fuzz-x");
62 if (maximum || fuzz) 68 if (maximum || fuzz) {
63 touchscreen_set_params(dev, ABS_X, maximum, fuzz); 69 touchscreen_set_params(dev, ABS_X, maximum, fuzz);
70 touchscreen_set_params(dev, ABS_MT_POSITION_X, maximum, fuzz);
71 }
64 72
65 maximum = of_get_optional_u32(np, "touchscreen-size-y"); 73 maximum = of_get_optional_u32(np, "touchscreen-size-y");
66 fuzz = of_get_optional_u32(np, "touchscreen-fuzz-y"); 74 fuzz = of_get_optional_u32(np, "touchscreen-fuzz-y");
67 if (maximum || fuzz) 75 if (maximum || fuzz) {
68 touchscreen_set_params(dev, ABS_Y, maximum, fuzz); 76 touchscreen_set_params(dev, ABS_Y, maximum, fuzz);
77 touchscreen_set_params(dev, ABS_MT_POSITION_Y, maximum, fuzz);
78 }
69 79
70 maximum = of_get_optional_u32(np, "touchscreen-max-pressure"); 80 maximum = of_get_optional_u32(np, "touchscreen-max-pressure");
71 fuzz = of_get_optional_u32(np, "touchscreen-fuzz-pressure"); 81 fuzz = of_get_optional_u32(np, "touchscreen-fuzz-pressure");
72 if (maximum || fuzz) 82 if (maximum || fuzz) {
73 touchscreen_set_params(dev, ABS_PRESSURE, maximum, fuzz); 83 touchscreen_set_params(dev, ABS_PRESSURE, maximum, fuzz);
84 touchscreen_set_params(dev, ABS_MT_PRESSURE, maximum, fuzz);
85 }
74} 86}
75EXPORT_SYMBOL(touchscreen_parse_of_params); 87EXPORT_SYMBOL(touchscreen_parse_of_params);