Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT

There is no real point of registering an empty input node.
This should be default, but given some drivers need the blank input
node to set it up during input_configured, we need to postpone
the check for hidinput_has_been_populated().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Benjamin Tissoires and committed by
Jiri Kosina
39335d1c c30e5989

+7 -10
+1 -2
drivers/hid/hid-asus.c
··· 644 644 * All functionality is on a single HID interface and for 645 645 * userspace the touchpad must be a separate input_dev. 646 646 */ 647 - hdev->quirks |= HID_QUIRK_MULTI_INPUT | 648 - HID_QUIRK_NO_EMPTY_INPUT; 647 + hdev->quirks |= HID_QUIRK_MULTI_INPUT; 649 648 drvdata->tp = &asus_t100chi_tp; 650 649 } 651 650
+5 -5
drivers/hid/hid-input.c
··· 1656 1656 } 1657 1657 1658 1658 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { 1659 - if ((hid->quirks & HID_QUIRK_NO_EMPTY_INPUT) && 1660 - !hidinput_has_been_populated(hidinput)) { 1659 + if (drv->input_configured && 1660 + drv->input_configured(hid, hidinput)) 1661 + goto out_unwind; 1662 + 1663 + if (!hidinput_has_been_populated(hidinput)) { 1661 1664 /* no need to register an input device not populated */ 1662 1665 hidinput_cleanup_hidinput(hid, hidinput); 1663 1666 continue; 1664 1667 } 1665 1668 1666 - if (drv->input_configured && 1667 - drv->input_configured(hid, hidinput)) 1668 - goto out_unwind; 1669 1669 if (input_register_device(hidinput->input)) 1670 1670 goto out_unwind; 1671 1671 hidinput->registered = true;
-1
drivers/hid/hid-multitouch.c
··· 1469 1469 * device. 1470 1470 */ 1471 1471 hdev->quirks |= HID_QUIRK_MULTI_INPUT; 1472 - hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT; 1473 1472 1474 1473 /* 1475 1474 * Some multitouch screens do not like to be polled for input
-1
drivers/hid/hid-uclogic.c
··· 946 946 * than the pen, so use QUIRK_MULTI_INPUT for all tablets. 947 947 */ 948 948 hdev->quirks |= HID_QUIRK_MULTI_INPUT; 949 - hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT; 950 949 951 950 /* Allocate and assign driver data */ 952 951 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
+1 -1
include/linux/hid.h
··· 338 338 #define HID_QUIRK_BADPAD BIT(5) 339 339 #define HID_QUIRK_MULTI_INPUT BIT(6) 340 340 #define HID_QUIRK_HIDINPUT_FORCE BIT(7) 341 - #define HID_QUIRK_NO_EMPTY_INPUT BIT(8) 341 + /* BIT(8) reserved for backward compatibility, was HID_QUIRK_NO_EMPTY_INPUT */ 342 342 /* BIT(9) reserved for backward compatibility, was NO_INIT_INPUT_REPORTS */ 343 343 #define HID_QUIRK_ALWAYS_POLL BIT(10) 344 344 #define HID_QUIRK_SKIP_OUTPUT_REPORTS BIT(16)