diff options
| -rw-r--r-- | drivers/hid/wacom_wac.c | 15 | ||||
| -rw-r--r-- | drivers/hid/wacom_wac.h | 1 |
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 527668913a26..a4ba8caa2456 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c | |||
| @@ -443,9 +443,6 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
| 443 | 443 | ||
| 444 | /* Enter report */ | 444 | /* Enter report */ |
| 445 | if ((data[1] & 0xfc) == 0xc0) { | 445 | if ((data[1] & 0xfc) == 0xc0) { |
| 446 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) | ||
| 447 | wacom->shared->stylus_in_proximity = true; | ||
| 448 | |||
| 449 | /* serial number of the tool */ | 446 | /* serial number of the tool */ |
| 450 | wacom->serial[idx] = ((data[3] & 0x0f) << 28) + | 447 | wacom->serial[idx] = ((data[3] & 0x0f) << 28) + |
| 451 | (data[4] << 20) + (data[5] << 12) + | 448 | (data[4] << 20) + (data[5] << 12) + |
| @@ -554,19 +551,22 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
| 554 | (features->type == CINTIQ && !(data[1] & 0x40))) | 551 | (features->type == CINTIQ && !(data[1] & 0x40))) |
| 555 | return 1; | 552 | return 1; |
| 556 | 553 | ||
| 557 | /* Range Report */ | 554 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) |
| 558 | if ((data[1] & 0xfe) == 0x20) { | 555 | wacom->shared->stylus_in_proximity = true; |
| 556 | |||
| 557 | /* in Range while exiting */ | ||
| 558 | if (((data[1] & 0xfe) == 0x20) && wacom->reporting_data) { | ||
| 559 | input_report_key(input, BTN_TOUCH, 0); | 559 | input_report_key(input, BTN_TOUCH, 0); |
| 560 | input_report_abs(input, ABS_PRESSURE, 0); | 560 | input_report_abs(input, ABS_PRESSURE, 0); |
| 561 | input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max); | 561 | input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max); |
| 562 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) | 562 | return 2; |
| 563 | wacom->shared->stylus_in_proximity = true; | ||
| 564 | } | 563 | } |
| 565 | 564 | ||
| 566 | /* Exit report */ | 565 | /* Exit report */ |
| 567 | if ((data[1] & 0xfe) == 0x80) { | 566 | if ((data[1] & 0xfe) == 0x80) { |
| 568 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) | 567 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) |
| 569 | wacom->shared->stylus_in_proximity = false; | 568 | wacom->shared->stylus_in_proximity = false; |
| 569 | wacom->reporting_data = false; | ||
| 570 | 570 | ||
| 571 | /* don't report exit if we don't know the ID */ | 571 | /* don't report exit if we don't know the ID */ |
| 572 | if (!wacom->id[idx]) | 572 | if (!wacom->id[idx]) |
| @@ -952,6 +952,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
| 952 | input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */ | 952 | input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */ |
| 953 | input_report_key(input, wacom->tool[idx], 1); | 953 | input_report_key(input, wacom->tool[idx], 1); |
| 954 | input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 954 | input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
| 955 | wacom->reporting_data = true; | ||
| 955 | return 1; | 956 | return 1; |
| 956 | } | 957 | } |
| 957 | 958 | ||
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 7afd9294927a..72e78cc18933 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h | |||
| @@ -189,6 +189,7 @@ struct wacom_wac { | |||
| 189 | int tool[2]; | 189 | int tool[2]; |
| 190 | int id[2]; | 190 | int id[2]; |
| 191 | __u32 serial[2]; | 191 | __u32 serial[2]; |
| 192 | bool reporting_data; | ||
| 192 | struct wacom_features features; | 193 | struct wacom_features features; |
| 193 | struct wacom_shared *shared; | 194 | struct wacom_shared *shared; |
| 194 | struct input_dev *input; | 195 | struct input_dev *input; |
