Skip to content

Commit 912c6aa

Browse files
skomraJiri Kosina
authored andcommitted
HID: wacom: Add 2nd gen Intuos Pro Small support
The existing INTUOSP2_BT device class supports LEDs and this device does not. A new device class enum entry, "INTUOSP2S_BT", is created to avoid the INTUOSP2_BT LED code. Signed-off-by: Aaron Armstrong Skomra <[email protected]> Reviewed-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 68c20cc commit 912c6aa

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

drivers/hid/wacom_wac.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
12201220
unsigned char *data = wacom->data;
12211221
int i;
12221222

1223-
if (wacom->features.type == INTUOSP2_BT) {
1223+
if (wacom->features.type == INTUOSP2_BT ||
1224+
wacom->features.type == INTUOSP2S_BT) {
12241225
wacom->serial[0] = get_unaligned_le64(&data[99]);
12251226
wacom->id[0] = get_unaligned_le16(&data[107]);
12261227
pen_frame_len = 14;
@@ -1257,7 +1258,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
12571258
input_report_abs(pen_input, ABS_X, get_unaligned_le16(&frame[1]));
12581259
input_report_abs(pen_input, ABS_Y, get_unaligned_le16(&frame[3]));
12591260

1260-
if (wacom->features.type == INTUOSP2_BT) {
1261+
if (wacom->features.type == INTUOSP2_BT ||
1262+
wacom->features.type == INTUOSP2S_BT) {
12611263
/* Fix rotation alignment: userspace expects zero at left */
12621264
int16_t rotation =
12631265
(int16_t)get_unaligned_le16(&frame[9]);
@@ -1276,7 +1278,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
12761278
}
12771279
}
12781280
input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5]));
1279-
if (wacom->features.type == INTUOSP2_BT) {
1281+
if (wacom->features.type == INTUOSP2_BT ||
1282+
wacom->features.type == INTUOSP2S_BT) {
12801283
input_report_abs(pen_input, ABS_DISTANCE,
12811284
range ? frame[13] : wacom->features.distance_max);
12821285
} else {
@@ -1436,7 +1439,8 @@ static int wacom_intuos_pro2_bt_irq(struct wacom_wac *wacom, size_t len)
14361439
}
14371440

14381441
wacom_intuos_pro2_bt_pen(wacom);
1439-
if (wacom->features.type == INTUOSP2_BT) {
1442+
if (wacom->features.type == INTUOSP2_BT ||
1443+
wacom->features.type == INTUOSP2S_BT) {
14401444
wacom_intuos_pro2_bt_touch(wacom);
14411445
wacom_intuos_pro2_bt_pad(wacom);
14421446
wacom_intuos_pro2_bt_battery(wacom);
@@ -3204,6 +3208,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
32043208
break;
32053209

32063210
case INTUOSP2_BT:
3211+
case INTUOSP2S_BT:
32073212
case INTUOSHT3_BT:
32083213
sync = wacom_intuos_pro2_bt_irq(wacom_wac, len);
32093214
break;
@@ -3384,7 +3389,8 @@ void wacom_setup_device_quirks(struct wacom *wacom)
33843389
if (features->type == REMOTE)
33853390
features->device_type = WACOM_DEVICETYPE_PAD;
33863391

3387-
if (features->type == INTUOSP2_BT) {
3392+
if (features->type == INTUOSP2_BT ||
3393+
features->type == INTUOSP2S_BT) {
33883394
features->device_type |= WACOM_DEVICETYPE_PEN |
33893395
WACOM_DEVICETYPE_PAD |
33903396
WACOM_DEVICETYPE_TOUCH;
@@ -3565,6 +3571,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
35653571
case INTUOS5S:
35663572
case INTUOSPS:
35673573
case INTUOSP2_BT:
3574+
case INTUOSP2S_BT:
35683575
input_set_abs_params(input_dev, ABS_DISTANCE, 0,
35693576
features->distance_max,
35703577
features->distance_fuzz, 0);
@@ -3676,6 +3683,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
36763683

36773684
switch (features->type) {
36783685
case INTUOSP2_BT:
3686+
case INTUOSP2S_BT:
36793687
input_dev->evbit[0] |= BIT_MASK(EV_SW);
36803688
__set_bit(SW_MUTE_DEVICE, input_dev->swbit);
36813689

@@ -3691,6 +3699,12 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
36913699
input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
36923700
0, 5920, 4, 0);
36933701
}
3702+
else if (wacom_wac->shared->touch->product == 0x393) {
3703+
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
3704+
0, 6400, 4, 0);
3705+
input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
3706+
0, 4000, 4, 0);
3707+
}
36943708
input_abs_set_res(input_dev, ABS_MT_POSITION_X, 40);
36953709
input_abs_set_res(input_dev, ABS_MT_POSITION_Y, 40);
36963710

@@ -3997,6 +4011,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
39974011
case INTUOS5S:
39984012
case INTUOSPS:
39994013
case INTUOSP2_BT:
4014+
case INTUOSP2S_BT:
40004015
input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
40014016
break;
40024017

@@ -4574,6 +4589,10 @@ static const struct wacom_features wacom_features_0x37A =
45744589
static const struct wacom_features wacom_features_0x37B =
45754590
{ "Wacom One by Wacom M", 21600, 13500, 2047, 63,
45764591
BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
4592+
static const struct wacom_features wacom_features_0x393 =
4593+
{ "Wacom Intuos Pro S", 31920, 19950, 8191, 63,
4594+
INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7,
4595+
.touch_max = 10 };
45774596

45784597
static const struct wacom_features wacom_features_HID_ANY_ID =
45794598
{ "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
@@ -4746,6 +4765,7 @@ const struct hid_device_id wacom_ids[] = {
47464765
{ BT_DEVICE_WACOM(0x379) },
47474766
{ USB_DEVICE_WACOM(0x37A) },
47484767
{ USB_DEVICE_WACOM(0x37B) },
4768+
{ BT_DEVICE_WACOM(0x393) },
47494769
{ USB_DEVICE_WACOM(0x4001) },
47504770
{ USB_DEVICE_WACOM(0x4004) },
47514771
{ USB_DEVICE_WACOM(0x5000) },

drivers/hid/wacom_wac.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ enum {
215215
INTUOSPM,
216216
INTUOSPL,
217217
INTUOSP2_BT,
218+
INTUOSP2S_BT,
218219
INTUOSHT3_BT,
219220
WACOM_21UX2,
220221
WACOM_22HD,

0 commit comments

Comments
 (0)