Commit 4f959635 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 3a97c3d1
...@@ -590,13 +590,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap, ...@@ -590,13 +590,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
input_set_drvdata(input_dev, ts); input_set_drvdata(input_dev, ts);
__set_bit(EV_ABS, input_dev->evbit); input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
__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);
if (pdata) { if (pdata) {
input_set_abs_params(input_dev, ABS_X, input_set_abs_params(input_dev, ABS_X,
...@@ -614,6 +608,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap, ...@@ -614,6 +608,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
} else { } else {
input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, 0, 0); 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_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); touchscreen_parse_properties(input_dev, false, NULL);
if (!input_abs_get_max(input_dev, ABS_PRESSURE)) { if (!input_abs_get_max(input_dev, ABS_PRESSURE)) {
dev_err(dev, "Touchscreen pressure is not specified\n"); dev_err(dev, "Touchscreen pressure is not specified\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment