Skip to content

Commit

Permalink
HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dock
Browse files Browse the repository at this point in the history
Before this commit the code was trying to keep the mapping for the
left mouse-button, do avoid the hidinput_has_been_populated() check
in hid-input.c from triggering and causing the touchpad input_dev ro
get cleaned up.

But the hidinput_has_been_populated() check happens after the
input_configured callback which sets up all the input bit for the
touchpad, so there is no need to preserve the left button mapping.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Hans de Goede authored and Jiri Kosina committed May 6, 2020
1 parent 4e4c60f commit a80b2f3
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions drivers/hid/hid-asus.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,20 +677,13 @@ static int asus_input_mapping(struct hid_device *hdev,
* This avoids a bunch of non-functional hid_input devices getting
* created because of the T100CHI using HID_QUIRK_MULTI_INPUT.
*/
if (drvdata->quirks & (QUIRK_T100CHI | QUIRK_T90CHI)) {
if (field->application == (HID_UP_GENDESK | 0x0080) ||
usage->hid == (HID_UP_GENDEVCTRLS | 0x0024) ||
usage->hid == (HID_UP_GENDEVCTRLS | 0x0025) ||
usage->hid == (HID_UP_GENDEVCTRLS | 0x0026))
return -1;
/*
* We use the hid_input for the mouse report for the touchpad,
* keep the left button, to avoid the core removing it.
*/
if (field->application == HID_GD_MOUSE &&
usage->hid != (HID_UP_BUTTON | 1))
return -1;
}
if ((drvdata->quirks & (QUIRK_T100CHI | QUIRK_T90CHI)) &&
(field->application == (HID_UP_GENDESK | 0x0080) ||
field->application == HID_GD_MOUSE ||
usage->hid == (HID_UP_GENDEVCTRLS | 0x0024) ||
usage->hid == (HID_UP_GENDEVCTRLS | 0x0025) ||
usage->hid == (HID_UP_GENDEVCTRLS | 0x0026)))
return -1;

/* ASUS-specific keyboard hotkeys */
if ((usage->hid & HID_USAGE_PAGE) == 0xff310000) {
Expand Down

0 comments on commit a80b2f3

Please sign in to comment.