Skip to content

Commit 4e4c60f

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: asus: Only set EV_REP if we are adding a mapping
Make asus_input_mapping() only set EV_REP if we are adding a mapping. The T100CHI bluetooth keyboard dock has a few input reports for which we do not create any mappings (these input-reports are present in the descriptors but never send). The hid-asus code relies on the HID core not creating input devices for input-reports without any mappings. But the present of the EV_REP but counts as a mapping causing 6 /dev/input/event# nodes to be created for the T100CHI bluetooth keyboard dock. This change brings the amount of created /dev/input/event# nodes / input-devices down to 4. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 47cf1b4 commit 4e4c60f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-asus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ static int asus_input_mapping(struct hid_device *hdev,
694694

695695
/* ASUS-specific keyboard hotkeys */
696696
if ((usage->hid & HID_USAGE_PAGE) == 0xff310000) {
697-
set_bit(EV_REP, hi->input->evbit);
698697
switch (usage->hid & HID_USAGE) {
699698
case 0x10: asus_map_key_clear(KEY_BRIGHTNESSDOWN); break;
700699
case 0x20: asus_map_key_clear(KEY_BRIGHTNESSUP); break;
@@ -737,11 +736,11 @@ static int asus_input_mapping(struct hid_device *hdev,
737736
if (drvdata->quirks & QUIRK_USE_KBD_BACKLIGHT)
738737
drvdata->enable_backlight = true;
739738

739+
set_bit(EV_REP, hi->input->evbit);
740740
return 1;
741741
}
742742

743743
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR) {
744-
set_bit(EV_REP, hi->input->evbit);
745744
switch (usage->hid & HID_USAGE) {
746745
case 0xff01: asus_map_key_clear(BTN_1); break;
747746
case 0xff02: asus_map_key_clear(BTN_2); break;
@@ -764,6 +763,7 @@ static int asus_input_mapping(struct hid_device *hdev,
764763
return 0;
765764
}
766765

766+
set_bit(EV_REP, hi->input->evbit);
767767
return 1;
768768
}
769769

0 commit comments

Comments
 (0)