diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-01-23 14:11:09 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-01-26 14:27:18 -0500 |
commit | 477baf7e9a45538f984216acba371b8bd190d4f3 (patch) | |
tree | bf5b6e00a46bc734e2a9ecd572b56e96dbbcd362 | |
parent | 5e703b883468f9e5c88bde82a2e5b34a89fefa96 (diff) |
Input: mms114 - mark as direct input device
mms14 is a touchscreen and thus a direct input device; let's mark it
as such. This also allows us to drop some initialization code as
input_init_mt_slots() will do that for us.
Also add error handling for input_mt_init_slots().
Reviewed-by: Simon Shields <simon@lineageos.org>
Tested-by: Simon Shields <simon@lineageos.org>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Tested-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/mms114.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 92f2e9da351f..c3480db5d21e 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c | |||
@@ -462,14 +462,6 @@ static int mms114_probe(struct i2c_client *client, | |||
462 | input_dev->open = mms114_input_open; | 462 | input_dev->open = mms114_input_open; |
463 | input_dev->close = mms114_input_close; | 463 | input_dev->close = mms114_input_close; |
464 | 464 | ||
465 | __set_bit(EV_ABS, input_dev->evbit); | ||
466 | __set_bit(EV_KEY, input_dev->evbit); | ||
467 | __set_bit(BTN_TOUCH, input_dev->keybit); | ||
468 | input_set_abs_params(input_dev, ABS_X, 0, data->pdata->x_size, 0, 0); | ||
469 | input_set_abs_params(input_dev, ABS_Y, 0, data->pdata->y_size, 0, 0); | ||
470 | |||
471 | /* For multi touch */ | ||
472 | input_mt_init_slots(input_dev, MMS114_MAX_TOUCH, 0); | ||
473 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | 465 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, |
474 | 0, MMS114_MAX_AREA, 0, 0); | 466 | 0, MMS114_MAX_AREA, 0, 0); |
475 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | 467 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
@@ -478,6 +470,11 @@ static int mms114_probe(struct i2c_client *client, | |||
478 | 0, data->pdata->y_size, 0, 0); | 470 | 0, data->pdata->y_size, 0, 0); |
479 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0); | 471 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0); |
480 | 472 | ||
473 | error = input_mt_init_slots(input_dev, MMS114_MAX_TOUCH, | ||
474 | INPUT_MT_DIRECT); | ||
475 | if (error) | ||
476 | return error; | ||
477 | |||
481 | input_set_drvdata(input_dev, data); | 478 | input_set_drvdata(input_dev, data); |
482 | i2c_set_clientdata(client, data); | 479 | i2c_set_clientdata(client, data); |
483 | 480 | ||