Patch "HID: asus: Only set EV_REP if we are adding a mapping" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    HID: asus: Only set EV_REP if we are adding a mapping

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hid-asus-only-set-ev_rep-if-we-are-adding-a-mapping.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7529127c9d5ab2f3b1b16d123495edf670f4fe28
Author: Hans de Goede <hdegoede@xxxxxxxxxx>
Date:   Tue Apr 28 16:22:49 2020 +0200

    HID: asus: Only set EV_REP if we are adding a mapping
    
    [ Upstream commit 4e4c60f826772dfeaacdf718f64afa38f46b6875 ]
    
    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@xxxxxxxxxx>
    Signed-off-by: Jiri Kosina <jkosina@xxxxxxx>
    Stable-dep-of: 4ab3a086d10e ("HID: asus: use spinlock to safely schedule workers")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index e1e27d87c86be..5ea4d678b7413 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -714,7 +714,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;
@@ -757,11 +756,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;
@@ -784,6 +783,7 @@ static int asus_input_mapping(struct hid_device *hdev,
 			return 0;
 		}
 
+		set_bit(EV_REP, hi->input->evbit);
 		return 1;
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux