Skip to content

Commit 5fcad16

Browse files
bentissJiri Kosina
authored andcommitted
HID: wacom: ask for a in-prox report when it was missed
If noone listens to the input device when a tool comes in proximity, the tablet does not send the in-prox event when a client becomes available. That means that no events will be sent until the tool is taken out of proximity. In this situation, ask for the report WACOM_REPORT_INTUOSREAD which will read the corresponding feature and generate an in-prox event. To make some generation of hardware working, we need to unset the quirk NO_GET set by hid-core because the interfaces are seen as "boot mouse". We don't schedule this read in a worker while we are in an IO interrupt. We know that usbhid will do it asynchronously. If this is triggered by uhid, then this is obviously a client side bug :) Signed-off-by: Benjamin Tissoires <[email protected]> Acked-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 71fa641 commit 5fcad16

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

drivers/hid/wacom_sys.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,9 @@ static int wacom_probe(struct hid_device *hdev,
14081408

14091409
hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS;
14101410

1411+
/* hid-core sets this quirk for the boot interface */
1412+
hdev->quirks &= ~HID_QUIRK_NOGET;
1413+
14111414
wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
14121415
if (!wacom)
14131416
return -ENOMEM;

drivers/hid/wacom_wac.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,19 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
447447
return retval;
448448
}
449449

450+
static void wacom_intuos_schedule_prox_event(struct wacom_wac *wacom_wac)
451+
{
452+
struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac);
453+
struct hid_report *r;
454+
struct hid_report_enum *re;
455+
456+
re = &(wacom->hdev->report_enum[HID_FEATURE_REPORT]);
457+
r = re->report_id_hash[WACOM_REPORT_INTUOSREAD];
458+
if (r) {
459+
hid_hw_request(wacom->hdev, r, HID_REQ_GET_REPORT);
460+
}
461+
}
462+
450463
static int wacom_intuos_inout(struct wacom_wac *wacom)
451464
{
452465
struct wacom_features *features = &wacom->features;
@@ -623,8 +636,11 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
623636
}
624637

625638
/* don't report other events if we don't know the ID */
626-
if (!wacom->id[idx])
639+
if (!wacom->id[idx]) {
640+
/* but reschedule a read of the current tool */
641+
wacom_intuos_schedule_prox_event(wacom);
627642
return 1;
643+
}
628644

629645
return 0;
630646
}

0 commit comments

Comments
 (0)