Skip to content

Commit c8f2edc

Browse files
Pinglinuxdtor
authored andcommitted
Input: wacom - add support for DTU2231 and DTU1631
Add support for the two new devices: DTU2231 and DTU1631. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent 1fcb8bb commit c8f2edc

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎drivers/input/tablet/wacom_wac.c‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,39 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)
158158
return 1;
159159
}
160160

161+
static int wacom_dtu_irq(struct wacom_wac *wacom)
162+
{
163+
struct wacom_features *features = &wacom->features;
164+
char *data = wacom->data;
165+
struct input_dev *input = wacom->input;
166+
int prox = data[1] & 0x20, pressure;
167+
168+
dbg("wacom_dtu_irq: received report #%d", data[0]);
169+
170+
if (prox) {
171+
/* Going into proximity select tool */
172+
wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
173+
if (wacom->tool[0] == BTN_TOOL_PEN)
174+
wacom->id[0] = STYLUS_DEVICE_ID;
175+
else
176+
wacom->id[0] = ERASER_DEVICE_ID;
177+
}
178+
input_report_key(input, BTN_STYLUS, data[1] & 0x02);
179+
input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
180+
input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
181+
input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
182+
pressure = ((data[7] & 0x01) << 8) | data[6];
183+
if (pressure < 0)
184+
pressure = features->pressure_max + pressure + 1;
185+
input_report_abs(input, ABS_PRESSURE, pressure);
186+
input_report_key(input, BTN_TOUCH, data[1] & 0x05);
187+
if (!prox) /* out-prox */
188+
wacom->id[0] = 0;
189+
input_report_key(input, wacom->tool[0], prox);
190+
input_report_abs(input, ABS_MISC, wacom->id[0]);
191+
return 1;
192+
}
193+
161194
static int wacom_graphire_irq(struct wacom_wac *wacom)
162195
{
163196
struct wacom_features *features = &wacom->features;
@@ -844,6 +877,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
844877
sync = wacom_ptu_irq(wacom_wac);
845878
break;
846879

880+
case DTU:
881+
sync = wacom_dtu_irq(wacom_wac);
882+
break;
883+
847884
case INTUOS:
848885
case INTUOS3S:
849886
case INTUOS3:
@@ -1029,6 +1066,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
10291066

10301067
case PL:
10311068
case PTU:
1069+
case DTU:
10321070
__set_bit(BTN_TOOL_PEN, input_dev->keybit);
10331071
__set_bit(BTN_STYLUS, input_dev->keybit);
10341072
__set_bit(BTN_STYLUS2, input_dev->keybit);
@@ -1154,6 +1192,10 @@ static const struct wacom_features wacom_features_0xC6 =
11541192
{ "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE };
11551193
static const struct wacom_features wacom_features_0xC7 =
11561194
{ "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL };
1195+
static const struct wacom_features wacom_features_0xCE =
1196+
{ "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, 0, DTU };
1197+
static const struct wacom_features wacom_features_0xF0 =
1198+
{ "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 0, DTU };
11571199
static const struct wacom_features wacom_features_0xCC =
11581200
{ "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 };
11591201
static const struct wacom_features wacom_features_0x90 =
@@ -1233,6 +1275,8 @@ const struct usb_device_id wacom_ids[] = {
12331275
{ USB_DEVICE_WACOM(0xC5) },
12341276
{ USB_DEVICE_WACOM(0xC6) },
12351277
{ USB_DEVICE_WACOM(0xC7) },
1278+
{ USB_DEVICE_WACOM(0xCE) },
1279+
{ USB_DEVICE_WACOM(0xF0) },
12361280
{ USB_DEVICE_WACOM(0xCC) },
12371281
{ USB_DEVICE_WACOM(0x90) },
12381282
{ USB_DEVICE_WACOM(0x93) },

‎drivers/input/tablet/wacom_wac.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ enum {
4343
WACOM_G4,
4444
PTU,
4545
PL,
46+
DTU,
4647
INTUOS,
4748
INTUOS3S,
4849
INTUOS3,

0 commit comments

Comments
 (0)