Commit 3f14a63a authored by Jason Gerecke's avatar Jason Gerecke Committed by Jiri Kosina

HID: wacom: Remove WACOM_QUIRK_NO_INPUT

WACOM_QUIRK_NO_INPUT is a signal to the driver that input devices
should not be created for a particular device. This quirk was used by
the wireless receiver to prevent any devices from being created during
the initial probe (defering it instead until we got a tablet connection
event in 'wacom_wireless_work').

This quirk is not necessary now that a device_type is associated with each
device. Any input device allocated by 'wacom_allocate_inputs' which is
not necessary for a particular device is freed in 'wacom_register_inputs'.
In particular, none of the wireless receivers devices have the pen, pad,
or touch device types set so the same effect is achieved without the need
to be explicit.

We now return early in wacom_retrieve_hid_descriptor for wireless devices
(to prevent the device_type from being overridden) but since we ignore the
HID descriptor for the wireless reciever anyway, this is not an issue.
Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent ccad85cc
...@@ -453,11 +453,11 @@ static void wacom_retrieve_hid_descriptor(struct hid_device *hdev, ...@@ -453,11 +453,11 @@ static void wacom_retrieve_hid_descriptor(struct hid_device *hdev,
* interface number. * interface number.
*/ */
if (features->type == WIRELESS) { if (features->type == WIRELESS) {
if (intf->cur_altsetting->desc.bInterfaceNumber == 0) { if (intf->cur_altsetting->desc.bInterfaceNumber == 0)
features->device_type = WACOM_DEVICETYPE_WL_MONITOR; features->device_type = WACOM_DEVICETYPE_WL_MONITOR;
} else if (intf->cur_altsetting->desc.bInterfaceNumber == 2) { else
features->device_type |= WACOM_DEVICETYPE_TOUCH; features->device_type = WACOM_DEVICETYPE_NONE;
} return;
} }
wacom_parse_hid(hdev, features); wacom_parse_hid(hdev, features);
...@@ -1531,11 +1531,9 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -1531,11 +1531,9 @@ static int wacom_probe(struct hid_device *hdev,
mutex_init(&wacom->lock); mutex_init(&wacom->lock);
INIT_WORK(&wacom->work, wacom_wireless_work); INIT_WORK(&wacom->work, wacom_wireless_work);
if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { error = wacom_allocate_inputs(wacom);
error = wacom_allocate_inputs(wacom); if (error)
if (error) goto fail_allocate_inputs;
goto fail_allocate_inputs;
}
/* /*
* Bamboo Pad has a generic hid handling for the Pen, and we switch it * Bamboo Pad has a generic hid handling for the Pen, and we switch it
...@@ -1588,11 +1586,9 @@ static int wacom_probe(struct hid_device *hdev, ...@@ -1588,11 +1586,9 @@ static int wacom_probe(struct hid_device *hdev,
goto fail_battery; goto fail_battery;
} }
if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { error = wacom_register_inputs(wacom);
error = wacom_register_inputs(wacom); if (error)
if (error) goto fail_register_inputs;
goto fail_register_inputs;
}
if (hdev->bus == BUS_BLUETOOTH) { if (hdev->bus == BUS_BLUETOOTH) {
error = device_create_file(&hdev->dev, &dev_attr_speed); error = device_create_file(&hdev->dev, &dev_attr_speed);
......
...@@ -2326,10 +2326,6 @@ void wacom_setup_device_quirks(struct wacom *wacom) ...@@ -2326,10 +2326,6 @@ void wacom_setup_device_quirks(struct wacom *wacom)
} }
if (features->type == WIRELESS) { if (features->type == WIRELESS) {
/* monitor never has input and pen/touch have delayed create */
features->quirks |= WACOM_QUIRK_NO_INPUT;
if (features->device_type == WACOM_DEVICETYPE_WL_MONITOR) { if (features->device_type == WACOM_DEVICETYPE_WL_MONITOR) {
features->quirks |= WACOM_QUIRK_BATTERY; features->quirks |= WACOM_QUIRK_BATTERY;
} }
......
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
/* device quirks */ /* device quirks */
#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0001 #define WACOM_QUIRK_BBTOUCH_LOWRES 0x0001
#define WACOM_QUIRK_NO_INPUT 0x0002
#define WACOM_QUIRK_BATTERY 0x0008 #define WACOM_QUIRK_BATTERY 0x0008
/* device types */ /* device types */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment