Skip to content

Commit

Permalink
Merge branch 'master' of github.com:linuxwacom/input-wacom into for-5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
skomra committed Sep 18, 2019
2 parents c7005ad + 73a2dae commit 166995a
Show file tree
Hide file tree
Showing 27 changed files with 674 additions and 282 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ install:

script:
- ./autogen.sh --with-kernel=${KERNELDIR}/${KERNEL} && make EXTRA_CFLAGS="-Werror -Wno-type-limits -Wno-unused-function -isystem ${KERNELDIR}/${KERNEL}/arch/x86/include -isystem ${KERNELDIR}/${KERNEL}/arch/x86/include/uapi -isystem ${KERNELDIR}/${KERNEL}/include/linux"

jobs:
include:
stage: checkpatch
before_script:
- sed -i '/duplicate signatures/,/^$/ s/if (/if (0 and /' ${KERNELDIR}/${KERNEL}/scripts/checkpatch.pl
- git remote add upstream https://github.com/linuxwacom/input-wacom.git
- git fetch upstream master
- git format-patch FETCH_HEAD
script:
- if ls *.patch 2>/dev/null; then ${KERNELDIR}/${KERNEL}/scripts/checkpatch.pl --max-line-length=90 --ignore OPEN_BRACE --ignore EMAIL_SUBJECT *.patch; fi
5 changes: 1 addition & 4 deletions 2.6.32/wacom.h
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* drivers/input/tablet/wacom.h
*
Expand Down Expand Up @@ -75,10 +76,6 @@
*/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef WACOM_H
#define WACOM_H
Expand Down
11 changes: 5 additions & 6 deletions 2.6.32/wacom_sys.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* drivers/input/tablet/wacom_sys.c
*
* USB Wacom tablet support - system specific code
*/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#include "wacom_wac.h"
Expand Down Expand Up @@ -223,7 +220,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
switch (data) {
case HID_USAGE_WT_X:
features->device_type = BTN_TOOL_TRIPLETAP;
if (features->type == INTUOSP2) {
if (features->type == INTUOSP2 ||
features->type == INTUOSP2S) {
features->pktlen = WACOM_PKGLEN_INTUOSP2T;
features->unit = report[i+4];
features->unitExpo = report[i+6];
Expand All @@ -233,7 +231,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
break;

case HID_USAGE_WT_Y:
if (features->type == INTUOSP2) {
if (features->type == INTUOSP2 ||
features->type == INTUOSP2S) {
features->y_phy = get_unaligned_le16(&report[i + 4]);
features->y_max = get_unaligned_le16(&report[i + 7]);
}
Expand Down
4 changes: 3 additions & 1 deletion 2.6.32/wacom_w8001.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ MODULE_AUTHOR("Jaya Kumar <jayakumar.lkml@gmail.com>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");

#define W8001_MAX_PHYS 42

#define W8001_MAX_LENGTH 13
#define W8001_LEAD_MASK 0x80
#define W8001_LEAD_BYTE 0x80
Expand Down Expand Up @@ -87,7 +89,7 @@ struct w8001 {
unsigned char response_type;
unsigned char response[W8001_MAX_LENGTH];
unsigned char data[W8001_MAX_LENGTH];
char phys[32];
char phys[W8001_MAX_PHYS];
int type;
unsigned int pktlen;
int max_touch_x;
Expand Down
135 changes: 126 additions & 9 deletions 2.6.32/wacom_wac.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* drivers/input/tablet/wacom_wac.c
*
* USB Wacom tablet support - Wacom specific code
*
*/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#include "wacom_wac.h"
Expand Down Expand Up @@ -464,6 +460,8 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
int ring1 = 0, ring2 = 0;
int strip1 = 0, strip2 = 0;
bool prox = false;
bool wrench = false, keyboard = false, mute_touch = false, menu = false,
info = false;

/* pad packets. Works as a second tool and is always in prox */
if (!(data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD ||
Expand Down Expand Up @@ -493,9 +491,29 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
keys = ((data[3] & 0x1C) ? 1<<2 : 0) |
((data[4] & 0xE0) ? 1<<1 : 0) |
((data[4] & 0x07) ? 1<<0 : 0);
keyboard = !!(data[4] & 0xE0);
info = !!(data[3] & 0x1C);

if (features->oPid) {
mute_touch = !!(data[4] & 0x07);
if (mute_touch)
wacom->shared->is_touch_on =
!wacom->shared->is_touch_on;
} else {
wrench = !!(data[4] & 0x07);
}
} else if (features->type == WACOM_27QHD) {
nkeys = 3;
keys = data[2] & 0x07;

if (features->oPid) {
mute_touch = !!(data[2] & 0x04);
if (mute_touch)
wacom->shared->is_touch_on =
!wacom->shared->is_touch_on;
} else {
menu = !!(data[2] & 0x04);
}
} else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
/*
* ExpressKeys on Intuos5/Intuos Pro have a capacitive sensor in
Expand All @@ -514,6 +532,9 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
if (features->type == WACOM_22HD) {
nkeys = 3;
keys = data[9] & 0x07;

info = !!(data[9] & 0x01);
wrench = !!(data[9] & 0x02);
}
} else {
buttons = ((data[6] & 0x10) << 5) |
Expand All @@ -525,14 +546,26 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
strip2 = ((data[3] & 0x1f) << 8) | data[4];
}

prox = (buttons & ~(~0 << nbuttons)) | (keys & ~(~0 << nkeys)) |
prox = (buttons & ~(~0U << nbuttons)) | (keys & ~(~0U << nkeys)) |
(ring1 & 0x80) | (ring2 & 0x80) | strip1 | strip2;

wacom_report_numbered_buttons(input, nbuttons, buttons);

for (i = 0; i < nkeys; i++)
input_report_key(input, KEY_PROG1 + i, keys & (1 << i));

input_report_key(input, KEY_BUTTONCONFIG, wrench);
input_report_key(input, KEY_ONSCREEN_KEYBOARD, keyboard);
input_report_key(input, KEY_CONTROLPANEL, menu);
input_report_key(input, KEY_INFO, info);

if (wacom->shared && wacom->shared->touch_input) {
input_report_switch(wacom->shared->touch_input,
SW_MUTE_DEVICE,
!wacom->shared->is_touch_on);
input_sync(wacom->shared->touch_input);
}

input_report_abs(input, ABS_RX, strip1);
input_report_abs(input, ABS_RY, strip2);

Expand Down Expand Up @@ -780,6 +813,8 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
y >>= 1;
distance >>= 1;
}
if (features->type == INTUOSHT2)
distance = features->distance_max - distance;
input_report_abs(input, ABS_X, x);
input_report_abs(input, ABS_Y, y);
input_report_abs(input, ABS_DISTANCE, distance);
Expand Down Expand Up @@ -1011,6 +1046,12 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
bytes_header = 1;
break;
case WACOM_27QHDT:
if (wacom->shared->has_mute_touch_switch &&
!wacom->shared->is_touch_on) {
if (!wacom->shared->touch_down)
return 0;
}

current_num_contacts = data[63];
contacts_per_packet = 10;
bytes_per_packet = WACOM_BYTES_PER_QHDTHID_PACKET;
Expand All @@ -1025,6 +1066,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
bytes_header = 3;
break;
case INTUOSP2:
case INTUOSP2S:
current_num_contacts = data[1];
contacts_per_packet = 5;
bytes_per_packet = WACOM_BYTES_PER_INTUOSP2_PACKET;
Expand Down Expand Up @@ -1071,6 +1113,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
break;

case INTUOSP2:
case INTUOSP2S:
contact_id = data[offset];
prox = data[offset + 1] & 0x01;
x = get_unaligned_le16(&data[offset + 2]);
Expand Down Expand Up @@ -1700,6 +1743,11 @@ static int wacom_mspro_pad_irq(struct wacom_wac *wacom)
ring = le16_to_cpup((__le16 *)&data[4]);
keys = 0;
break;
case 7:
buttons = (data[1]) | (data[3] << 6);
ring = le16_to_cpup((__le16 *)&data[4]);
keys = 0;
break;
case 0:
buttons = 0;
ring = WACOM_INTUOSP2_RING_UNTOUCHED; /* No ring */
Expand All @@ -1724,8 +1772,8 @@ static int wacom_mspro_pad_irq(struct wacom_wac *wacom)
ringvalue += 3*72/16;
if (ringvalue > 71)
ringvalue -= 72;
}
else if (input->id.product == 0x34d || input->id.product == 0x34e) {
} else if (input->id.product == 0x34d || input->id.product == 0x34e ||
input->id.product == 0x398 || input->id.product == 0x399) {
/* MobileStudio Pro */
ringvalue = 35 - (ring & 0x7F);
ringvalue += 36/2;
Expand Down Expand Up @@ -1937,6 +1985,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)

case WACOM_MSPRO:
case INTUOSP2:
case INTUOSP2S:
case CINTIQ_16:
if (len == WACOM_PKGLEN_INTUOSP2T &&
wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH)
Expand Down Expand Up @@ -2256,6 +2305,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
__set_bit(KEY_PROG2, input_dev->keybit);
__set_bit(KEY_PROG3, input_dev->keybit);

__set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit);
__set_bit(KEY_INFO, input_dev->keybit);

if (!features->oPid)
__set_bit(KEY_BUTTONCONFIG, input_dev->keybit);

input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
/* fall through */

Expand All @@ -2271,6 +2326,13 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
__set_bit(KEY_PROG1, input_dev->keybit);
__set_bit(KEY_PROG2, input_dev->keybit);
__set_bit(KEY_PROG3, input_dev->keybit);

__set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit);
__set_bit(KEY_BUTTONCONFIG, input_dev->keybit);

if (!features->oPid)
__set_bit(KEY_CONTROLPANEL, input_dev->keybit);

input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);

wacom_setup_cintiq(wacom_wac);
Expand All @@ -2280,6 +2342,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
__set_bit(KEY_PROG1, input_dev->keybit);
__set_bit(KEY_PROG2, input_dev->keybit);
__set_bit(KEY_PROG3, input_dev->keybit);

__set_bit(KEY_BUTTONCONFIG, input_dev->keybit);
__set_bit(KEY_INFO, input_dev->keybit);
/* fall through */

case WACOM_21UX2:
Expand All @@ -2291,6 +2356,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);

wacom_setup_cintiq(wacom_wac);
break;

case INTUOS3:
case INTUOS3L:
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
Expand All @@ -2306,6 +2374,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
break;

case INTUOSP2:
case INTUOSP2S:
if (features->device_type == BTN_TOOL_TRIPLETAP) {
for (i = 0; i < 10; i++)
wacom_wac->slots[i] = -1;
Expand All @@ -2321,6 +2390,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
__set_bit(BTN_STYLUS3, input_dev->keybit);
wacom_wac->previous_ring = WACOM_INTUOSP2_RING_UNTOUCHED;
}
/* fall through */

case INTUOS5:
case INTUOS5L:
case INTUOSPM:
Expand Down Expand Up @@ -2373,6 +2444,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
for (i = 0; i < 10; i++)
wacom_wac->slots[i] = -1;
}
if (wacom_wac->shared->touch_input->id.product == 0x32C ||
wacom_wac->shared->touch_input->id.product == 0xF6) {
input_dev->evbit[0] |= BIT_MASK(EV_SW);
__set_bit(SW_MUTE_DEVICE, input_dev->swbit);
wacom_wac->shared->has_mute_touch_switch = true;
}
/* fall through */

