All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriele Mazzotta <gabriele.mzt@gmail.com>
To: dmitry.torokhov@gmail.com, rydberg@euromail.se
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	silverhammermba@gmail.com,
	Gabriele Mazzotta <gabriele.mzt@gmail.com>
Subject: [PATCH 1/2] input: synaptics - make image sensors report ABS_MT_TOUCH_MAJOR
Date: Sat, 27 Dec 2014 12:31:28 +0100	[thread overview]
Message-ID: <1419679889-6582-2-git-send-email-gabriele.mzt@gmail.com> (raw)
In-Reply-To: <1419679889-6582-1-git-send-email-gabriele.mzt@gmail.com>

Despite claiming to be able to report ABS_TOOL_WIDTH, image sensors
were not doing it. Make them report widths and use ABS_MT_TOUCH_MAJOR
instead ABS_TOOL_WIDTH.

Since the 'w' slot is used to report the finger count when two or more
fingers are on the touchpad, make sure that only meaningful values are
emitted, i.e. values greater than or equal to 4, and assign the correct
range to ABS_MT_TOUCH_MAJOR.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=77161
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
 drivers/input/mouse/synaptics.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index f947292..ea0563e 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -814,6 +814,8 @@ static void synaptics_report_slot(struct input_dev *dev, int slot,
 	input_report_abs(dev, ABS_MT_POSITION_X, hw->x);
 	input_report_abs(dev, ABS_MT_POSITION_Y, synaptics_invert_y(hw->y));
 	input_report_abs(dev, ABS_MT_PRESSURE, hw->z);
+	if (hw->w >= 4)
+		input_report_abs(dev, ABS_MT_TOUCH_MAJOR, hw->w);
 }
 
 static void synaptics_report_mt_data(struct psmouse *psmouse,
@@ -1462,8 +1464,13 @@ static void set_input_params(struct psmouse *psmouse,
 					INPUT_MT_TRACK : INPUT_MT_SEMI_MT));
 	}
 
-	if (SYN_CAP_PALMDETECT(priv->capabilities))
-		input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
+	if (SYN_CAP_PALMDETECT(priv->capabilities)) {
+		if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c))
+			input_set_abs_params(dev,
+					     ABS_MT_TOUCH_MAJOR, 4, 15, 0, 0);
+		else
+			input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
+	}
 
 	__set_bit(BTN_TOUCH, dev->keybit);
 	__set_bit(BTN_TOOL_FINGER, dev->keybit);
-- 
2.1.4


  reply	other threads:[~2014-12-27 11:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-27 11:31 [PATCH 0/2] input: synaptics - make image sensors report finger widths Gabriele Mazzotta
2014-12-27 11:31 ` Gabriele Mazzotta [this message]
2015-01-05 19:24   ` [PATCH 1/2] input: synaptics - make image sensors report ABS_MT_TOUCH_MAJOR Benjamin Tissoires
2015-01-05 20:13     ` Gabriele Mazzotta
2015-01-05 20:18       ` Gabriele Mazzotta
2015-01-05 22:00     ` Gabriele Mazzotta
2015-01-05 22:04       ` Benjamin Tissoires
2015-01-07  6:10         ` Peter Hutterer
2015-01-07  7:49         ` Dmitry Torokhov
2015-01-07  6:02     ` Peter Hutterer
2014-12-27 11:31 ` [PATCH 2/2] input: synaptics - fix width calculation on image sensors Gabriele Mazzotta
2015-01-05 18:25   ` Benjamin Tissoires
2015-01-05 18:37     ` Gabriele Mazzotta
2015-01-05 18:42       ` Benjamin Tissoires
2015-01-05 19:04         ` Dmitry Torokhov
2015-01-05 19:07           ` Benjamin Tissoires
2015-01-05 19:15           ` Gabriele Mazzotta
2015-01-05 19:26             ` Benjamin Tissoires

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=1419679889-6582-2-git-send-email-gabriele.mzt@gmail.com \
    --to=gabriele.mzt@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@euromail.se \
    --cc=silverhammermba@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.