Skip to content

Commit 6def17b

Browse files
osctobedtor
authored andcommitted
Input: elants - remove unused axes
Driver only ever reports MT events and input_mt_init_slots() sets up emulated axes already. Clear the capabilities not generated directly and move MT axes setup, so they are visible by input_mt_init_slots(). Signed-off-by: Michał Mirosław <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Link: https://lore.kernel.org/r/d5eee8cd305adb144a11264d70da94f7b6570366.1587923061.git.mirq-linux@rere.qmqm.pl Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 2969869 commit 6def17b

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

drivers/input/touchscreen/elants_i2c.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,25 +1316,7 @@ static int elants_i2c_probe(struct i2c_client *client,
13161316
ts->input->name = "Elan Touchscreen";
13171317
ts->input->id.bustype = BUS_I2C;
13181318

1319-
__set_bit(BTN_TOUCH, ts->input->keybit);
1320-
__set_bit(EV_ABS, ts->input->evbit);
1321-
__set_bit(EV_KEY, ts->input->evbit);
1322-
1323-
/* Single touch input params setup */
1324-
input_set_abs_params(ts->input, ABS_X, 0, ts->x_max, 0, 0);
1325-
input_set_abs_params(ts->input, ABS_Y, 0, ts->y_max, 0, 0);
1326-
input_set_abs_params(ts->input, ABS_PRESSURE, 0, 255, 0, 0);
1327-
input_abs_set_res(ts->input, ABS_X, ts->x_res);
1328-
input_abs_set_res(ts->input, ABS_Y, ts->y_res);
1329-
13301319
/* Multitouch input params setup */
1331-
error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
1332-
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
1333-
if (error) {
1334-
dev_err(&client->dev,
1335-
"failed to initialize MT slots: %d\n", error);
1336-
return error;
1337-
}
13381320

13391321
input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, ts->x_max, 0, 0);
13401322
input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0);
@@ -1346,6 +1328,14 @@ static int elants_i2c_probe(struct i2c_client *client,
13461328
input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
13471329
input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
13481330

1331+
error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
1332+
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
1333+
if (error) {
1334+
dev_err(&client->dev,
1335+
"failed to initialize MT slots: %d\n", error);
1336+
return error;
1337+
}
1338+
13491339
error = input_register_device(ts->input);
13501340
if (error) {
13511341
dev_err(&client->dev,

0 commit comments

Comments
 (0)