Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 1/6] HID: asus: Only set EV_REP if we are adding a mapping
@ 2020-04-28 14:22 Hans de Goede
  2020-04-28 14:22 ` [PATCH 2/6] HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dock Hans de Goede
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Hans de Goede @ 2020-04-28 14:22 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires; +Cc: Hans de Goede, linux-input

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 <hdegoede@redhat.com>
---
 drivers/hid/hid-asus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index e6e4c841fb06..ac224c32eeb6 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -694,7 +694,6 @@ static int asus_input_mapping(struct hid_device *hdev,
 
 	/* ASUS-specific keyboard hotkeys */
 	if ((usage->hid & HID_USAGE_PAGE) == 0xff310000) {
-		set_bit(EV_REP, hi->input->evbit);
 		switch (usage->hid & HID_USAGE) {
 		case 0x10: asus_map_key_clear(KEY_BRIGHTNESSDOWN);	break;
 		case 0x20: asus_map_key_clear(KEY_BRIGHTNESSUP);		break;
@@ -737,11 +736,11 @@ static int asus_input_mapping(struct hid_device *hdev,
 		if (drvdata->quirks & QUIRK_USE_KBD_BACKLIGHT)
 			drvdata->enable_backlight = true;
 
+		set_bit(EV_REP, hi->input->evbit);
 		return 1;
 	}
 
 	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR) {
-		set_bit(EV_REP, hi->input->evbit);
 		switch (usage->hid & HID_USAGE) {
 		case 0xff01: asus_map_key_clear(BTN_1);	break;
 		case 0xff02: asus_map_key_clear(BTN_2);	break;
@@ -764,6 +763,7 @@ static int asus_input_mapping(struct hid_device *hdev,
 			return 0;
 		}
 
+		set_bit(EV_REP, hi->input->evbit);
 		return 1;
 	}
 
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-06  9:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28 14:22 [PATCH 1/6] HID: asus: Only set EV_REP if we are adding a mapping Hans de Goede
2020-04-28 14:22 ` [PATCH 2/6] HID: asus: Simplify skipping of mappings for Asus T100CHI keyboard-dock Hans de Goede
2020-04-28 14:22 ` [PATCH 3/6] HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check Hans de Goede
2020-05-05 14:32   ` Jiri Kosina
2020-05-06  8:41     ` Hans de Goede
2020-05-06  9:42       ` Jiri Kosina
2020-04-28 14:22 ` [PATCH 4/6] HID: asus: Add report_size to struct asus_touchpad_info Hans de Goede
2020-04-28 14:22 ` [PATCH 5/6] HID: asus: Add support for multi-touch touchpad on Medion Akoya E1239T Hans de Goede
2020-04-28 14:22 ` [PATCH 6/6] HID: asus: Fix mute and touchpad-toggle keys " Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox