Skip to content

Commit 4f95963

Browse files
committed
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>
1 parent 3a97c3d commit 4f95963

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

‎drivers/input/touchscreen/ad7879.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
590590

591591
input_set_drvdata(input_dev, ts);
592592

593-
__set_bit(EV_ABS, input_dev->evbit);
594-
__set_bit(ABS_X, input_dev->absbit);
595-
__set_bit(ABS_Y, input_dev->absbit);
596-
__set_bit(ABS_PRESSURE, input_dev->absbit);
597-
598-
__set_bit(EV_KEY, input_dev->evbit);
599-
__set_bit(BTN_TOUCH, input_dev->keybit);
593+
input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
600594

601595
if (pdata) {
602596
input_set_abs_params(input_dev, ABS_X,
@@ -614,6 +608,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap,
614608
} else {
615609
input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, 0, 0);
616610
input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, 0, 0);
611+
input_set_capability(input_dev, EV_ABS, ABS_PRESSURE);
617612
touchscreen_parse_properties(input_dev, false, NULL);
618613
if (!input_abs_get_max(input_dev, ABS_PRESSURE)) {
619614
dev_err(dev, "Touchscreen pressure is not specified\n");

0 commit comments

Comments
 (0)