diff mbox

Fix a issue that Alps Touchpad cursor does not work

Message ID 1474952677-22887-1-git-send-email-masaki.ota@jp.alps.com (mailing list archive)
State New, archived
Headers show

Commit Message

Masaki Ota Sept. 27, 2016, 5:04 a.m. UTC
fix Touchpad cursor does not work after touching Touchpad 
by 3 or more fingers.

Issue reproduction procedure
1.Three or more fingers put on Touchpad.
2.release fingers from Touchpad.
3.move the cursor by one finger.
4.the cursor does not move.

Cause
This code does not notify multi fingers state correctly to system.
For example, when three fingers release from Touchpad,
fingers state is 3 -> 0. It needs to notify
first, second and third finger's releasing state.
But this code does not notify second and third finger's
releasing state by "break" code.

Solution
Delete "break" code, and move xyz input code to the correct place.

Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com>
---
 drivers/hid/hid-alps.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Jiri Kosina Sept. 27, 2016, 11:52 a.m. UTC | #1
On Tue, 27 Sep 2016, Masaki Ota wrote:

> fix Touchpad cursor does not work after touching Touchpad 
> by 3 or more fingers.
> 
> Issue reproduction procedure
> 1.Three or more fingers put on Touchpad.
> 2.release fingers from Touchpad.
> 3.move the cursor by one finger.
> 4.the cursor does not move.
> 
> Cause
> This code does not notify multi fingers state correctly to system.
> For example, when three fingers release from Touchpad,
> fingers state is 3 -> 0. It needs to notify
> first, second and third finger's releasing state.
> But this code does not notify second and third finger's
> releasing state by "break" code.
> 
> Solution
> Delete "break" code, and move xyz input code to the correct place.
> 
> Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com>

I have slightly reworded the changelog and applied to for-4.9/alps. 
Thanks,
diff mbox

Patch

diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index 048befd..610df92 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -190,16 +190,16 @@  static int alps_raw_event(struct hid_device *hdev,
 			if (z != 0) {
 				input_mt_report_slot_state(hdata->input,
 					MT_TOOL_FINGER, 1);
+				input_report_abs(hdata->input,
+					ABS_MT_POSITION_X, x);
+				input_report_abs(hdata->input,
+					ABS_MT_POSITION_Y, y);
+				input_report_abs(hdata->input,
+					ABS_MT_PRESSURE, z);
 			} else {
 				input_mt_report_slot_state(hdata->input,
 					MT_TOOL_FINGER, 0);
-				break;
 			}
-
-			input_report_abs(hdata->input, ABS_MT_POSITION_X, x);
-			input_report_abs(hdata->input, ABS_MT_POSITION_Y, y);
-			input_report_abs(hdata->input, ABS_MT_PRESSURE, z);
-
 		}
 
 		input_mt_sync_frame(hdata->input);