]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Input: elants - remove unused axes
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Mon, 18 May 2020 03:38:43 +0000 (20:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 18 May 2020 04:11:33 +0000 (21:11 -0700)
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 <mirq-linux@rere.qmqm.pl>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/d5eee8cd305adb144a11264d70da94f7b6570366.1587923061.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/elants_i2c.c

index 0c4bbd2eb3a2fd6b47711dfda50f7395cd83b45a..3abfa3f7db38e5768aa96ebbe05e298f6047744a 100644 (file)
@@ -1316,25 +1316,7 @@ static int elants_i2c_probe(struct i2c_client *client,
        ts->input->name = "Elan Touchscreen";
        ts->input->id.bustype = BUS_I2C;
 
-       __set_bit(BTN_TOUCH, ts->input->keybit);
-       __set_bit(EV_ABS, ts->input->evbit);
-       __set_bit(EV_KEY, ts->input->evbit);
-
-       /* Single touch input params setup */
-       input_set_abs_params(ts->input, ABS_X, 0, ts->x_max, 0, 0);
-       input_set_abs_params(ts->input, ABS_Y, 0, ts->y_max, 0, 0);
-       input_set_abs_params(ts->input, ABS_PRESSURE, 0, 255, 0, 0);
-       input_abs_set_res(ts->input, ABS_X, ts->x_res);
-       input_abs_set_res(ts->input, ABS_Y, ts->y_res);
-
        /* Multitouch input params setup */
-       error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
-                                   INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
-       if (error) {
-               dev_err(&client->dev,
-                       "failed to initialize MT slots: %d\n", error);
-               return error;
-       }
 
        input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, ts->x_max, 0, 0);
        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,
        input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
        input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
 
+       error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM,
+                                   INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
+       if (error) {
+               dev_err(&client->dev,
+                       "failed to initialize MT slots: %d\n", error);
+               return error;
+       }
+
        error = input_register_device(ts->input);
        if (error) {
                dev_err(&client->dev,