Commit f860e581 authored by Jason Gerecke's avatar Jason Gerecke Committed by Dmitry Torokhov

Input: wacom - add Intuos5 Touch Ring/ExpressKey support

Intuos5 uses a new report type for Touch Ring and ExpressKey data.
Note that data from the capacitive sensors present on the ExpressKeys
will be ignored until a proper way is found to expose it.
Signed-off-by: default avatarJason Gerecke <killertofu@gmail.com>
Reviewed-by: default avatarChris Bagwell <chris@cnpbagwell.com>
Reviewed-by: default avatarPing Cheng <pingc@wacom.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 9fee6195
...@@ -484,7 +484,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) ...@@ -484,7 +484,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
int idx = 0, result; int idx = 0, result;
if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
&& data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) { && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD
&& data[0] != WACOM_REPORT_INTUOS5PAD) {
dbg("wacom_intuos_irq: received unknown report #%d", data[0]); dbg("wacom_intuos_irq: received unknown report #%d", data[0]);
return 0; return 0;
} }
...@@ -494,7 +495,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) ...@@ -494,7 +495,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
idx = data[1] & 0x01; idx = data[1] & 0x01;
/* pad packets. Works as a second tool and is always in prox */ /* pad packets. Works as a second tool and is always in prox */
if (data[0] == WACOM_REPORT_INTUOSPAD) { if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) {
if (features->type >= INTUOS4S && features->type <= INTUOS4L) { if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
input_report_key(input, BTN_0, (data[2] & 0x01)); input_report_key(input, BTN_0, (data[2] & 0x01));
input_report_key(input, BTN_1, (data[3] & 0x01)); input_report_key(input, BTN_1, (data[3] & 0x01));
...@@ -570,6 +571,34 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) ...@@ -570,6 +571,34 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
input_report_key(input, wacom->tool[1], 0); input_report_key(input, wacom->tool[1], 0);
input_report_abs(input, ABS_MISC, 0); input_report_abs(input, ABS_MISC, 0);
} }
} else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
int i;
/* Touch ring mode switch has no capacitive sensor */
input_report_key(input, BTN_0, (data[3] & 0x01));
/*
* ExpressKeys on Intuos5 have a capacitive sensor in
* addition to the mechanical switch. Switch data is
* stored in data[4], capacitive data in data[5].
*/
for (i = 0; i < 8; i++)
input_report_key(input, BTN_1 + i, data[4] & (1 << i));
if (data[2] & 0x80) {
input_report_abs(input, ABS_WHEEL, (data[2] & 0x7f));
} else {
/* Out of proximity, clear wheel value. */
input_report_abs(input, ABS_WHEEL, 0);
}
if (data[2] | (data[3] & 0x01) | data[4]) {
input_report_key(input, wacom->tool[1], 1);
input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
} else {
input_report_key(input, wacom->tool[1], 0);
input_report_abs(input, ABS_MISC, 0);
}
} else { } else {
if (features->type == WACOM_21UX2) { if (features->type == WACOM_21UX2) {
input_report_key(input, BTN_0, (data[5] & 0x01)); input_report_key(input, BTN_0, (data[5] & 0x01));
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#define WACOM_REPORT_INTUOSREAD 5 #define WACOM_REPORT_INTUOSREAD 5
#define WACOM_REPORT_INTUOSWRITE 6 #define WACOM_REPORT_INTUOSWRITE 6
#define WACOM_REPORT_INTUOSPAD 12 #define WACOM_REPORT_INTUOSPAD 12
#define WACOM_REPORT_INTUOS5PAD 3
#define WACOM_REPORT_TPC1FG 6 #define WACOM_REPORT_TPC1FG 6
#define WACOM_REPORT_TPC2FG 13 #define WACOM_REPORT_TPC2FG 13
#define WACOM_REPORT_TPCHID 15 #define WACOM_REPORT_TPCHID 15
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment