mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Simon Shields <simon@lineageos.org>, Andi Shyti <andi.shyti@samsung.com>
Cc: Rob Herring <robh@kernel.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] Input: mms114 - mark as direct input device
Date: Wed, 24 Jan 2018 11:38:02 -0800	[thread overview]
Message-ID: <20180124193804.155654-3-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20180124193804.155654-1-dmitry.torokhov@gmail.com>

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().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/mms114.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 92f2e9da351f1..c3480db5d21ed 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,
 	input_dev->open = mms114_input_open;
 	input_dev->close = mms114_input_close;
 
-	__set_bit(EV_ABS, input_dev->evbit);
-	__set_bit(EV_KEY, input_dev->evbit);
-	__set_bit(BTN_TOUCH, input_dev->keybit);
-	input_set_abs_params(input_dev, ABS_X, 0, data->pdata->x_size, 0, 0);
-	input_set_abs_params(input_dev, ABS_Y, 0, data->pdata->y_size, 0, 0);
-
-	/* For multi touch */
-	input_mt_init_slots(input_dev, MMS114_MAX_TOUCH, 0);
 	input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
 			     0, MMS114_MAX_AREA, 0, 0);
 	input_set_abs_params(input_dev, ABS_MT_POSITION_X,
@@ -478,6 +470,11 @@ static int mms114_probe(struct i2c_client *client,
 			     0, data->pdata->y_size, 0, 0);
 	input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
 
+	error = input_mt_init_slots(input_dev, MMS114_MAX_TOUCH,
+				    INPUT_MT_DIRECT);
+	if (error)
+		return error;
+
 	input_set_drvdata(input_dev, data);
 	i2c_set_clientdata(client, data);
 
-- 
2.16.0.rc1.238.g530d649a79-goog

  parent reply	other threads:[~2018-01-24 19:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 19:38 [PATCH 0/4] MMS114 touchscreen patches Dmitry Torokhov
2018-01-24 19:38 ` [PATCH 1/4] Input: mms114 - do not clobber interrupt trigger Dmitry Torokhov
2018-01-26  4:54   ` Andi Shyti
2018-01-24 19:38 ` Dmitry Torokhov [this message]
2018-01-26  4:55   ` [PATCH 2/4] Input: mms114 - mark as direct input device Andi Shyti
2018-01-24 19:38 ` [PATCH 3/4] Input: mms114 - drop platform data and use generic APIs Dmitry Torokhov
2018-01-26  5:06   ` Andi Shyti
2018-01-24 19:38 ` [PATCH 4/4] Input: mms114 - add support for mms152 Dmitry Torokhov
2018-01-24 20:04   ` Marcus Folkesson
2018-01-24 21:27     ` Dmitry Torokhov
2018-01-24 21:32     ` [PATCH 4/4 v2] " Dmitry Torokhov
2018-01-26  5:14       ` Andi Shyti
2018-01-26 19:25         ` Dmitry Torokhov
2018-01-25 13:01 ` [PATCH 0/4] MMS114 touchscreen patches Simon Shields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124193804.155654-3-dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=andi.shyti@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=simon@lineageos.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome