diff mbox

HID: alps: fix stick device not working after resume

Message ID 1475731905-10905-2-git-send-email-acelan.kao@canonical.com
State New
Headers show

Commit Message

AceLan Kao Oct. 6, 2016, 5:31 a.m. UTC
From: Kai-Heng Feng <kai.heng.feng@canonical.com>

BusLink: http://bugs.launchpad.net/bugs/1630857

The stick device does not work after resume, add U1_SP_ABS_MODE flag can
make the device work after resume.

This has been discovered by pure guesswork, based on how the existing code uses
U1_TP_ABS_MODE flag on both initialization and resume.

I also tested the the patch on an ALPS touchpad without stick device, did not
notice any side effect on suspend/resume, so I made the U1_SP_ABS_MODE flag
mandatory.

[jkosina@suse.cz: made changelog more verbose]
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

(cherry picked from commit 04fd4cb0b098789725d04e9d4a7e7dda373b1121)
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 drivers/hid/hid-alps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tim Gardner Oct. 6, 2016, 1:16 p.m. UTC | #1

Brad Figg Oct. 6, 2016, 9:51 p.m. UTC | #2

Brad Figg Oct. 6, 2016, 10:02 p.m. UTC | #3

diff mbox

Patch

diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index 048befd..390f8d3 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -244,13 +244,13 @@  static int alps_raw_event(struct hid_device *hdev,
 static int alps_post_reset(struct hid_device *hdev)
 {
 	return u1_read_write_register(hdev, ADDRESS_U1_DEV_CTRL_1,
-				NULL, U1_TP_ABS_MODE, false);
+				NULL, U1_TP_ABS_MODE | U1_SP_ABS_MODE, false);
 }
 
 static int alps_post_resume(struct hid_device *hdev)
 {
 	return u1_read_write_register(hdev, ADDRESS_U1_DEV_CTRL_1,
-				NULL, U1_TP_ABS_MODE, false);
+				NULL, U1_TP_ABS_MODE | U1_SP_ABS_MODE, false);
 }
 #endif /* CONFIG_PM */