]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
HID: alps: fix stick device not working after resume
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Mon, 19 Sep 2016 07:41:39 +0000 (15:41 +0800)
committerJiri Kosina <jkosina@suse.cz>
Thu, 22 Sep 2016 09:07:16 +0000 (11:07 +0200)
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>
drivers/hid/hid-alps.c

index 2808da9ed9c8e353e1cdb9f5b3a8a469de55e012..afc847fb2b068de209d182fb48ae6e4cd283b963 100644 (file)
@@ -245,13 +245,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 */