mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
Input: wacom - separate pen from express keys on Graphire
Since Graphire/Bamboo devices report pen and expresskeys in the same data packet, we need to send a input_sync event to separate pen data from expresskeys for X11 driver to process them properly. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
cad7470084
commit
0f5e182dff
1 changed files with 23 additions and 4 deletions
|
@ -154,6 +154,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
|
||||||
{
|
{
|
||||||
unsigned char *data = wacom->data;
|
unsigned char *data = wacom->data;
|
||||||
int x, y, rw;
|
int x, y, rw;
|
||||||
|
static int penData = 0;
|
||||||
|
|
||||||
if (data[0] != WACOM_REPORT_PENABLED) {
|
if (data[0] != WACOM_REPORT_PENABLED) {
|
||||||
dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
|
dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
|
||||||
|
@ -162,6 +163,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
|
||||||
|
|
||||||
if (data[1] & 0x80) {
|
if (data[1] & 0x80) {
|
||||||
/* in prox and not a pad data */
|
/* in prox and not a pad data */
|
||||||
|
penData = 1;
|
||||||
|
|
||||||
switch ((data[1] >> 5) & 3) {
|
switch ((data[1] >> 5) & 3) {
|
||||||
|
|
||||||
|
@ -231,7 +233,11 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
|
||||||
switch (wacom->features->type) {
|
switch (wacom->features->type) {
|
||||||
case WACOM_G4:
|
case WACOM_G4:
|
||||||
if (data[7] & 0xf8) {
|
if (data[7] & 0xf8) {
|
||||||
wacom_input_sync(wcombo); /* sync last event */
|
if (penData) {
|
||||||
|
wacom_input_sync(wcombo); /* sync last event */
|
||||||
|
if (!wacom->id[0])
|
||||||
|
penData = 0;
|
||||||
|
}
|
||||||
wacom->id[1] = PAD_DEVICE_ID;
|
wacom->id[1] = PAD_DEVICE_ID;
|
||||||
wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
|
wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
|
||||||
wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
|
wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
|
||||||
|
@ -241,10 +247,15 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
|
||||||
wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
|
wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
|
||||||
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
|
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
|
||||||
} else if (wacom->id[1]) {
|
} else if (wacom->id[1]) {
|
||||||
wacom_input_sync(wcombo); /* sync last event */
|
if (penData) {
|
||||||
|
wacom_input_sync(wcombo); /* sync last event */
|
||||||
|
if (!wacom->id[0])
|
||||||
|
penData = 0;
|
||||||
|
}
|
||||||
wacom->id[1] = 0;
|
wacom->id[1] = 0;
|
||||||
wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
|
wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
|
||||||
wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
|
wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
|
||||||
|
wacom_report_rel(wcombo, REL_WHEEL, 0);
|
||||||
wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
|
wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
|
||||||
wacom_report_abs(wcombo, ABS_MISC, 0);
|
wacom_report_abs(wcombo, ABS_MISC, 0);
|
||||||
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
|
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
|
||||||
|
@ -252,7 +263,11 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
|
||||||
break;
|
break;
|
||||||
case WACOM_MO:
|
case WACOM_MO:
|
||||||
if ((data[7] & 0xf8) || (data[8] & 0xff)) {
|
if ((data[7] & 0xf8) || (data[8] & 0xff)) {
|
||||||
wacom_input_sync(wcombo); /* sync last event */
|
if (penData) {
|
||||||
|
wacom_input_sync(wcombo); /* sync last event */
|
||||||
|
if (!wacom->id[0])
|
||||||
|
penData = 0;
|
||||||
|
}
|
||||||
wacom->id[1] = PAD_DEVICE_ID;
|
wacom->id[1] = PAD_DEVICE_ID;
|
||||||
wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
|
wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
|
||||||
wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
|
wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
|
||||||
|
@ -263,7 +278,11 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
|
||||||
wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
|
wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
|
||||||
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
|
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
|
||||||
} else if (wacom->id[1]) {
|
} else if (wacom->id[1]) {
|
||||||
wacom_input_sync(wcombo); /* sync last event */
|
if (penData) {
|
||||||
|
wacom_input_sync(wcombo); /* sync last event */
|
||||||
|
if (!wacom->id[0])
|
||||||
|
penData = 0;
|
||||||
|
}
|
||||||
wacom->id[1] = 0;
|
wacom->id[1] = 0;
|
||||||
wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
|
wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
|
||||||
wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
|
wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
|
||||||
|
|
Loading…
Reference in a new issue