Skip to content

Commit 21c6b46

Browse files
committed
backport: HID: wacom: Ensure bootloader PID is usable in hidraw mode
Some Wacom devices have a special "bootloader" mode that is used for firmware flashing. When operating in this mode, the device cannot be used for input, and the HID descriptor is not able to be processed by the driver. The driver generates an "Unknown device_type" warning and then returns an error code from wacom_probe(). This is a problem because userspace still needs to be able to interact with the device via hidraw to perform the firmware flash. This commit adds a non-generic device definition for 056a:0094 which is used when devices are in "bootloader" mode. It marks the devices with a special BOOTLOADER type that is recognized by wacom_probe() and wacom_raw_event(). When we see this type we ensure a hidraw device is created and otherwise keep our hands off so that userspace is in full control. Signed-off-by: Jason Gerecke <[email protected]> Tested-by: Tatsunosuke Tobita <[email protected]> Cc: <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> [[email protected]: Imported into input-wacom (1db1f39259)] Signed-off-by: Jason Gerecke <[email protected]> [[email protected]: Backported from input-wacom (2232973)] Signed-off-by: Jason Gerecke <[email protected]>
1 parent 2f5a48b commit 21c6b46

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

3.17/wacom_sys.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
217217
{
218218
struct wacom *wacom = hid_get_drvdata(hdev);
219219

220+
if (wacom->wacom_wac.features.type == BOOTLOADER)
221+
return 0;
222+
220223
if (size > WACOM_PKGLEN_MAX)
221224
return 1;
222225

@@ -2704,6 +2707,11 @@ static int wacom_probe(struct hid_device *hdev,
27042707
goto fail;
27052708
}
27062709

2710+
if (features->type == BOOTLOADER) {
2711+
hid_warn(hdev, "Using device in hidraw-only mode");
2712+
return hid_hw_start(hdev, HID_CONNECT_HIDRAW);
2713+
}
2714+
27072715
error = wacom_parse_and_register(wacom, false);
27082716
if (error)
27092717
goto fail;

3.17/wacom_wac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4806,6 +4806,9 @@ static const struct wacom_features wacom_features_0x3dd =
48064806
static const struct wacom_features wacom_features_HID_ANY_ID =
48074807
{ "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
48084808

4809+
static const struct wacom_features wacom_features_0x94 =
4810+
{ "Wacom Bootloader", .type = BOOTLOADER };
4811+
48094812
#define USB_DEVICE_WACOM(prod) \
48104813
HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
48114814
.driver_data = (kernel_ulong_t)&wacom_features_##prod
@@ -4879,6 +4882,7 @@ const struct hid_device_id wacom_ids[] = {
48794882
{ USB_DEVICE_WACOM(0x84) },
48804883
{ USB_DEVICE_WACOM(0x90) },
48814884
{ USB_DEVICE_WACOM(0x93) },
4885+
{ USB_DEVICE_WACOM(0x94) },
48824886
{ USB_DEVICE_WACOM(0x97) },
48834887
{ USB_DEVICE_WACOM(0x9A) },
48844888
{ USB_DEVICE_WACOM(0x9F) },

3.17/wacom_wac.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ enum {
267267
MTTPC,
268268
MTTPC_B,
269269
HID_GENERIC,
270+
BOOTLOADER,
270271
MAX_TYPE
271272
};
272273

0 commit comments

Comments
 (0)