aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2018-03-20 07:04:49 -0400
committerJiri Kosina <jkosina@suse.cz>2018-03-23 10:44:57 -0400
commit39335d1cbb8fb3260ac5f18fbcc45beb690e5ebd (patch)
tree1b72589f90d97385d998d28d97a86f6466988b6c
parentc30e5989d6926c5c1c77c87ed1e54f506e095d74 (diff)
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>
-rw-r--r--drivers/hid/hid-asus.c3
-rw-r--r--drivers/hid/hid-input.c10
-rw-r--r--drivers/hid/hid-multitouch.c1
-rw-r--r--drivers/hid/hid-uclogic.c1
-rw-r--r--include/linux/hid.h2
5 files changed, 7 insertions, 10 deletions
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 88b9703318e4..cc738ebf93ac 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -644,8 +644,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
644 * All functionality is on a single HID interface and for 644 * All functionality is on a single HID interface and for
645 * userspace the touchpad must be a separate input_dev. 645 * userspace the touchpad must be a separate input_dev.
646 */ 646 */
647 hdev->quirks |= HID_QUIRK_MULTI_INPUT | 647 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
648 HID_QUIRK_NO_EMPTY_INPUT;
649 drvdata->tp = &asus_t100chi_tp; 648 drvdata->tp = &asus_t100chi_tp;
650 } 649 }
651 650
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 04d01b57d94c..b237b5590227 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1656,16 +1656,16 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
1656 } 1656 }
1657 1657
1658 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { 1658 list_for_each_entry_safe(hidinput, next, &hid->inputs, list) {
1659 if ((hid->quirks & HID_QUIRK_NO_EMPTY_INPUT) && 1659 if (drv->input_configured &&
1660 !hidinput_has_been_populated(hidinput)) { 1660 drv->input_configured(hid, hidinput))
1661 goto out_unwind;
1662
1663 if (!hidinput_has_been_populated(hidinput)) {
1661 /* no need to register an input device not populated */ 1664 /* no need to register an input device not populated */
1662 hidinput_cleanup_hidinput(hid, hidinput); 1665 hidinput_cleanup_hidinput(hid, hidinput);
1663 continue; 1666 continue;
1664 } 1667 }
1665 1668
1666 if (drv->input_configured &&
1667 drv->input_configured(hid, hidinput))
1668 goto out_unwind;
1669 if (input_register_device(hidinput->input)) 1669 if (input_register_device(hidinput->input))
1670 goto out_unwind; 1670 goto out_unwind;
1671 hidinput->registered = true; 1671 hidinput->registered = true;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index bc724e6b75c9..c4d89830cd1f 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1469,7 +1469,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
1469 * device. 1469 * device.
1470 */ 1470 */
1471 hdev->quirks |= HID_QUIRK_MULTI_INPUT; 1471 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
1472 hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
1473 1472
1474 /* 1473 /*
1475 * Some multitouch screens do not like to be polled for input 1474 * Some multitouch screens do not like to be polled for input
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
index e3e6e5c893cc..56b196d60041 100644
--- a/drivers/hid/hid-uclogic.c
+++ b/drivers/hid/hid-uclogic.c
@@ -946,7 +946,6 @@ static int uclogic_probe(struct hid_device *hdev,
946 * than the pen, so use QUIRK_MULTI_INPUT for all tablets. 946 * than the pen, so use QUIRK_MULTI_INPUT for all tablets.
947 */ 947 */
948 hdev->quirks |= HID_QUIRK_MULTI_INPUT; 948 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
949 hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
950 949
951 /* Allocate and assign driver data */ 950 /* Allocate and assign driver data */
952 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); 951 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
diff --git a/include/linux/hid.h b/include/linux/hid.h
index bc92005e5f08..b0db16fa7093 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -338,7 +338,7 @@ struct hid_item {
338#define HID_QUIRK_BADPAD BIT(5) 338#define HID_QUIRK_BADPAD BIT(5)
339#define HID_QUIRK_MULTI_INPUT BIT(6) 339#define HID_QUIRK_MULTI_INPUT BIT(6)
340#define HID_QUIRK_HIDINPUT_FORCE BIT(7) 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/* BIT(9) reserved for backward compatibility, was NO_INIT_INPUT_REPORTS */ 342/* BIT(9) reserved for backward compatibility, was NO_INIT_INPUT_REPORTS */
343#define HID_QUIRK_ALWAYS_POLL BIT(10) 343#define HID_QUIRK_ALWAYS_POLL BIT(10)
344#define HID_QUIRK_SKIP_OUTPUT_REPORTS BIT(16) 344#define HID_QUIRK_SKIP_OUTPUT_REPORTS BIT(16)