Skip to content

Commit

Permalink
HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Mar 23, 2018
1 parent c30e598 commit 39335d1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions drivers/hid/hid-asus.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
* All functionality is on a single HID interface and for
* userspace the touchpad must be a separate input_dev.
*/
hdev->quirks |= HID_QUIRK_MULTI_INPUT |
HID_QUIRK_NO_EMPTY_INPUT;
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
drvdata->tp = &asus_t100chi_tp;
}

Expand Down
10 changes: 5 additions & 5 deletions drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,16 +1656,16 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
}

list_for_each_entry_safe(hidinput, next, &hid->inputs, list) {
if ((hid->quirks & HID_QUIRK_NO_EMPTY_INPUT) &&
!hidinput_has_been_populated(hidinput)) {
if (drv->input_configured &&
drv->input_configured(hid, hidinput))
goto out_unwind;

if (!hidinput_has_been_populated(hidinput)) {
/* no need to register an input device not populated */
hidinput_cleanup_hidinput(hid, hidinput);
continue;
}

if (drv->input_configured &&
drv->input_configured(hid, hidinput))
goto out_unwind;
if (input_register_device(hidinput->input))
goto out_unwind;
hidinput->registered = true;
Expand Down
1 change: 0 additions & 1 deletion drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
* device.
*/
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;

/*
* Some multitouch screens do not like to be polled for input
Expand Down
1 change: 0 additions & 1 deletion drivers/hid/hid-uclogic.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,6 @@ static int uclogic_probe(struct hid_device *hdev,
* than the pen, so use QUIRK_MULTI_INPUT for all tablets.
*/
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;

/* Allocate and assign driver data */
drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ struct hid_item {
#define HID_QUIRK_BADPAD BIT(5)
#define HID_QUIRK_MULTI_INPUT BIT(6)
#define HID_QUIRK_HIDINPUT_FORCE BIT(7)
#define HID_QUIRK_NO_EMPTY_INPUT BIT(8)
/* BIT(8) reserved for backward compatibility, was HID_QUIRK_NO_EMPTY_INPUT */
/* BIT(9) reserved for backward compatibility, was NO_INIT_INPUT_REPORTS */
#define HID_QUIRK_ALWAYS_POLL BIT(10)
#define HID_QUIRK_SKIP_OUTPUT_REPORTS BIT(16)
Expand Down

0 comments on commit 39335d1

Please sign in to comment.