* [PATCH v4 0/4] input: synaptics - report correct width and pressure values
@ 2016-04-01 13:06 Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 1/4] input: synaptics - fix pressure values calculation on image sensors Gabriele Mazzotta
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Gabriele Mazzotta @ 2016-04-01 13:06 UTC (permalink / raw)
To: dmitry.torokhov, benjamin.tissoires
Cc: linux-input, linux-kernel, rydberg, silverhammermba,
peter.hutterer, hdegoede, grafi, oneukum, Gabriele Mazzotta
The problem of the previous set, v3, was the use of ABS_MT_TOUCH_MAJOR
to report finger widths without them being expressed in surface units.
In this set only the width of the first touch is reported, this time
using ABS_TOOL_WIDTH.
Gabriele Mazzotta (4):
input: synaptics - fix pressure values calculation on image sensors
input: synaptics - fix width values calculation on image sensors
input: synaptics - change default width value of cr48 sensors
input: synaptics - make image sensors and cr48 sensors report widths
drivers/input/mouse/synaptics.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
--
2.8.0.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 1/4] input: synaptics - fix pressure values calculation on image sensors
2016-04-01 13:06 [PATCH v4 0/4] input: synaptics - report correct width and pressure values Gabriele Mazzotta
@ 2016-04-01 13:06 ` Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 2/4] input: synaptics - fix width " Gabriele Mazzotta
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Gabriele Mazzotta @ 2016-04-01 13:06 UTC (permalink / raw)
To: dmitry.torokhov, benjamin.tissoires
Cc: linux-input, linux-kernel, rydberg, silverhammermba,
peter.hutterer, hdegoede, grafi, oneukum, Gabriele Mazzotta
The pressure values retrieved from secondary packets was incorrectly
shifted, making them lower than what they actually were.
Since this only happened with secondary packets, the values reported
when only one finger was present on the touchpad were correct.
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
drivers/input/mouse/synaptics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index a41d832..01fccca 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -677,7 +677,7 @@ static void synaptics_parse_agm(const unsigned char buf[],
agm->w = hw->w;
agm->x = (((buf[4] & 0x0f) << 8) | buf[1]) << 1;
agm->y = (((buf[4] & 0xf0) << 4) | buf[2]) << 1;
- agm->z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 1;
+ agm->z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 2;
break;
case 2:
--
2.8.0.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 2/4] input: synaptics - fix width values calculation on image sensors
2016-04-01 13:06 [PATCH v4 0/4] input: synaptics - report correct width and pressure values Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 1/4] input: synaptics - fix pressure values calculation on image sensors Gabriele Mazzotta
@ 2016-04-01 13:06 ` Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 3/4] input: synaptics - change default width value of cr48 sensors Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 4/4] input: synaptics - make image sensors and cr48 sensors report widths Gabriele Mazzotta
3 siblings, 0 replies; 5+ messages in thread
From: Gabriele Mazzotta @ 2016-04-01 13:06 UTC (permalink / raw)
To: dmitry.torokhov, benjamin.tissoires
Cc: linux-input, linux-kernel, rydberg, silverhammermba,
peter.hutterer, hdegoede, grafi, oneukum, Gabriele Mazzotta
When multiple fingers are on the touchpad, W reports the finger
count rather than the width. Retrieve the correct value that is
encoded in X, Y and Z of AGM and SGM packets.
The minimum width reported is 8 rather than 4 in this case, while the
maximum remains 15.
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
drivers/input/mouse/synaptics.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 01fccca..ba321e7 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -674,10 +674,12 @@ static void synaptics_parse_agm(const unsigned char buf[],
switch (agm_packet_type) {
case 1:
/* Gesture packet: (x, y, z) half resolution */
- agm->w = hw->w;
- agm->x = (((buf[4] & 0x0f) << 8) | buf[1]) << 1;
- agm->y = (((buf[4] & 0xf0) << 4) | buf[2]) << 1;
- agm->z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 2;
+ agm->w = ((buf[1] & 0x01) |
+ ((buf[2] & 0x01) << 1) |
+ ((buf[5] & 0x01) << 2)) + 8;
+ agm->x = (((buf[4] & 0x0f) << 8) | (buf[1] & 0xfe)) << 1;
+ agm->y = (((buf[4] & 0xf0) << 4) | (buf[2] & 0xfe)) << 1;
+ agm->z = ((buf[3] & 0x30) | (buf[5] & 0x0e)) << 2;
break;
case 2:
@@ -974,6 +976,17 @@ static void synaptics_image_sensor_process(struct psmouse *psmouse,
else
num_fingers = 4;
+ /* When multiple fingers are on the TouchPad, the width is encoded in
+ * X, Y and Z */
+ if (sgm->w == 0 || sgm->w == 1) {
+ sgm->w = (((sgm->x & BIT(1)) >> 1) |
+ (sgm->y & BIT(1)) |
+ ((sgm->z & BIT(0)) << 2)) + 8;
+ sgm->x &= ~BIT(1);
+ sgm->y &= ~BIT(1);
+ sgm->z &= ~BIT(0);
+ }
+
/* Send resulting input events to user space */
synaptics_report_mt_data(psmouse, sgm, num_fingers);
}
--
2.8.0.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 3/4] input: synaptics - change default width value of cr48 sensors
2016-04-01 13:06 [PATCH v4 0/4] input: synaptics - report correct width and pressure values Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 1/4] input: synaptics - fix pressure values calculation on image sensors Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 2/4] input: synaptics - fix width " Gabriele Mazzotta
@ 2016-04-01 13:06 ` Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 4/4] input: synaptics - make image sensors and cr48 sensors report widths Gabriele Mazzotta
3 siblings, 0 replies; 5+ messages in thread
From: Gabriele Mazzotta @ 2016-04-01 13:06 UTC (permalink / raw)
To: dmitry.torokhov, benjamin.tissoires
Cc: linux-input, linux-kernel, rydberg, silverhammermba,
peter.hutterer, hdegoede, grafi, oneukum, Gabriele Mazzotta
The minimum value these sensors can report is 4, so this should be the
value used when W is not reporting the width.
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
drivers/input/mouse/synaptics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index ba321e7..27a091b 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1032,7 +1032,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
if (hw.z > 0 && hw.x > 1) {
num_fingers = 1;
- finger_width = 5;
+ finger_width = 4;
if (SYN_CAP_EXTENDED(priv->capabilities)) {
switch (hw.w) {
case 0 ... 1:
--
2.8.0.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 4/4] input: synaptics - make image sensors and cr48 sensors report widths
2016-04-01 13:06 [PATCH v4 0/4] input: synaptics - report correct width and pressure values Gabriele Mazzotta
` (2 preceding siblings ...)
2016-04-01 13:06 ` [PATCH v4 3/4] input: synaptics - change default width value of cr48 sensors Gabriele Mazzotta
@ 2016-04-01 13:06 ` Gabriele Mazzotta
3 siblings, 0 replies; 5+ messages in thread
From: Gabriele Mazzotta @ 2016-04-01 13:06 UTC (permalink / raw)
To: dmitry.torokhov, benjamin.tissoires
Cc: linux-input, linux-kernel, rydberg, silverhammermba,
peter.hutterer, hdegoede, grafi, oneukum, Gabriele Mazzotta
Despite claiming to report finger widths, image sensors and cr48
profile sensors were not doing it. Since the touchpad uses an
abstract unit for the width of the fingers, report only the witdh
of the first touch using ABS_TOOL_WIDTH.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=77161
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
drivers/input/mouse/synaptics.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 27a091b..bed268b 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -943,6 +943,8 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
input_report_abs(dev, ABS_MT_PRESSURE, hw[i]->z);
}
+ input_report_abs(dev, ABS_TOOL_WIDTH, hw[0]->w);
+
input_mt_drop_unused(dev);
/* Don't use active slot count to generate BTN_TOOL events. */
--
2.8.0.rc3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-04-01 13:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01 13:06 [PATCH v4 0/4] input: synaptics - report correct width and pressure values Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 1/4] input: synaptics - fix pressure values calculation on image sensors Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 2/4] input: synaptics - fix width " Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 3/4] input: synaptics - change default width value of cr48 sensors Gabriele Mazzotta
2016-04-01 13:06 ` [PATCH v4 4/4] input: synaptics - make image sensors and cr48 sensors report widths Gabriele Mazzotta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®