HID: hid-input: Add eraser usage to hidinput_configure_usage
authorPing Cheng <pinglinux@gmail.com>
Tue, 3 Oct 2017 22:05:41 +0000 (15:05 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 5 Oct 2017 09:20:12 +0000 (11:20 +0200)
Some tablets report eraser usage to indicate the eraser tool tip
is touching the surface. But, hidinput_configure_usage didn't
support the usage, which led it falls into default as ABS_MISC.

Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c

index 199f6a0..04d01b5 100644 (file)
@@ -797,6 +797,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        map_key_clear(BTN_STYLUS);
                        break;
 
+               case 0x45: /* ERASER */
+                       /*
+                        * This event is reported when eraser tip touches the surface.
+                        * Actual eraser (BTN_TOOL_RUBBER) is set by Invert usage when
+                        * tool gets in proximity.
+                        */
+                       map_key_clear(BTN_TOUCH);
+                       break;
+
                case 0x46: /* TabletPick */
                case 0x5a: /* SecondaryBarrelSwitch */
                        map_key_clear(BTN_STYLUS2);