Skip to content

Commit a80b2f3

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dock
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4e4c60f commit a80b2f3

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

drivers/hid/hid-asus.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -677,20 +677,13 @@ static int asus_input_mapping(struct hid_device *hdev,
677677
* This avoids a bunch of non-functional hid_input devices getting
678678
* created because of the T100CHI using HID_QUIRK_MULTI_INPUT.
679679
*/
680-
if (drvdata->quirks & (QUIRK_T100CHI | QUIRK_T90CHI)) {
681-
if (field->application == (HID_UP_GENDESK | 0x0080) ||
682-
usage->hid == (HID_UP_GENDEVCTRLS | 0x0024) ||
683-
usage->hid == (HID_UP_GENDEVCTRLS | 0x0025) ||
684-
usage->hid == (HID_UP_GENDEVCTRLS | 0x0026))
685-
return -1;
686-
/*
687-
* We use the hid_input for the mouse report for the touchpad,
688-
* keep the left button, to avoid the core removing it.
689-
*/
690-
if (field->application == HID_GD_MOUSE &&
691-
usage->hid != (HID_UP_BUTTON | 1))
692-
return -1;
693-
}
680+
if ((drvdata->quirks & (QUIRK_T100CHI | QUIRK_T90CHI)) &&
681+
(field->application == (HID_UP_GENDESK | 0x0080) ||
682+
field->application == HID_GD_MOUSE ||
683+
usage->hid == (HID_UP_GENDEVCTRLS | 0x0024) ||
684+
usage->hid == (HID_UP_GENDEVCTRLS | 0x0025) ||
685+
usage->hid == (HID_UP_GENDEVCTRLS | 0x0026)))
686+
return -1;
694687

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

0 commit comments

Comments
 (0)