diff options
author | pingc <pingc> | 2008-04-02 23:49:00 +0000 |
---|---|---|
committer | pingc <pingc> | 2008-04-02 23:49:00 +0000 |
commit | 70d3dd054e8702767089d1cf5d21ca4ed052ed39 (patch) | |
tree | 05e8ed29eeb0002713189943891af7c739553f01 | |
parent | 425351f22821ade814f7f6412d18c1eb25904661 (diff) | |
download | xf86-input-wacom-70d3dd054e8702767089d1cf5d21ca4ed052ed39.tar.gz |
Minor fixes in wacomcpl and kernelrelease-0.7.9-10
-rw-r--r-- | ChangeLog | 12 | ||||
-rwxr-xr-x | prebuilt/install | 6 | ||||
-rwxr-xr-x | prebuilt/uninstall | 9 | ||||
-rw-r--r-- | src/2.4.22/wacom.c | 51 | ||||
-rw-r--r-- | src/2.4.30x86-64/wacom.c | 43 | ||||
-rw-r--r-- | src/2.4/wacom.c | 51 | ||||
-rw-r--r-- | src/2.6.10/wacom.c | 45 | ||||
-rw-r--r-- | src/2.6.16/wacom_wac.c | 40 | ||||
-rwxr-xr-x | src/2.6.19/wacom_wac.c | 39 | ||||
-rw-r--r-- | src/2.6.8/wacom.c | 42 | ||||
-rw-r--r-- | src/2.6.9/wacom.c | 44 | ||||
-rwxr-xr-x | src/wacomxi/wacomcpl-exec | 8 | ||||
-rwxr-xr-x | src/xdrv/wcmSerial.c | 2 |
13 files changed, 202 insertions, 190 deletions
@@ -1,7 +1,13 @@ +2008-04-03 Ping Cheng <pingc@wacom.com> + * Minor fixes in kernel and wacomcpl + * Removed debug statement in wcmSerial.c + * Label 0.7.9-10 + 2008-03-30 Ping Cheng <pingc@wacom.com> - Updated configure.in for keystrokes (Magnus Vigerlöf) - Added touch support for serial TabletPC (ISDv4) - Added autoprobe patch (Matthias Hopf @ Suse) + * Updated configure.in for keystrokes (Magnus Vigerlöf) + * Added touch support for serial TabletPC (ISDv4) + * Added autoprobe patch (Matthias Hopf @ Suse) + * Label 0.7.9-9 2008-03-07 Ping Cheng <pingc@wacom.com> * Updated wacomcpl for keystrokes diff --git a/prebuilt/install b/prebuilt/install index 659e2af..087db20 100755 --- a/prebuilt/install +++ b/prebuilt/install @@ -1,6 +1,12 @@ #!/bin/bash #install prebuilt wacom X driver and associated utilities +# Make sure the script is running under root +if [ "$(id -u)" != "0" ]; then + echo "This installer must be run as root" 1>&2 + exit +fi + libp="lib" arch=`uname -p` if [ `echo $arch | grep -c "86"` == 0 ]; then diff --git a/prebuilt/uninstall b/prebuilt/uninstall index ff2eb83..1da59e2 100755 --- a/prebuilt/uninstall +++ b/prebuilt/uninstall @@ -1,3 +1,12 @@ +#!/bin/bash +#uninstall prebuilt wacom X driver and associated utilities + +# Make sure the script is running under root +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exit +fi + echo "Removing Wacom X driver related utility programs...." rm -f /usr/local/bin/xsetwacom rm -f /usr/local/bin/wacdump diff --git a/src/2.4.22/wacom.c b/src/2.4.22/wacom.c index 45e8815..538a6b3 100644 --- a/src/2.4.22/wacom.c +++ b/src/2.4.22/wacom.c @@ -207,7 +207,7 @@ static void wacom_pl_irq(struct urb *urb) /* proximity and pressure */ prox = data[1] & 0x40; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char) ((data[7] <<1 ) | ((data[4] >> 2) & 1)); if ( wacom->features->pressure_max > 350 ) { @@ -233,9 +233,9 @@ static void wacom_pl_irq(struct urb *urb) /* was entered with stylus2 pressed */ if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20) ) { /* report out proximity for previous tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[1], 0); - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); wacom->tool[1] = BTN_TOOL_PEN; return; } @@ -243,11 +243,11 @@ static void wacom_pl_irq(struct urb *urb) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 7) | ((__u32)(data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 7) | ((__u32)(data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -263,13 +263,13 @@ static void wacom_pl_irq(struct urb *urb) wacom->tool[1] = BTN_TOOL_PEN; } input_report_key(dev, wacom->tool[1], prox); - input_report_abs(dev, ABS_MISC, id); + input_report_abs(dev, ABS_MISC, wacom->id[0]); } wacom->tool[0] = prox; /* Save proximity state */ /* end of proximity code */ - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); } static void wacom_ptu_irq(struct urb *urb) @@ -277,7 +277,6 @@ static void wacom_ptu_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int id; if (urb->status) return; @@ -292,22 +291,22 @@ static void wacom_ptu_irq(struct urb *urb) { input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] << 8 | data[2]); input_report_abs(dev, ABS_Y, data[5] << 8 | data[4]); input_report_abs(dev, ABS_PRESSURE, (data[6]|(data[7] & 0x01) << 8)); input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x10); - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); } @@ -362,7 +361,7 @@ static void wacom_graphire_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int x, y, id, rw; + int x, y, rw; if (urb->status) return; @@ -376,20 +375,19 @@ static void wacom_graphire_irq(struct urb *urb) return; } - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -405,7 +403,7 @@ static void wacom_graphire_irq(struct urb *urb) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); if ( strstr(wacom->features->name, "Graphire4") || @@ -426,9 +424,9 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { input_report_abs(dev, ABS_X, 0); input_report_abs(dev, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -441,6 +439,7 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS, 0); input_report_key(dev, BTN_STYLUS2, 0); } + wacom->id[0] = 0; input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0); } @@ -449,34 +448,34 @@ static void wacom_graphire_irq(struct urb *urb) /* send pad data */ if ( strstr(wacom->features->name, "Graphire4") ) { if (data[7] & 0xf8) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(dev, REL_WHEEL, rw); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); - } else if ( wacom->id[1] ) { + } else if (wacom->id[1]) { wacom->id[1] = 0; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); input_report_rel(dev, REL_WHEEL, 0); input_report_key(dev, BTN_TOOL_FINGER, 0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, 0); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } } if ( strstr(wacom->features->name, "Bamboo") ) { if ((data[7] & 0xf8) || (data[8] & 0xff)) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x08)); input_report_key(dev, BTN_1, (data[7] & 0x20)); input_report_key(dev, BTN_4, (data[7] & 0x10)); input_report_key(dev, BTN_5, (data[7] & 0x40)); input_report_abs(dev, ABS_WHEEL, (data[8] & 0x7f)); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom->id[1] = 0; diff --git a/src/2.4.30x86-64/wacom.c b/src/2.4.30x86-64/wacom.c index 3b99997..0507272 100644 --- a/src/2.4.30x86-64/wacom.c +++ b/src/2.4.30x86-64/wacom.c @@ -155,7 +155,7 @@ static void wacom_pl_irq(struct urb *urb) /* proximity and pressure */ prox = data[1] & 0x40; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char) ((data[7] <<1 ) | ((data[4] >> 2) & 1)); if ( wacom->features->pressure_max > 350 ) { @@ -181,7 +181,7 @@ static void wacom_pl_irq(struct urb *urb) /* was entered with stylus2 pressed */ if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20) ) { /* report out proximity for previous tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[1], 0); input_event(dev, EV_MSC, MSC_SERIAL, id); wacom->tool[1] = BTN_TOOL_PEN; @@ -191,10 +191,10 @@ static void wacom_pl_irq(struct urb *urb) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 7) | ((__u32)(data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 7) | ((__u32)(data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -224,7 +224,6 @@ static void wacom_ptu_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int id; if (urb->status) return; @@ -238,22 +237,22 @@ static void wacom_ptu_irq(struct urb *urb) { input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] << 8 | data[2]); input_report_abs(dev, ABS_Y, data[5] << 8 | data[4]); input_report_abs(dev, ABS_PRESSURE, (data[6]|data[7] << 8)); input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x10); - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); } @@ -307,7 +306,7 @@ static void wacom_graphire_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int x, y, id, rw; + int x, y, rw; if (urb->status) return; @@ -320,20 +319,19 @@ static void wacom_graphire_irq(struct urb *urb) return; } - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -348,7 +346,7 @@ static void wacom_graphire_irq(struct urb *urb) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); if ( strstr(wacom->features->name, "Graphire4") || @@ -369,9 +367,9 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { input_report_abs(dev, ABS_X, 0); input_report_abs(dev, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -384,21 +382,22 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS, 0); input_report_key(dev, BTN_STYLUS2, 0); } + wacom->id[0] = 0; input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0); } - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL,wacom->id[0]); /* send pad data */ if ( strstr(wacom->features->name, "Graphire4") ) { if (data[7] & 0xf8) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(dev, REL_WHEEL, rw); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if ( wacom->id[1] ) { wacom->id[1] = 0; @@ -412,14 +411,14 @@ static void wacom_graphire_irq(struct urb *urb) } if ( strstr(wacom->features->name, "Bamboo") ) { if ((data[7] & 0xf8) || (data[8] & 0xff)) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x08)); input_report_key(dev, BTN_1, (data[7] & 0x20)); input_report_key(dev, BTN_4, (data[7] & 0x10)); input_report_key(dev, BTN_5, (data[7] & 0x40)); input_report_abs(dev, ABS_WHEEL, (data[8] & 0x7f)); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom->id[1] = 0; diff --git a/src/2.4/wacom.c b/src/2.4/wacom.c index 093cf14..bed3b6c 100644 --- a/src/2.4/wacom.c +++ b/src/2.4/wacom.c @@ -194,7 +194,7 @@ static void wacom_pl_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int prox, pressure, id; + int prox, pressure; if (urb->status) return; @@ -208,7 +208,7 @@ static void wacom_pl_irq(struct urb *urb) /* proximity and pressure */ prox = data[1] & 0x40; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char) ((data[7] <<1 ) | ((data[4] >> 2) & 1)); if ( wacom->features->pressure_max > 350 ) { @@ -235,8 +235,8 @@ static void wacom_pl_irq(struct urb *urb) if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20) ) { /* report out proximity for previous tool */ input_report_key(dev, wacom->tool[1], 0); - input_report_abs(dev, ABS_MISC, id); /* report tool id */ - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); wacom->tool[1] = BTN_TOOL_PEN; return; } @@ -244,11 +244,11 @@ static void wacom_pl_irq(struct urb *urb) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 7) | ((__u32)(data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 7) | ((__u32)(data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -264,7 +264,7 @@ static void wacom_pl_irq(struct urb *urb) wacom->tool[1] = BTN_TOOL_PEN; } input_report_key(dev, wacom->tool[1], prox); - input_report_abs(dev, ABS_MISC, id); + input_report_abs(dev, ABS_MISC, wacom->id[0]); } wacom->tool[0] = prox; /* Save proximity state */ @@ -278,7 +278,6 @@ static void wacom_ptu_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int id; if (urb->status) return; @@ -293,22 +292,22 @@ static void wacom_ptu_irq(struct urb *urb) { input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] << 8 | data[2]); input_report_abs(dev, ABS_Y, data[5] << 8 | data[4]); input_report_abs(dev, ABS_PRESSURE, (data[6]|data[7] << 8)); input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x10); - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); } static void wacom_penpartner_irq(struct urb *urb) @@ -361,7 +360,7 @@ static void wacom_graphire_irq(struct urb *urb) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int x, y, id, rw; + int x, y, rw; if (urb->status) return; @@ -375,20 +374,19 @@ static void wacom_graphire_irq(struct urb *urb) return; } - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -403,7 +401,7 @@ static void wacom_graphire_irq(struct urb *urb) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); if ( strstr(wacom->features->name, "Graphire4") || @@ -424,9 +422,9 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { input_report_abs(dev, ABS_X, 0); input_report_abs(dev, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -439,24 +437,25 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS, 0); input_report_key(dev, BTN_STYLUS2, 0); } + wacom->id[0] = 0; input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0); } - input_event(dev, EV_MSC, MSC_SERIAL, id); + input_event(dev, EV_MSC, MSC_SERIAL, wacom->id[0]); /* send pad data */ if ( strstr(wacom->features->name, "Graphire4") ) { if (data[7] & 0xf8) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(dev, REL_WHEEL, rw); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); - } else if ( wacom->id[1] ) { + } else if (wacom->id[1]) { wacom->id[1] = 0; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); @@ -468,14 +467,14 @@ static void wacom_graphire_irq(struct urb *urb) } if ( strstr(wacom->features->name, "Bamboo") ) { if ((data[7] & 0xf8) || (data[8] & 0xff)) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x08)); input_report_key(dev, BTN_1, (data[7] & 0x20)); input_report_key(dev, BTN_4, (data[7] & 0x10)); input_report_key(dev, BTN_5, (data[7] & 0x40)); input_report_abs(dev, ABS_WHEEL, (data[8] & 0x7f)); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom->id[1] = 0; diff --git a/src/2.6.10/wacom.c b/src/2.6.10/wacom.c index 2194155..2845a42 100644 --- a/src/2.6.10/wacom.c +++ b/src/2.6.10/wacom.c @@ -171,7 +171,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int prox, pressure, id; + int prox, pressure; int retval; switch (urb->status) { @@ -198,7 +198,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); @@ -233,10 +233,10 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -272,7 +272,6 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; int retval; - int id; switch (urb->status) { case 0: @@ -300,15 +299,15 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) { input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); @@ -395,7 +394,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int x, y, id, rw; + int x, y, rw; int retval; switch (urb->status) { @@ -423,21 +422,20 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ + wacom->id[0] = STYLUS_DEVICE_ID; wacom->tool[0] = BTN_TOOL_PEN; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -452,7 +450,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); if ( wacom->features->type == G4 || @@ -473,9 +471,9 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { input_report_abs(dev, ABS_X, 0); input_report_abs(dev, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -488,6 +486,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_key(dev, BTN_STYLUS, 0); input_report_key(dev, BTN_STYLUS2, 0); } + wacom->id[0] = 0; input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0); } @@ -496,33 +495,33 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) /* send pad data */ switch (wacom->features->type) { case G4: - if ( (wacom->serial[1] & 0xc0) != (data[7] & 0xf8) ) { - wacom->id[1] = 1; + if (data[7] & 0xf8) { + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(dev, REL_WHEEL, rw); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); - } else if ( wacom->id[1] ) { + } else if (wacom->id[1]) { wacom->id[1] = 0; input_report_key(dev, BTN_TOOL_FINGER, 0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, 0); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } input_sync(dev); break; case MO: if ((data[7] & 0xf8) || (data[8] & 0xff)) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x08)); input_report_key(dev, BTN_1, (data[7] & 0x20)); input_report_key(dev, BTN_4, (data[7] & 0x10)); input_report_key(dev, BTN_5, (data[7] & 0x40)); input_report_abs(dev, ABS_WHEEL, (data[8] & 0x7f)); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom->id[1] = 0; diff --git a/src/2.6.16/wacom_wac.c b/src/2.6.16/wacom_wac.c index c2a50ff..31d7680 100644 --- a/src/2.6.16/wacom_wac.c +++ b/src/2.6.16/wacom_wac.c @@ -58,7 +58,7 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom, void *wcombo) static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) { unsigned char *data = wacom->data; - int prox, id, pressure; + int prox, pressure; if (data[0] != 2) { dbg("wacom_pl_irq: received unknown report #%d", data[0]); @@ -69,7 +69,7 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) wacom_input_regs(wcombo); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); @@ -103,10 +103,10 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } wacom_report_key(wcombo, wacom->tool[1], prox); /* report in proximity for tool */ - wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */ + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ wacom_report_abs(wcombo, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); wacom_report_abs(wcombo, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); wacom_report_abs(wcombo, ABS_PRESSURE, pressure); @@ -131,7 +131,6 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) { unsigned char *data = wacom->data; - int id; if (data[0] != 2) { printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]); @@ -142,13 +141,13 @@ static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) if (data[1] & 0x04) { wacom_report_key(wcombo, BTN_TOOL_RUBBER, data[1] & 0x20); wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { wacom_report_key(wcombo, BTN_TOOL_PEN, data[1] & 0x20); wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */ + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); wacom_report_abs(wcombo, ABS_PRESSURE, wacom_le16_to_cpu(&data[6])); @@ -160,7 +159,7 @@ static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) { unsigned char *data = wacom->data; - int x, y, id, rw; + int x, y, rw; if (data[0] != 2) { dbg("wacom_graphire_irq: received unknown report #%d", data[0]); @@ -169,21 +168,19 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) wacom_input_regs(wcombo); - id = STYLUS_DEVICE_ID; - - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -198,7 +195,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); if (wacom->features->type == WACOM_G4 || @@ -218,9 +215,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04); } - wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */ + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ wacom_report_key(wcombo, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { wacom_report_abs(wcombo, ABS_X, 0); wacom_report_abs(wcombo, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -233,6 +230,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) wacom_report_key(wcombo, BTN_STYLUS, 0); wacom_report_key(wcombo, BTN_STYLUS2, 0); } + wacom->id[0] = 0; wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ wacom_report_key(wcombo, wacom->tool[0], 0); } @@ -242,13 +240,13 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) case WACOM_G4: if (data[7] & 0xf8) { wacom_input_sync(wcombo); /* sync last event */ - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); wacom_report_rel(wcombo, REL_WHEEL, rw); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); - wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom_input_sync(wcombo); /* sync last event */ @@ -263,14 +261,14 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) case WACOM_MO: if ((data[7] & 0xf8) || (data[8] & 0xff)) { wacom_input_sync(wcombo); /* sync last event */ - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); wacom_report_key(wcombo, BTN_4, (data[7] & 0x10)); wacom_report_key(wcombo, BTN_5, (data[7] & 0x40)); wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f)); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); - wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom_input_sync(wcombo); /* sync last event */ diff --git a/src/2.6.19/wacom_wac.c b/src/2.6.19/wacom_wac.c index 61a179a..6c41f20 100755 --- a/src/2.6.19/wacom_wac.c +++ b/src/2.6.19/wacom_wac.c @@ -56,7 +56,7 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom, void *wcombo) static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) { unsigned char *data = wacom->data; - int prox, id, pressure; + int prox, pressure; if (data[0] != 2) { dbg("wacom_pl_irq: received unknown report #%d", data[0]); @@ -65,7 +65,7 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) prox = data[1] & 0x40; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); @@ -99,10 +99,10 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } wacom_report_key(wcombo, wacom->tool[1], prox); /* report in proximity for tool */ - wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */ + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ wacom_report_abs(wcombo, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); wacom_report_abs(wcombo, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); wacom_report_abs(wcombo, ABS_PRESSURE, pressure); @@ -127,7 +127,6 @@ static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo) static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) { unsigned char *data = wacom->data; - int id; if (data[0] != 2) { printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]); @@ -137,13 +136,13 @@ static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) if (data[1] & 0x04) { wacom_report_key(wcombo, BTN_TOOL_RUBBER, data[1] & 0x20); wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { wacom_report_key(wcombo, BTN_TOOL_PEN, data[1] & 0x20); wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */ + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); wacom_report_abs(wcombo, ABS_PRESSURE, wacom_le16_to_cpu(&data[6])); @@ -155,27 +154,26 @@ static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo) static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) { unsigned char *data = wacom->data; - int x, y, id, rw; + int x, y, rw; if (data[0] != 2) { dbg("wacom_graphire_irq: received unknown report #%d", data[0]); return 0; } - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -190,7 +188,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); if (wacom->features->type == WACOM_G4 || @@ -210,9 +208,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04); } - wacom_report_abs(wcombo, ABS_MISC, id); /* report tool id */ + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ wacom_report_key(wcombo, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { wacom_report_abs(wcombo, ABS_X, 0); wacom_report_abs(wcombo, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -225,6 +223,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) wacom_report_key(wcombo, BTN_STYLUS, 0); wacom_report_key(wcombo, BTN_STYLUS2, 0); } + wacom->id[0] = 0; wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ wacom_report_key(wcombo, wacom->tool[0], 0); } @@ -234,13 +233,13 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) case WACOM_G4: if (data[7] & 0xf8) { wacom_input_sync(wcombo); /* sync last event */ - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); wacom_report_rel(wcombo, REL_WHEEL, rw); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); - wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom_input_sync(wcombo); /* sync last event */ @@ -255,14 +254,14 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) case WACOM_MO: if ((data[7] & 0xf8) || (data[8] & 0xff)) { wacom_input_sync(wcombo); /* sync last event */ - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); wacom_report_key(wcombo, BTN_4, (data[7] & 0x10)); wacom_report_key(wcombo, BTN_5, (data[7] & 0x40)); wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f)); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); - wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom_input_sync(wcombo); /* sync last event */ diff --git a/src/2.6.8/wacom.c b/src/2.6.8/wacom.c index c283815..a1ca478 100644 --- a/src/2.6.8/wacom.c +++ b/src/2.6.8/wacom.c @@ -172,7 +172,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int prox, pressure, id; + int prox, pressure; int retval; switch (urb->status) { @@ -199,7 +199,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); @@ -234,10 +234,10 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -272,7 +272,7 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int retval, id; + int retval; switch (urb->status) { case 0: @@ -299,15 +299,15 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) { input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, le16_to_cpu(*(u16 *) &data[2])); input_report_abs(dev, ABS_Y, le16_to_cpu(*(u16 *) &data[4])); input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(u16 *) &data[6])); @@ -394,7 +394,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int x, y, id, rw; + int x, y, rw; int retval; switch (urb->status) { @@ -422,20 +422,19 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -450,7 +449,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); if ( wacom->features->type == G4 || @@ -471,9 +470,9 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { input_report_abs(dev, ABS_X, 0); input_report_abs(dev, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -486,6 +485,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_key(dev, BTN_STYLUS, 0); input_report_key(dev, BTN_STYLUS2, 0); } + wacom->id[0] = 0; input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0); } @@ -495,15 +495,15 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) switch (wacom->features->type) { case G4: if ( (wacom->serial[1] & 0xc0) != (data[7] & 0xf8) ) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(dev, REL_WHEEL, rw); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); - } else if ( wacom->id[1] ) { + } else if (wacom->id[1]) { wacom->id[1] = 0; input_report_key(dev, BTN_TOOL_FINGER, 0); input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); @@ -513,14 +513,14 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) break; case MO: if ((data[7] & 0xf8) || (data[8] & 0xff)) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x08)); input_report_key(dev, BTN_1, (data[7] & 0x20)); input_report_key(dev, BTN_4, (data[7] & 0x10)); input_report_key(dev, BTN_5, (data[7] & 0x40)); input_report_abs(dev, ABS_WHEEL, (data[8] & 0x7f)); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom->id[1] = 0; diff --git a/src/2.6.9/wacom.c b/src/2.6.9/wacom.c index f4ab78d..407e13a 100644 --- a/src/2.6.9/wacom.c +++ b/src/2.6.9/wacom.c @@ -171,7 +171,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int prox, pressure, id; + int prox, pressure; int retval; switch (urb->status) { @@ -198,7 +198,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; if (prox) { pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); @@ -233,10 +233,10 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -271,7 +271,7 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int retval, id; + int retval; switch (urb->status) { case 0: @@ -299,15 +299,15 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) { input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; } else { input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); - id = STYLUS_DEVICE_ID; + wacom->id[0] = STYLUS_DEVICE_ID; } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); @@ -394,7 +394,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; - int x, y, id, rw; + int x, y, rw; int retval; switch (urb->status) { @@ -422,20 +422,19 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = STYLUS_DEVICE_ID; - if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4] - || data[5] || data[6] || (data[7] & 0x07))) { + if (data[1] & 0x80) { /* in prox and not a pad data */ switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; break; case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; + wacom->id[0] = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ @@ -450,7 +449,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; + wacom->id[0] = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); if ( wacom->features->type == G4 || @@ -471,9 +470,9 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } - input_report_abs(dev, ABS_MISC, id); /* report tool id */ + input_report_abs(dev, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(dev, wacom->tool[0], 1); - } else if (!(data[1] & 0x90)) { + } else if (wacom->id[0]) { input_report_abs(dev, ABS_X, 0); input_report_abs(dev, ABS_Y, 0); if (wacom->tool[0] == BTN_TOOL_MOUSE) { @@ -486,6 +485,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_key(dev, BTN_STYLUS, 0); input_report_key(dev, BTN_STYLUS2, 0); } + wacom->id[0] = 0; input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ input_report_key(dev, wacom->tool[0], 0); } @@ -494,33 +494,33 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) /* send pad data */ switch (wacom->features->type) { case G4: - if ( (wacom->serial[1] & 0xc0) != (data[7] & 0xf8) ) { - wacom->id[1] = 1; + if (data[7] & 0xf8) { + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x40)); input_report_key(dev, BTN_4, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(dev, REL_WHEEL, rw); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if ( wacom->id[1] ) { wacom->id[1] = 0; input_report_key(dev, BTN_TOOL_FINGER, 0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, 0); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } input_sync(dev); break; case MO: if ((data[7] & 0xf8) || (data[8] & 0xff)) { - wacom->id[1] = 1; + wacom->id[1] = PAD_DEVICE_ID; input_report_key(dev, BTN_0, (data[7] & 0x08)); input_report_key(dev, BTN_1, (data[7] & 0x20)); input_report_key(dev, BTN_4, (data[7] & 0x10)); input_report_key(dev, BTN_5, (data[7] & 0x40)); input_report_abs(dev, ABS_WHEEL, (data[8] & 0x7f)); input_report_key(dev, BTN_TOOL_FINGER, 0xf0); - input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID); + input_report_abs(dev, ABS_MISC, wacom->id[1]); input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); } else if (wacom->id[1]) { wacom->id[1] = 0; diff --git a/src/wacomxi/wacomcpl-exec b/src/wacomxi/wacomcpl-exec index 92a775e..a8cc702 100755 --- a/src/wacomxi/wacomcpl-exec +++ b/src/wacomxi/wacomcpl-exec @@ -897,8 +897,8 @@ proc expressKeys { } { set name(1) "Wheel Up" set name(2) "Wheel Down" - set name(3) "Ring Clockwise" - set name(4) "Ring Anticlockwise" + set name(3) "Ring Anticlockwise" + set name(4) "Ring Clockwise" set name(5) "Left Strip Up" set name(6) "Left Strip Down" set name(7) "Right Strip Up" @@ -918,8 +918,8 @@ proc expressKeys { } { set oldKeys($spName($curOption)) "" } set bmenu [ tk_optionMenu $currentW.f.$cur db$cur $db(1) $db(2) \ - $db(3) $db(4) $db(5) $db($displayToggleB) $db($ignoreButton) ] - $bmenu insert 8 radiobutton -label "$db($keystrokeB)" \ + $db(3) $db(4) $db(5) $db($ignoreButton) ] + $bmenu insert 7 radiobutton -label "$db($keystrokeB)" \ -variable menvar -command "displaySubWindow \ updateKeys 0 initialKeys 5 $cur $curOption" diff --git a/src/xdrv/wcmSerial.c b/src/xdrv/wcmSerial.c index 7bb071b..6370ed3 100755 --- a/src/xdrv/wcmSerial.c +++ b/src/xdrv/wcmSerial.c @@ -364,7 +364,6 @@ char* xf86WcmSendRequest(int fd, const char* request, char* answer, int maxlen) len++; } -ErrorF("Wacom xf86WcmWaitForTablet : %s\n", answer); if ((nr = xf86WaitForInput(fd, 1000000)) > 0) { nr = xf86WcmRead(fd, answer+len, 1); @@ -375,7 +374,6 @@ ErrorF("Wacom xf86WcmWaitForTablet : %s\n", answer); return NULL; } } -ErrorF("Wacom xf86WcmRead : %s\n", answer); if (nr > 0) { |