aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);