summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ad7879.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-02-28 20:56:20 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-01 18:42:45 +0100
commit4f95963558d4ed0019938b5410a3402700a1bc4c (patch)
tree5fe625d8dcbe63b9501a78872f9c2028840cc755 /drivers/input/touchscreen/ad7879.c
parentInput: ad7879 - try parsing properties on non-DT systems (diff)
downloadlinux-4f95963558d4ed0019938b5410a3402700a1bc4c.tar.xz
linux-4f95963558d4ed0019938b5410a3402700a1bc4c.zip
Input: ad7879 - do not manipulate capability bits directly
Instead of manipulating capabilities bits of input device directly, let's use input_set_capability() API. Also, stop setting ABS_X/Y bits explicitly as input_set_abs_params() does this for us. Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/ad7879.c')
-rw-r--r--drivers/input/touchscreen/ad7879.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index c415614ada68..196028c45210 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -590,13 +590,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
input_set_drvdata(input_dev, ts);
- __set_bit(EV_ABS, input_dev->evbit);
- __set_bit(ABS_X, input_dev->absbit);
- __set_bit(ABS_Y, input_dev->absbit);
- __set_bit(ABS_PRESSURE, input_dev->absbit);
-
- __set_bit(EV_KEY, input_dev->evbit);
- __set_bit(BTN_TOUCH, input_dev->keybit);
+ input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
if (pdata) {
input_set_abs_params(input_dev, ABS_X,
@@ -614,6 +608,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
} else {
input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, 0, 0);
input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, 0, 0);
+ input_set_capability(input_dev, EV_ABS, ABS_PRESSURE);
touchscreen_parse_properties(input_dev, false, NULL);
if (!input_abs_get_max(input_dev, ABS_PRESSURE)) {
dev_err(dev, "Touchscreen pressure is not specified\n");