case TABLETPC2FG:
Expand Down Expand Up @@ -2405,6 +2482,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
case DTUS2:
case DTK2451:
input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
/* fall through */

case DTUSX:
case PL:
Expand Down Expand Up @@ -3070,8 +3148,40 @@ static const struct wacom_features wacom_features_0x390 =
{ "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63,
CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
static const struct wacom_features wacom_features_0x391 =
{ "Wacom Cintiq 22", WACOM_PKGLEN_MSPRO, 96012, 54358, 8191, 63,
CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
static const struct wacom_features wacom_features_0x392 =
{ "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOSP2, 31920, 19950, 8191, 63,
INTUOSP2S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 10 };
static const struct wacom_features wacom_features_0x396 =
{ "Wacom DTK-1660E", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63,
CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
static const struct wacom_features wacom_features_0x398 =
{ "Wacom MobileStudio Pro 13", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63,
WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
.oVid = USB_VENDOR_ID_WACOM, .oPid = 0x39A };
static const struct wacom_features wacom_features_0x399 =
{ "Wacom MobileStudio Pro 16", WACOM_PKGLEN_MSPRO, 69920, 39680, 8191, 63,
WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 13,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
.oVid = USB_VENDOR_ID_WACOM };
.oVid = USB_VENDOR_ID_WACOM, .oPid = 0x39B };
static const struct wacom_features wacom_features_0x39A =
{ "Wacom MobileStudio Pro 13 Touch", WACOM_PKGLEN_MSPROT, /* Touch */
.type = WACOM_MSPROT, .touch_max = 10,
.oVid = USB_VENDOR_ID_WACOM, .oPid = 0x398 };
static const struct wacom_features wacom_features_0x39B =
{ "Wacom MobileStudio Pro 16 Touch", WACOM_PKGLEN_MSPROT, /* Touch */
.type = WACOM_MSPROT, .touch_max = 10,
.oVid = USB_VENDOR_ID_WACOM, .oPid = 0x399 };

#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
Expand Down Expand Up @@ -3258,6 +3368,13 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x37E) },
{ USB_DEVICE_WACOM(0x382) },
{ USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x391, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x392, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x396, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_WACOM(0x398) },
{ USB_DEVICE_WACOM(0x399) },
{ USB_DEVICE_WACOM(0x39A) },
{ USB_DEVICE_WACOM(0x39B) },
#ifndef RHEL6_RELEASE
{ USB_DEVICE_WACOM(0x4001) },
{ USB_DEVICE_WACOM(0x4004) },
Expand Down
Loading

0 comments on commit 166995a

Please sign in to comment.