summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--configure.in131
-rw-r--r--src/2.6.10/wacom.c170
-rwxr-xr-xsrc/2.6.11/wacom.h6
-rwxr-xr-xsrc/2.6.11/wacom_sys.c22
-rwxr-xr-xsrc/2.6.13/wacom.h6
-rwxr-xr-xsrc/2.6.13/wacom_sys.c22
-rwxr-xr-xsrc/2.6.15/wacom_sys.c27
-rw-r--r--src/2.6.16/wacom.h6
-rw-r--r--src/2.6.16/wacom_sys.c22
-rw-r--r--src/2.6.16/wacom_wac.c256
-rw-r--r--src/2.6.16/wacom_wac.h5
-rw-r--r--src/2.6.18/wacom.h6
-rwxr-xr-xsrc/2.6.19/wacom.h6
-rwxr-xr-xsrc/2.6.19/wacom_sys.c22
-rwxr-xr-xsrc/2.6.19/wacom_wac.c257
-rwxr-xr-xsrc/2.6.22/wacom_sys.c22
-rwxr-xr-xsrc/2.6.22/wacom_wac.h3
-rwxr-xr-xsrc/2.6.24/wacom_sys.c22
-rwxr-xr-xsrc/2.6.26/wacom.h6
-rwxr-xr-xsrc/2.6.26/wacom_sys.c22
-rwxr-xr-xsrc/2.6.27/wacom.h6
-rwxr-xr-xsrc/2.6.27/wacom_sys.c22
-rw-r--r--src/2.6.9/wacom.c164
-rwxr-xr-xsrc/include/Xwacom.h6
-rwxr-xr-xsrc/util/Makefile.am8
-rwxr-xr-xsrc/util/wacusb.c16
-rwxr-xr-xsrc/util/xidump.c55
-rwxr-xr-xsrc/util/xsetwacom.c45
-rw-r--r--src/wacom.4x14
-rwxr-xr-xsrc/wacomxi/wacomcpl-exec77
-rwxr-xr-xsrc/xdrv/Makefile.am4
-rwxr-xr-xsrc/xdrv/wcmCommon.c317
-rwxr-xr-xsrc/xdrv/wcmConfig.c46
-rwxr-xr-xsrc/xdrv/wcmUSB.c65
-rw-r--r--src/xdrv/wcmXCommand.c48
-rwxr-xr-xsrc/xdrv/xf86Wacom.c255
-rwxr-xr-xsrc/xdrv/xf86WacomDefs.h4
38 files changed, 1436 insertions, 766 deletions
diff --git a/ChangeLog b/ChangeLog
index ec8a954..f9fb710 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-03-26 Ping Cheng <pingc@wacom.com>
+ * Patch "Don't touch the button map" from Thomas Jaeger
+ * Patch 2653696 from Matthew Garret
+ * Patch 2653697 from Peter Hutterer
+ * Removed kernels 2.4.x and 2.6.8 support
+ * Updated TwinView and Xinerama mapping
+ * Bug 2517856 fixed by Calvin Walton
+ * Fixed bug 2578477
+ * Support Intuos4
+ * Label 0.8.3
+
2009-01-19 Ping Cheng <pingc@wacom.com>
* Patch to support Xorg server 1.6 from Alexia Death
* Patch for "usbParse: Exceeded channel" workaround from Markus Gaugusch
diff --git a/configure.in b/configure.in
index 41f8699..3601d69 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
AC_PREREQ(2.58)
-AC_INIT(linuxwacom, 0.8.2)
+AC_INIT(linuxwacom, 0.8.3)
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
@@ -80,10 +80,6 @@ dnl Enable linux specific features if linux kernel is detected.
dnl kernel source, module versioning, etc
WCM_OPTION_WACOM=no
WCM_OPTION_HID=no
-WCM_OPTION_USBMOUSE=no
-WCM_OPTION_EVDEV=no
-WCM_OPTION_MOUSEDEV=no
-WCM_OPTION_INPUT=no
WCM_OPTION_MODVER=no
WCM_PATCH_HID=
WCM_ENV_KERNEL=no
@@ -108,7 +104,7 @@ else
WCM_KERNEL_DIR=
dnl Kernel source not specified, guess where it is
for i in /lib/modules/`uname -r`/source /lib/modules/`uname -r`/build \
- /usr/src/linux /usr/src/linux-`uname -r` /usr/src/linux-2.4 \
+ /usr/src/linux /usr/src/linux-`uname -r` \
/usr/src/linux-2.6; do
if test -f "$i/include/linux/input.h"; then
WCM_KERNEL_DIR=$i
@@ -123,7 +119,7 @@ else
echo "*** WARNING:"
echo "*** Unable to guess kernel source directory"
echo "*** Looked at /lib/modules/`uname -r`/source, /lib/modules/`uname -r`/build,"
- echo "*** /usr/src/linux, /usr/src/linux-`uname -r`, /usr/src/linux-2.4, and"
+ echo "*** /usr/src/linux, /usr/src/linux-`uname -r`, and"
echo "*** /usr/src/linux-2.6"
echo "*** Kernel modules will not be built"
echo "***"
@@ -155,17 +151,10 @@ else
AC_MSG_RESULT([$MODUTS])
MINOR=`echo $MODUTS | sed 's/[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*/\1/'`
if echo $MODUTS | grep "^2.4" >/dev/null; then
- WCM_KERNEL_VER="2.4"
- test $MINOR -ge 20 && WCM_PATCH_HID="(value_patch)"
- test $MINOR -ge 22 && WCM_KERNEL_VER="2.4.22"
- if echo $WCM_ARCHITECTURE | grep "x86_64" >/dev/null; then
- AC_MSG_WARN([module compilation not supported on x86-64 for Linux 2.4-kernels ])
- WCM_KERNEL_VER=
- fi
+ AC_MSG_WARN([support for kernel 2.4.x has been dropped after 0.8.2])
elif echo $MODUTS | grep "^2.6" >/dev/null; then
- if test $MINOR -ge 8; then
+ if test $MINOR -ge 9; then
case $MINOR in
- 8) WCM_KERNEL_VER="2.6.8";;
9) WCM_KERNEL_VER="2.6.9";;
10) WCM_KERNEL_VER="2.6.10";;
11|12) WCM_KERNEL_VER="2.6.11";;
@@ -181,7 +170,7 @@ else
*) WCM_KERNEL_VER="2.6.27";;
esac
else
- AC_MSG_WARN([support for kernels older than 2.6.8 has been dropped after 0.7.4])
+ AC_MSG_WARN([support for kernels older than 2.6.9 has been dropped after 0.7.4])
fi
else
AC_MSG_WARN(kernel version $MODUTS not supported)
@@ -213,80 +202,7 @@ else
if test "$WCM_OPTION_WACOM" = yes; then
WCM_MODULES="$WCM_MODULES wacom.o"
fi
- if echo $WCM_KERNEL_VER | grep "^2.4" >/dev/null; then
- AC_ARG_ENABLE(usbmouse,
- AC_HELP_STRING([--enable-usbmouse], [Enable building usbmouse.o [[default=no]]]),
- WCM_OPTION_USBMOUSE=$enable_usbmouse)
- AC_ARG_ENABLE(evdev,
- AC_HELP_STRING([--enable-evdev], [Enable building evdev.o [[default=no]]]),
- WCM_OPTION_EVDEV=$enable_evdev)
- AC_ARG_ENABLE(mousedev,
- AC_HELP_STRING([--enable-mousedev], [Enable building mousedev.o [[default=no]]]),
- WCM_OPTION_MOUSEDEV=$enable_mousedev)
- AC_ARG_ENABLE(input,
- AC_HELP_STRING([--enable-input], [Enable building input.o [[default=no]]]),
- WCM_OPTION_INPUT=$enable_input)
- AC_ARG_ENABLE(modver,
- AC_HELP_STRING([--enable-modver], [Enable kernel module versioning [[default=usually]]]),
- WCM_OPTION_MODVER=$enable_modver, WCM_OPTION_MODVER=yes)
-
- WCM_KSTACK="-mpreferred-stack-boundary=2"
- if test "$WCM_OPTION_EVDEV" = yes; then
- WCM_MODULES="$WCM_MODULES evdev.o"
- fi
- if test "$WCM_OPTION_USBMOUSE" = yes; then
- if test "$WCM_KERNEL_VER" = "2.4.22"; then
- if test -f $WCM_KERNEL_DIR/drivers/usb/usbmouse.c; then
- cp $WCM_KERNEL_DIR/drivers/usb/usbmouse.c src/$WCM_KERNEL_VER
- WCM_MODULES="$WCM_MODULES usbmouse.o"
- else
- AC_MSG_WARN(usbmouse.c not found in kernel source)
- WCM_OPTION_USBMOUSE=no
- fi
- else
- WCM_MODULES="$WCM_MODULES usbmouse.o"
- fi
- fi
- if test "$WCM_OPTION_MOUSEDEV" = yes; then
- WCM_MODULES="$WCM_MODULES mousedev.o"
- fi
- if test "$WCM_OPTION_INPUT" = yes; then
- if test "$WCM_KERNEL_VER" = "2.4.22"; then
- if test -f $WCM_KERNEL_DIR/drivers/input/input.c; then
- cp $WCM_KERNEL_DIR/drivers/input/input.c src/$WCM_KERNEL_VER
- WCM_MODULES="$WCM_MODULES input.o"
- else
- AC_MSG_WARN(input.c not found in kernel source)
- WCM_OPTION_INPUT=no
- fi
- else
- WCM_MODULES="$WCM_MODULES input.o"
- fi
- fi
- if test "$WCM_OPTION_HID" = yes; then
- if test "$WCM_KERNEL_VER" = "2.4.22"; then
- if test -f $WCM_KERNEL_DIR/drivers/usb/hid-input.c; then
- cp $WCM_KERNEL_DIR/drivers/usb/hid-input.c src/$WCM_KERNEL_VER
- cp $WCM_KERNEL_DIR/drivers/usb/hiddev.c src/$WCM_KERNEL_VER
- WCM_MODULES="$WCM_MODULES hid.o"
- else
- AC_MSG_WARN(hid-input.c/hiddev.c not found in kernel source)
- WCM_OPTION_HID=no
- fi
- else
- WCM_MODULES="$WCM_MODULES hid.o"
- fi
-
- if echo "$WCM_PATCH_HID" | grep value_patch >/dev/null; then
- AC_DEFINE(WCM_PATCH_DRVALUE,1,[Need the dr.wValue patch])
- else
- AC_DEFINE(WCM_PATCH_DRVALUE,0,[Need the dr.wValue patch])
- fi
- fi
- if test $WCM_OPTION_MODVER = yes; then
- WCM_MODVER="-DCONFIG_MODVERSIONS -DMODVERSIONS -include $WCM_KERNEL_DIR/include/linux/modversions.h"
- fi
- elif echo $WCM_KERNEL_VER | grep "^2.6" >/dev/null 2>&1; then
+ if echo $WCM_KERNEL_VER | grep "^2.6" >/dev/null 2>&1; then
MINOR=`echo $WCM_KERNEL_VER | cut -f 3 -d.`
if test $MINOR -ge 18; then
WCM_OPTION_HID=no
@@ -421,6 +337,11 @@ if test "$WCM_ENV_XFREE86" = yes; then
else
AM_CONDITIONAL(WCM_ENV_XFREE86, false)
fi
+
+PKG_CHECK_MODULES(HAL, [hal])
+AC_SUBST([HAL_CFLAGS])
+AC_SUBST([HAL_LIBS])
+
dnl Check for X.org SDK
if test "$WCM_ENV_XFREE86" != yes; then
AC_ARG_WITH(xorg-sdk,
@@ -536,7 +457,10 @@ if test "$WCM_ENV_XFREE86" != yes; then
], , [WCM_XORG_XSERVER_1_6=yes], [WCM_XORG_XSERVER_1_6=no])
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($WCM_XORG_XSERVER_1_6)
- AC_MSG_CHECKING([if Xorg SDK defines IsXExtensionPointer])
+ if test "$WCM_XORG_XSERVER_1_6" = "yes"; then
+ AC_DEFINE(WCM_XORG_XSERVER_1_6, 1,
+ [Using version 1.6 or later of X.org])
+ fi
save_CFLAGS="$CFLAGS"
CFLAGS="-I$WCM_XORGSDK_DIR $CFLAGS"
AC_TRY_COMPILE([
@@ -1013,19 +937,12 @@ AC_SUBST(WCM_XSETWACOM_LIBS)
AC_SUBST(WCM_DEPFLAGS)
AC_SUBST(WCM_OPTION_WACOM)
AC_SUBST(WCM_OPTION_HID)
-AC_SUBST(WCM_OPTION_EVDEV)
-AC_SUBST(WCM_OPTION_MOUSEDEV)
-AC_SUBST(WCM_OPTION_USBMOUSE)
-AC_SUBST(WCM_OPTION_INPUT)
AC_OUTPUT(Makefile
mkxincludes
src/Makefile
src/util/Makefile
src/xdrv/Makefile
- src/2.4/Makefile
- src/2.4.22/Makefile
- src/2.6.8/Makefile
src/2.6.9/Makefile
src/2.6.10/Makefile
src/2.6.11/Makefile
@@ -1067,10 +984,6 @@ echo " libwacomcfg - $WCM_OPTION_LIBWACOMCFG"
echo " libwacomxi - $WCM_OPTION_LIBWACOMXI"
echo " xsetwacom - $WCM_OPTION_XSETWACOM"
echo " hid.o - $WCM_OPTION_HID $WCM_PATCH_HID"
-echo " usbmouse.o - $WCM_OPTION_USBMOUSE"
-echo " evdev.o - $WCM_OPTION_EVDEV"
-echo " mousedev.o - $WCM_OPTION_MOUSEDEV"
-echo " input.o - $WCM_OPTION_INPUT"
if test "$WCM_OPTION_DLLOADER" = "yes" ; then
echo " wacom_drv.so - $WCM_OPTION_WACOMDRV $WCM_MODDIR $WCM_PATCH_WACOMDRV"
echo " wacom_drv.o - no"
@@ -1080,15 +993,3 @@ echo " wacom_drv.o - $WCM_OPTION_WACOMDRV $WCM_MODDIR $WCM_PATCH_WACOMDRV
fi
echo " wacom*_drv quirks -$WCM_XDRIVER_QUIRKS"
echo "----------------------------------------"
-
-dnl Check for x86_64 kernel
-if echo $WCM_KERNEL_VER | grep "2.4" >/dev/null && echo "$WCM_ARCHITECTURE" | grep "x86_64" >/dev/null; then
- echo ""
- echo "***"
- echo "*** Note:"
- echo "*** For x86-64 kernel, we only support kernel 2.4.30 and kernel 2.6.* "
- echo "*** To compile Wacom related kernel 2.4.30 modules for x86-64, you need to "
- echo "*** copy the source files from src/2.4.30x86-64 to your kernel source tree "
- echo "*** and build the drivers there "
- echo "*** "
-fi
diff --git a/src/2.6.10/wacom.c b/src/2.6.10/wacom.c
index 2b20091..3a35c5e 100644
--- a/src/2.6.10/wacom.c
+++ b/src/2.6.10/wacom.c
@@ -9,7 +9,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -67,6 +67,7 @@
* v1.40-2.6.10-pc-0.10 - Added Bamboo
* v1.40-2.6.10-pc-0.11 - added Bamboo1, Bamboo Fun, and Hummingbird
* v1.40-2.6.10-pc-0.12 - Added Cintiq 20WSX
+ * v1.40-2.6.10-pc-0.13 - Added Intuos4
*/
/*
@@ -114,6 +115,9 @@ enum {
INTUOS3,
INTUOS3L,
CINTIQ,
+ INTUOS4S,
+ INTUOS4,
+ INTUOS4L,
MO,
BEE,
MAX_TYPE
@@ -131,7 +135,7 @@ struct wacom_features {
};
struct wacom {
- signed char *data;
+ unsigned char *data;
dma_addr_t data_dma;
struct input_dev dev;
struct usb_device *usbdev;
@@ -567,6 +571,7 @@ static int wacom_intuos_inout(struct urb *urb)
switch (wacom->id[idx]) {
case 0x812: /* Inking pen */
case 0x801: /* Intuos3 Inking pen */
+ case 0x20802: /* Intuos4 Inking Pen */
case 0x012:
wacom->tool[idx] = BTN_TOOL_PENCIL;
break;
@@ -576,6 +581,9 @@ static int wacom_intuos_inout(struct urb *urb)
case 0x823: /* Intuos3 Grip Pen */
case 0x813: /* Intuos3 Classic Pen */
case 0x885: /* Intuos3 Marker Pen */
+ case 0x802: /* Intuos4 Grip Pen Eraser */
+ case 0x804: /* Intuos4 Marker Pen */
+ case 0x40802: /* Intuos4 Classic Pen */
case 0x022:
wacom->tool[idx] = BTN_TOOL_PEN;
break;
@@ -586,11 +594,13 @@ static int wacom_intuos_inout(struct urb *urb)
case 0x007: /* Mouse 4D and 2D */
case 0x09c:
case 0x094:
+ case 0x806: /* Intuos4 Mouse */
case 0x017: /* Intuos3 2D Mouse */
wacom->tool[idx] = BTN_TOOL_MOUSE;
break;
case 0x096: /* Lens cursor */
case 0x097: /* Intuos3 Lens cursor */
+ case 0x006: /* Intuos4 Lens cursor */
wacom->tool[idx] = BTN_TOOL_LENS;
break;
case 0x82a: /* Eraser */
@@ -601,12 +611,17 @@ static int wacom_intuos_inout(struct urb *urb)
case 0x82b: /* Intuos3 Grip Pen Eraser */
case 0x81b: /* Intuos3 Classic Pen Eraser */
case 0x91b: /* Intuos3 Airbrush Eraser */
+ case 0x80c: /* Intuos4 Marker Pen Eraser */
+ case 0x80a: /* Intuos4 Grip Pen Eraser */
+ case 0x4080a: /* Intuos4 Classic Pen Eraser */
+ case 0x90a: /* Intuos4 Airbrush Eraser */
wacom->tool[idx] = BTN_TOOL_RUBBER;
break;
case 0xd12: /* Airbrush */
case 0x912:
case 0x112:
case 0x913: /* Intuos3 Airbrush */
+ case 0x902: /* Intuos4 Airbrush */
wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
break;
default: /* Unknown tool */
@@ -658,6 +673,8 @@ static void wacom_intuos_general(struct urb *urb)
if ((data[1] & 0xb8) == 0xa0)
{
t = (data[6] << 2) | ((data[7] >> 6) & 3);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L)
+ t = (t << 1) | (data[1] & 1);
input_report_abs(dev, ABS_PRESSURE, t);
input_report_abs(dev, ABS_TILT_X,
((data[7] << 1) & 0x7e) | (data[8] >> 7));
@@ -720,26 +737,50 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
if (wacom->tool[1] != BTN_TOOL_FINGER)
wacom->tool[1] = BTN_TOOL_FINGER;
- input_report_key(dev, BTN_0, (data[5] & 0x01));
- input_report_key(dev, BTN_1, (data[5] & 0x02));
- input_report_key(dev, BTN_2, (data[5] & 0x04));
- input_report_key(dev, BTN_3, (data[5] & 0x08));
- input_report_key(dev, BTN_4, (data[6] & 0x01));
- input_report_key(dev, BTN_5, (data[6] & 0x02));
- input_report_key(dev, BTN_6, (data[6] & 0x04));
- input_report_key(dev, BTN_7, (data[6] & 0x08));
- input_report_key(dev, BTN_8, (data[5] & 0x10));
- input_report_key(dev, BTN_9, (data[6] & 0x10));
- input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
- input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
-
- if((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
- data[2] | (data[3] & 0x1f) | data[4]) {
- input_report_key(dev, wacom->tool[1], 1);
- input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ input_report_key(dev, BTN_0, (data[2] & 0x01));
+ input_report_key(dev, BTN_1, (data[3] & 0x01));
+ input_report_key(dev, BTN_2, (data[3] & 0x02));
+ input_report_key(dev, BTN_3, (data[3] & 0x04));
+ input_report_key(dev, BTN_4, (data[3] & 0x08));
+ input_report_key(dev, BTN_5, (data[3] & 0x10));
+ input_report_key(dev, BTN_6, (data[3] & 0x20));
+ if (data[1] & 0x80) {
+ input_report_abs(dev, ABS_WHEEL, (data[1] & 0x7f));
+ }
+ if (wacom->features->type != INTUOS4S) {
+ input_report_key(dev, BTN_7, (data[3] & 0x40));
+ input_report_key(dev, BTN_8, (data[3] & 0x80));
+ }
+ if (data[1] | (data[2] & 0x01) | data[3]) {
+ input_report_key(dev, wacom->tool[1], 1);
+ input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ input_report_key(dev, wacom->tool[1], 0);
+ input_report_abs(dev, ABS_MISC, 0);
+ }
} else {
- input_report_key(dev, wacom->tool[1], 0);
- input_report_abs(dev, ABS_MISC, 0);
+ input_report_key(dev, BTN_0, (data[5] & 0x01));
+ input_report_key(dev, BTN_1, (data[5] & 0x02));
+ input_report_key(dev, BTN_2, (data[5] & 0x04));
+ input_report_key(dev, BTN_3, (data[5] & 0x08));
+ input_report_key(dev, BTN_4, (data[6] & 0x01));
+ input_report_key(dev, BTN_5, (data[6] & 0x02));
+ input_report_key(dev, BTN_6, (data[6] & 0x04));
+ input_report_key(dev, BTN_7, (data[6] & 0x08));
+ input_report_key(dev, BTN_8, (data[5] & 0x10));
+ input_report_key(dev, BTN_9, (data[6] & 0x10));
+ input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
+ input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
+
+ if((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
+ data[2] | (data[3] & 0x1f) | data[4]) {
+ input_report_key(dev, wacom->tool[1], 1);
+ input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ input_report_key(dev, wacom->tool[1], 0);
+ input_report_abs(dev, ABS_MISC, 0);
+ }
}
input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff);
input_sync(dev);
@@ -749,10 +790,15 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) goto exit;
- /* Only large I3 and I1 & I2 support Lense Cursor */
+ /* don't proceed if we don't know the ID */
+ if (!wacom->id[idx]) goto exit;
+
+ /* Only large Intuos support Lense Cursor */
if((wacom->tool[idx] == BTN_TOOL_LENS)
&& ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))
+ || (wacom->features->type == INTUOS3S)
+ || (wacom->features->type == INTUOS4)
+ || (wacom->features->type == INTUOS4S)))
goto exit;
/* Cintiq doesn't send data when RDY bit isn't set */
@@ -774,8 +820,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process general packets */
wacom_intuos_general(urb);
- /* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */
- if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) {
+ /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */
+ if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {
/* Rotation packet */
if (data[1] & 0x02)
{
@@ -807,24 +853,40 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
t = (data[6] << 2) | ((data[7] >> 6) & 3);
input_report_abs(dev, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);
}
- /* 2D mouse packets */
else if (wacom->tool[idx] == BTN_TOOL_MOUSE)
{
- input_report_key(dev, BTN_LEFT, data[8] & 0x04);
- input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
- input_report_key(dev, BTN_RIGHT, data[8] & 0x10);
- input_report_rel(dev, REL_WHEEL, (data[8] & 0x01)
+ /* I4 mouse */
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ input_report_key(dev, BTN_LEFT, data[6] & 0x01);
+ input_report_key(dev, BTN_MIDDLE, data[6] & 0x02);
+ input_report_key(dev, BTN_RIGHT, data[6] & 0x04);
+ input_report_rel(dev, REL_WHEEL, ((data[7] & 0x80) >> 7)
+ - ((data[7] & 0x40) >> 6));
+ input_report_key(dev, BTN_SIDE, data[6] & 0x08);
+ input_report_key(dev, BTN_EXTRA, data[6] & 0x10);
+
+ input_report_abs(dev, ABS_TILT_X,
+ ((data[7] << 1) & 0x7e) | (data[8] >> 7));
+ input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f);
+ } else {
+ /* 2D mouse packets */
+ input_report_key(dev, BTN_LEFT, data[8] & 0x04);
+ input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
+ input_report_key(dev, BTN_RIGHT, data[8] & 0x10);
+ input_report_rel(dev, REL_WHEEL, (data[8] & 0x01)
- ((data[8] & 0x02) >> 1));
- /* I3 2D mouse side buttons */
- if (wacom->features->type <= INTUOS3S && wacom->features->type >= INTUOS3L)
- {
- input_report_key(dev, BTN_SIDE, data[8] & 0x40);
- input_report_key(dev, BTN_EXTRA, data[8] & 0x20);
+ /* I3 2D mouse side buttons */
+ if (wacom->features->type <= INTUOS3S && wacom->features->type >= INTUOS3L)
+ {
+ input_report_key(dev, BTN_SIDE, data[8] & 0x40);
+ input_report_key(dev, BTN_EXTRA, data[8] & 0x20);
+ }
}
}
/* Lens cursor packets */
- else if ( wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L)
+ else if ((wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L ||
+ wacom->features->type == INTUOS4L) && (wacom->tool[idx] = BTN_TOOL_LENS))
{
input_report_key(dev, BTN_LEFT, data[8] & 0x01);
input_report_key(dev, BTN_MIDDLE, data[8] & 0x02);
@@ -853,6 +915,8 @@ static struct wacom_features wacom_features[] = {
{ "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Graphire3 4x5", 8, 10208, 7424, 511, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE, wacom_graphire_irq },
+ { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, G4, wacom_graphire_irq },
+ { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, G4, wacom_graphire_irq },
{ "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, MO, wacom_graphire_irq },
{ "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, MO, wacom_graphire_irq },
{ "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS, wacom_intuos_irq },
@@ -882,8 +946,6 @@ static struct wacom_features wacom_features[] = {
{ "Wacom PenPartner2", 8, 3250, 2320, 255, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Bamboo", 9, 14760, 9225, 511, 63, MO, wacom_graphire_irq },
{ "Wacom Bamboo1", 8, 5104, 3712, 511, 63, GRAPHIRE, wacom_graphire_irq },
- { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, G4, wacom_graphire_irq },
- { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, G4, wacom_graphire_irq },
{ "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PL, wacom_ptu_irq },
{ "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 63, INTUOS3S, wacom_intuos_irq },
{ "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 63, INTUOS3, wacom_intuos_irq },
@@ -892,6 +954,10 @@ static struct wacom_features wacom_features[] = {
{ "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L, wacom_intuos_irq },
{ "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3, wacom_intuos_irq },
{ "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S, wacom_intuos_irq },
+ { "Wacom Intuos4 4x6", 10, 31496, 19685, 2047, 63, INTUOS4S, wacom_intuos_irq },
+ { "Wacom Intuos4 6x9", 10, 44704, 27940, 2047, 63, INTUOS4, wacom_intuos_irq },
+ { "Wacom Intuos4 8x13", 10, 65024, 40640, 2047, 63, INTUOS4L, wacom_intuos_irq },
+ { "Wacom Intuos4 12x19", 10, 97536, 60960, 2047, 63, INTUOS4L, wacom_intuos_irq },
{ "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ, wacom_intuos_irq },
{ "Wacom DTF720", 8, 6858, 5506, 511, 0, PL, wacom_pl_irq },
{ "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, BEE, wacom_intuos_irq },
@@ -907,6 +973,8 @@ static struct usb_device_id wacom_ids[] = {
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x13) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
@@ -935,8 +1003,6 @@ static struct usb_device_id wacom_ids[] = {
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x69) },
- { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) },
- { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) },
@@ -945,6 +1011,10 @@ static struct usb_device_id wacom_ids[] = {
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB8) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB9) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBA) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBB) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC4) },
@@ -1058,6 +1128,24 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE);
break;
+ case INTUOS4:
+ case INTUOS4L:
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_7) | BIT(BTN_8);
+ /* fall through */
+
+ case INTUOS4S:
+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ wacom->dev.evbit[0] |= BIT(EV_MSC) | BIT(EV_REL);
+ wacom->dev.mscbit[0] |= BIT(MSC_SERIAL);
+ wacom->dev.relbit[0] |= BIT(REL_WHEEL);
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA);
+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH)
+ | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2);
+ wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE);
+ break;
+
case PL:
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER);
break;
@@ -1077,6 +1165,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
wacom->dev.absmin[ABS_RZ] = -900;
wacom->dev.absmax[ABS_RZ] = 899;
+ wacom->dev.absmin[ABS_Z] = -900;
+ wacom->dev.absmax[ABS_Z] = 899;
wacom->dev.absmin[ABS_THROTTLE] = -1023;
wacom->dev.absmax[ABS_THROTTLE] = 1023;
diff --git a/src/2.6.11/wacom.h b/src/2.6.11/wacom.h
index 8a93d7f..900ce81 100755
--- a/src/2.6.11/wacom.h
+++ b/src/2.6.11/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -85,7 +85,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.46-pc0.4"
+#define DRIVER_VERSION "v1.46-pc0.5"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -125,6 +125,8 @@ extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wa
extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.11/wacom_sys.c b/src/2.6.11/wacom_sys.c
index ff5aa50..9c78833 100755
--- a/src/2.6.11/wacom_sys.c
+++ b/src/2.6.11/wacom_sys.c
@@ -224,6 +224,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_7) | BIT(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_8) | BIT(BTN_9);
@@ -390,6 +403,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.13/wacom.h b/src/2.6.13/wacom.h
index 4fb491b..cd34ff1 100755
--- a/src/2.6.13/wacom.h
+++ b/src/2.6.13/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -91,7 +91,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.43-2.6.13.1-pc-0.8"
+#define DRIVER_VERSION "v1.43-2.6.13.1-pc-0.9"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -131,6 +131,8 @@ extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wa
extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.13/wacom_sys.c b/src/2.6.13/wacom_sys.c
index 109d733..8c1f3fe 100755
--- a/src/2.6.13/wacom_sys.c
+++ b/src/2.6.13/wacom_sys.c
@@ -223,6 +223,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_7) | BIT(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_8) | BIT(BTN_9);
@@ -389,6 +402,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.15/wacom_sys.c b/src/2.6.15/wacom_sys.c
index f1b29bc..64f45ef 100755
--- a/src/2.6.15/wacom_sys.c
+++ b/src/2.6.15/wacom_sys.c
@@ -218,6 +218,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_7) | BIT(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_8) | BIT(BTN_9);
@@ -342,11 +355,13 @@ static void wacom_paser_hid(struct usb_interface *intf, struct hid_descriptor *h
static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *dev = interface_to_usbdev(intf);
+ struct usb_host_interface *interface = intf->cur_altsetting;
struct usb_endpoint_descriptor *endpoint;
struct wacom *wacom;
struct wacom_wac *wacom_wac;
struct input_dev *input_dev;
- char rep_data[2], limit = 0, mode = 2;
+ char rep_data[2], limit = 0, mode = 2, *report = NULL;
+ struct hid_descriptor *hid_desc;
wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL);
@@ -381,6 +396,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
@@ -458,7 +482,6 @@ static void wacom_disconnect(struct usb_interface *intf)
}
static struct usb_driver wacom_driver = {
- .owner = THIS_MODULE,
.name = "wacom",
.probe = wacom_probe,
.disconnect = wacom_disconnect,
diff --git a/src/2.6.16/wacom.h b/src/2.6.16/wacom.h
index 4d21e25..f041025 100644
--- a/src/2.6.16/wacom.h
+++ b/src/2.6.16/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -86,7 +86,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.46-pc0.4"
+#define DRIVER_VERSION "v1.46-pc0.5"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -125,6 +125,8 @@ extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wa
extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.16/wacom_sys.c b/src/2.6.16/wacom_sys.c
index aa5c3d4..554c184 100644
--- a/src/2.6.16/wacom_sys.c
+++ b/src/2.6.16/wacom_sys.c
@@ -218,6 +218,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_7) | BIT(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_8) | BIT(BTN_9);
@@ -383,6 +396,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.16/wacom_wac.c b/src/2.6.16/wacom_wac.c
index e99fa1c..4ca672b 100644
--- a/src/2.6.16/wacom_wac.c
+++ b/src/2.6.16/wacom_wac.c
@@ -44,7 +44,6 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom, void *wcombo)
wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1]));
wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[3]));
wacom_report_abs(wcombo, ABS_PRESSURE, ((signed char)data[6] + 127));
- wacom_report_abs(wcombo, ABS_PRESSURE, ((signed char)data[6] + 127));
wacom_report_key(wcombo, BTN_STYLUS, (data[5] & 0x40));
break;
default:
@@ -303,6 +302,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
switch (wacom->id[idx]) {
case 0x812: /* Inking pen */
case 0x801: /* Intuos3 Inking pen */
+ case 0x20802: /* Intuos4 Inking Pen */
case 0x012:
wacom->tool[idx] = BTN_TOOL_PENCIL;
break;
@@ -312,6 +312,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
case 0x823: /* Intuos3 Grip Pen */
case 0x813: /* Intuos3 Classic Pen */
case 0x885: /* Intuos3 Marker Pen */
+ case 0x802: /* Intuos4 Grip Pen Eraser */
+ case 0x804: /* Intuos4 Marker Pen */
+ case 0x40802: /* Intuos4 Classic Pen */
case 0x022:
wacom->tool[idx] = BTN_TOOL_PEN;
break;
@@ -323,10 +326,12 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
case 0x09c:
case 0x094:
case 0x017: /* Intuos3 2D Mouse */
+ case 0x806: /* Intuos4 Mouse */
wacom->tool[idx] = BTN_TOOL_MOUSE;
break;
case 0x096: /* Lens cursor */
case 0x097: /* Intuos3 Lens cursor */
+ case 0x006: /* Intuos4 Lens cursor */
wacom->tool[idx] = BTN_TOOL_LENS;
break;
case 0x82a: /* Eraser */
@@ -337,12 +342,17 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
case 0x82b: /* Intuos3 Grip Pen Eraser */
case 0x81b: /* Intuos3 Classic Pen Eraser */
case 0x91b: /* Intuos3 Airbrush Eraser */
+ case 0x80c: /* Intuos4 Marker Pen Eraser */
+ case 0x80a: /* Intuos4 Grip Pen Eraser */
+ case 0x4080a: /* Intuos4 Classic Pen Eraser */
+ case 0x90a: /* Intuos4 Airbrush Eraser */
wacom->tool[idx] = BTN_TOOL_RUBBER;
break;
case 0xd12:
case 0x912:
case 0x112:
case 0x913: /* Intuos3 Airbrush */
+ case 0x902: /* Intuos4 Airbrush */
wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
break;
default: /* Unknown tool */
@@ -390,6 +400,8 @@ static void wacom_intuos_general(struct wacom_wac *wacom, void *wcombo)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L)
+ t = (t << 1) | (data[1] & 1);
wacom_report_abs(wcombo, ABS_PRESSURE, t);
wacom_report_key(wcombo, BTN_TOUCH, t);
wacom_report_abs(wcombo, ABS_TILT_X,
@@ -432,26 +444,50 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
if (wacom->tool[1] != BTN_TOOL_FINGER)
wacom->tool[1] = BTN_TOOL_FINGER;
- wacom_report_key(wcombo, BTN_0, (data[5] & 0x01));
- wacom_report_key(wcombo, BTN_1, (data[5] & 0x02));
- wacom_report_key(wcombo, BTN_2, (data[5] & 0x04));
- wacom_report_key(wcombo, BTN_3, (data[5] & 0x08));
- wacom_report_key(wcombo, BTN_4, (data[6] & 0x01));
- wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
- wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
- wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
- wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
- wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
- wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
- wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
-
- if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
- data[2] | (data[3] & 0x1f) | data[4]) {
- wacom_report_key(wcombo, wacom->tool[1], 1);
- wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ wacom_report_key(wcombo, BTN_0, (data[2] & 0x01));
+ wacom_report_key(wcombo, BTN_1, (data[3] & 0x01));
+ wacom_report_key(wcombo, BTN_2, (data[3] & 0x02));
+ wacom_report_key(wcombo, BTN_3, (data[3] & 0x04));
+ wacom_report_key(wcombo, BTN_4, (data[3] & 0x08));
+ wacom_report_key(wcombo, BTN_5, (data[3] & 0x10));
+ wacom_report_key(wcombo, BTN_6, (data[3] & 0x20));
+ if (data[1] & 0x80) {
+ wacom_report_abs(wcombo, ABS_WHEEL, (data[1] & 0x7f));
+ }
+ if (wacom->features->type != INTUOS4S) {
+ wacom_report_key(wcombo, BTN_7, (data[3] & 0x40));
+ wacom_report_key(wcombo, BTN_8, (data[3] & 0x80));
+ }
+ if (data[1] | (data[2] & 0x01) | data[3]) {
+ wacom_report_key(wcombo, wacom->tool[1], 1);
+ wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ wacom_report_key(wcombo, wacom->tool[1], 0);
+ wacom_report_abs(wcombo, ABS_MISC, 0);
+ }
} else {
- wacom_report_key(wcombo, wacom->tool[1], 0);
- wacom_report_abs(wcombo, ABS_MISC, 0);
+ wacom_report_key(wcombo, BTN_0, (data[5] & 0x01));
+ wacom_report_key(wcombo, BTN_1, (data[5] & 0x02));
+ wacom_report_key(wcombo, BTN_2, (data[5] & 0x04));
+ wacom_report_key(wcombo, BTN_3, (data[5] & 0x08));
+ wacom_report_key(wcombo, BTN_4, (data[6] & 0x01));
+ wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
+ wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
+ wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
+ wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
+ wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
+ wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
+ wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
+
+ if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
+ data[2] | (data[3] & 0x1f) | data[4]) {
+ wacom_report_key(wcombo, wacom->tool[1], 1);
+ wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ wacom_report_key(wcombo, wacom->tool[1], 0);
+ wacom_report_abs(wcombo, ABS_MISC, 0);
+ }
}
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xffffffff);
return 1;
@@ -462,10 +498,16 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
if (result)
return result-1;
- /* Only large I3 and I1 & I2 support Lense Cursor */
+ /* don't proceed if we don't know the ID */
+ if (!wacom->id[idx])
+ return 0;
+
+ /* Only large Intuos support Lense Cursor */
if ((wacom->tool[idx] == BTN_TOOL_LENS)
&& ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))
+ || (wacom->features->type == INTUOS3S)
+ || (wacom->features->type == INTUOS4)
+ || (wacom->features->type == INTUOS4S)))
return 0;
/* Cintiq doesn't send data when RDY bit isn't set */
@@ -485,8 +527,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
/* process general packets */
wacom_intuos_general(wacom, wcombo);
- /* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */
- if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) {
+ /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */
+ if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {
if (data[1] & 0x02) {
/* Rotation packet */
@@ -515,20 +557,35 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
wacom_report_abs(wcombo, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);
} else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
- /* 2D mouse packet */
- wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x04);
- wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x08);
- wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x10);
- wacom_report_rel(wcombo, REL_WHEEL, (data[8] & 0x01)
+ /* I4 mouse */
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ wacom_report_key(wcombo, BTN_LEFT, data[6] & 0x01);
+ wacom_report_key(wcombo, BTN_MIDDLE, data[6] & 0x02);
+ wacom_report_key(wcombo, BTN_RIGHT, data[6] & 0x04);
+ wacom_report_rel(wcombo, REL_WHEEL, ((data[7] & 0x80) >> 7)
+ - ((data[7] & 0x40) >> 6));
+ wacom_report_key(wcombo, BTN_SIDE, data[6] & 0x08);
+ wacom_report_key(wcombo, BTN_EXTRA, data[6] & 0x10);
+
+ wacom_report_abs(wcombo, ABS_TILT_X,
+ ((data[7] << 1) & 0x7e) | (data[8] >> 7));
+ wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f);
+ } else {
+ /* 2D mouse packet */
+ wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x04);
+ wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x08);
+ wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x10);
+ wacom_report_rel(wcombo, REL_WHEEL, (data[8] & 0x01)
- ((data[8] & 0x02) >> 1));
- /* I3 2D mouse side buttons */
- if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) {
- wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40);
- wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20);
+ /* I3 2D mouse side buttons */
+ if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) {
+ wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40);
+ wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20);
+ }
}
-
- } else if (wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L) {
+ } else if ((wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L ||
+ wacom->features->type == INTUOS4L) && (wacom->tool[idx] = BTN_TOOL_LENS)) {
/* Lens cursor packets */
wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01);
wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02);
@@ -677,6 +734,9 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
case INTUOS3L:
case CINTIQ:
case WACOM_BEE:
+ case INTUOS4S:
+ case INTUOS4:
+ case INTUOS4L:
return (wacom_intuos_irq(wacom_wac, wcombo));
break;
case TABLETPC:
@@ -711,6 +771,14 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
case INTUOS:
input_dev_i(input_dev, wacom_wac);
break;
+ case INTUOS4:
+ case INTUOS4L:
+ input_dev_i4(input_dev, wacom_wac);
+ /* fall through */
+ case INTUOS4S:
+ input_dev_i4s(input_dev, wacom_wac);
+ input_dev_i(input_dev, wacom_wac);
+ break;
case PL:
case PTU:
case TABLETPC:
@@ -724,61 +792,65 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
}
static struct wacom_features wacom_features[] = {
- { "Wacom Penpartner", 7, 5040, 3780, 255, 0, PENPARTNER, 0, 0 },
- { "Wacom Graphire", 8, 10206, 7422, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire3", 8, 10208, 7424, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4, 0, 0 },
- { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4, 0, 0 },
- { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO, 0, 0 },
- { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO, 0, 0 },
- { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE, 0, 0 },
- { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom PenPartner2", 8, 3250, 2320, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO, 0, 0 },
- { "Wacom Bamboo1", 8, 5104, 3712, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom PL400", 8, 5408, 4056, 255, 0, PL, 0, 0 },
- { "Wacom PL500", 8, 6144, 4608, 255, 0, PL, 0, 0 },
- { "Wacom PL600", 8, 6126, 4604, 255, 0, PL, 0, 0 },
- { "Wacom PL600SX", 8, 6260, 5016, 255, 0, PL, 0, 0 },
- { "Wacom PL550", 8, 6144, 4608, 511, 0, PL, 0, 0 },
- { "Wacom PL800", 8, 7220, 5780, 511, 0, PL, 0, 0 },
- { "Wacom PL700", 8, 6758, 5406, 511, 0, PL, 0, 0 },
- { "Wacom PL510", 8, 6282, 4762, 511, 0, PL, 0, 0 },
- { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL, 0, 0 },
- { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL, 0, 0 },
- { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL, 0, 0 },
- { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL, 0, 0 },
- { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU, 0, 0 },
- { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 63, INTUOS3S, 0, 0 },
- { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 63, INTUOS3, 0, 0 },
- { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 63, INTUOS3, 0, 0 },
- { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 63, INTUOS3L, 0, 0 },
- { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L, 0, 0 },
- { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3, 0, 0 },
- { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S, 0, 0 },
- { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ, 0, 0 },
- { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE, 0, 0 },
- { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE, 0, 0 },
- { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC, 1023, 1023 },
- { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC, 1023, 1023 },
- { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC, 1023, 1023 },
- { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS, 0, 0 },
+ { "Wacom Penpartner", 7, 5040, 3780, 255, 0, PENPARTNER },
+ { "Wacom Graphire", 8, 10206, 7422, 511, 63, GRAPHIRE },
+ { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 63, GRAPHIRE },
+ { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE },
+ { "Wacom Graphire3", 8, 10208, 7424, 511, 63, GRAPHIRE },
+ { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE },
+ { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4 },
+ { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 },
+ { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO },
+ { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO },
+ { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE },
+ { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE },
+ { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE },
+ { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE },
+ { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE },
+ { "Wacom PenPartner2", 8, 3250, 2320, 511, 63, GRAPHIRE },
+ { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO },
+ { "Wacom Bamboo1", 8, 5104, 3712, 511, 63, GRAPHIRE },
+ { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
+ { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
+ { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS },
+ { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 31, INTUOS },
+ { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 31, INTUOS },
+ { "Wacom PL400", 8, 5408, 4056, 255, 0, PL },
+ { "Wacom PL500", 8, 6144, 4608, 255, 0, PL },
+ { "Wacom PL600", 8, 6126, 4604, 255, 0, PL },
+ { "Wacom PL600SX", 8, 6260, 5016, 255, 0, PL },
+ { "Wacom PL550", 8, 6144, 4608, 511, 0, PL },
+ { "Wacom PL800", 8, 7220, 5780, 511, 0, PL },
+ { "Wacom PL700", 8, 6758, 5406, 511, 0, PL },
+ { "Wacom PL510", 8, 6282, 4762, 511, 0, PL },
+ { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL },
+ { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL },
+ { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL },
+ { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL },
+ { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU },
+ { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
+ { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
+ { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 31, INTUOS },
+ { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 31, INTUOS },
+ { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 31, INTUOS },
+ { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 63, INTUOS3S },
+ { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 63, INTUOS3 },
+ { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 63, INTUOS3 },
+ { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 63, INTUOS3L },
+ { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L },
+ { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3 },
+ { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S },
+ { "Wacom Intuos4 4x6", 10, 31496, 19685, 2047, 63, INTUOS4S },
+ { "Wacom Intuos4 6x9", 10, 44704, 27940, 2047, 63, INTUOS4 },
+ { "Wacom Intuos4 8x13", 10, 65024, 40640, 2047, 63, INTUOS4L },
+ { "Wacom Intuos4 12x19", 10, 97536, 60960, 2047, 63, INTUOS4L },
+ { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ },
+ { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE },
+ { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE },
+ { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
{ }
};
@@ -831,6 +903,10 @@ static struct usb_device_id wacom_ids[] = {
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB8) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB9) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBA) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBB) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
diff --git a/src/2.6.16/wacom_wac.h b/src/2.6.16/wacom_wac.h
index 5d2b6e1..1386c46 100644
--- a/src/2.6.16/wacom_wac.h
+++ b/src/2.6.16/wacom_wac.h
@@ -27,6 +27,9 @@ enum {
INTUOS3L,
CINTIQ,
WACOM_BEE,
+ INTUOS4S,
+ INTUOS4,
+ INTUOS4L,
WACOM_MO,
TABLETPC,
MAX_TYPE
@@ -45,7 +48,7 @@ struct wacom_features {
};
struct wacom_wac {
- signed char *data;
+ unsigned char *data;
int tool[2];
int id[2];
__u32 serial[2];
diff --git a/src/2.6.18/wacom.h b/src/2.6.18/wacom.h
index 97967bb..fe2081e 100644
--- a/src/2.6.18/wacom.h
+++ b/src/2.6.18/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -84,7 +84,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.46-pc0.4"
+#define DRIVER_VERSION "v1.46-pc0.5"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -123,6 +123,8 @@ extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wa
extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.19/wacom.h b/src/2.6.19/wacom.h
index 5c2fe78..03a24fc 100755
--- a/src/2.6.19/wacom.h
+++ b/src/2.6.19/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -84,7 +84,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.46-pc0.4"
+#define DRIVER_VERSION "v1.46-pc0.5"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -121,6 +121,8 @@ extern void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wa
extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.19/wacom_sys.c b/src/2.6.19/wacom_sys.c
index 6495810..68e5abc 100755
--- a/src/2.6.19/wacom_sys.c
+++ b/src/2.6.19/wacom_sys.c
@@ -211,6 +211,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_7) | BIT(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_8) | BIT(BTN_9);
@@ -376,6 +389,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.19/wacom_wac.c b/src/2.6.19/wacom_wac.c
index 0896ccc..a1cf9e1 100755
--- a/src/2.6.19/wacom_wac.c
+++ b/src/2.6.19/wacom_wac.c
@@ -295,6 +295,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
switch (wacom->id[idx]) {
case 0x812: /* Inking pen */
case 0x801: /* Intuos3 Inking pen */
+ case 0x20802: /* Intuos4 Inking Pen */
case 0x012:
wacom->tool[idx] = BTN_TOOL_PENCIL;
break;
@@ -304,6 +305,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
case 0x823: /* Intuos3 Grip Pen */
case 0x813: /* Intuos3 Classic Pen */
case 0x885: /* Intuos3 Marker Pen */
+ case 0x802: /* Intuos4 Grip Pen Eraser */
+ case 0x804: /* Intuos4 Marker Pen */
+ case 0x40802: /* Intuos4 Classic Pen */
case 0x022:
wacom->tool[idx] = BTN_TOOL_PEN;
break;
@@ -315,10 +319,12 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
case 0x09c:
case 0x094:
case 0x017: /* Intuos3 2D Mouse */
+ case 0x806: /* Intuos4 Mouse */
wacom->tool[idx] = BTN_TOOL_MOUSE;
break;
case 0x096: /* Lens cursor */
case 0x097: /* Intuos3 Lens cursor */
+ case 0x006: /* Intuos4 Lens cursor */
wacom->tool[idx] = BTN_TOOL_LENS;
break;
case 0x82a: /* Eraser */
@@ -329,12 +335,17 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
case 0x82b: /* Intuos3 Grip Pen Eraser */
case 0x81b: /* Intuos3 Classic Pen Eraser */
case 0x91b: /* Intuos3 Airbrush Eraser */
+ case 0x80c: /* Intuos4 Marker Pen Eraser */
+ case 0x80a: /* Intuos4 Grip Pen Eraser */
+ case 0x4080a: /* Intuos4 Classic Pen Eraser */
+ case 0x90a: /* Intuos4 Airbrush Eraser */
wacom->tool[idx] = BTN_TOOL_RUBBER;
break;
case 0xd12:
case 0x912:
case 0x112:
case 0x913: /* Intuos3 Airbrush */
+ case 0x902: /* Intuos4 Airbrush */
wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
break;
default: /* Unknown tool */
@@ -369,6 +380,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
wacom_report_key(wcombo, wacom->tool[idx], 0);
wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+ wacom->id[idx] = 0;
return 2;
}
return 0;
@@ -382,6 +394,8 @@ static void wacom_intuos_general(struct wacom_wac *wacom, void *wcombo)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L)
+ t = (t << 1) | (data[1] & 1);
wacom_report_abs(wcombo, ABS_PRESSURE, t);
wacom_report_key(wcombo, BTN_TOUCH, t);
wacom_report_abs(wcombo, ABS_TILT_X,
@@ -422,40 +436,69 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
if (wacom->tool[1] != BTN_TOOL_FINGER)
wacom->tool[1] = BTN_TOOL_FINGER;
- wacom_report_key(wcombo, BTN_0, (data[5] & 0x01));
- wacom_report_key(wcombo, BTN_1, (data[5] & 0x02));
- wacom_report_key(wcombo, BTN_2, (data[5] & 0x04));
- wacom_report_key(wcombo, BTN_3, (data[5] & 0x08));
- wacom_report_key(wcombo, BTN_4, (data[6] & 0x01));
- wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
- wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
- wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
- wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
- wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
- wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
- wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
-
- if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
- data[2] | (data[3] & 0x1f) | data[4]) {
- wacom_report_key(wcombo, wacom->tool[1], 1);
- wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ wacom_report_key(wcombo, BTN_0, (data[2] & 0x01));
+ wacom_report_key(wcombo, BTN_1, (data[3] & 0x01));
+ wacom_report_key(wcombo, BTN_2, (data[3] & 0x02));
+ wacom_report_key(wcombo, BTN_3, (data[3] & 0x04));
+ wacom_report_key(wcombo, BTN_4, (data[3] & 0x08));
+ wacom_report_key(wcombo, BTN_5, (data[3] & 0x10));
+ wacom_report_key(wcombo, BTN_6, (data[3] & 0x20));
+ if (data[1] & 0x80) {
+ wacom_report_abs(wcombo, ABS_WHEEL, (data[1] & 0x7f));
+ }
+ if (wacom->features->type != INTUOS4S) {
+ wacom_report_key(wcombo, BTN_7, (data[3] & 0x40));
+ wacom_report_key(wcombo, BTN_8, (data[3] & 0x80));
+ }
+ if (data[1] | (data[2] & 0x01) | data[3]) {
+ wacom_report_key(wcombo, wacom->tool[1], 1);
+ wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ wacom_report_key(wcombo, wacom->tool[1], 0);
+ wacom_report_abs(wcombo, ABS_MISC, 0);
+ }
} else {
- wacom_report_key(wcombo, wacom->tool[1], 0);
- wacom_report_abs(wcombo, ABS_MISC, 0);
+ wacom_report_key(wcombo, BTN_0, (data[5] & 0x01));
+ wacom_report_key(wcombo, BTN_1, (data[5] & 0x02));
+ wacom_report_key(wcombo, BTN_2, (data[5] & 0x04));
+ wacom_report_key(wcombo, BTN_3, (data[5] & 0x08));
+ wacom_report_key(wcombo, BTN_4, (data[6] & 0x01));
+ wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
+ wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
+ wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
+ wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
+ wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
+ wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
+ wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
+
+ if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
+ data[2] | (data[3] & 0x1f) | data[4]) {
+ wacom_report_key(wcombo, wacom->tool[1], 1);
+ wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ wacom_report_key(wcombo, wacom->tool[1], 0);
+ wacom_report_abs(wcombo, ABS_MISC, 0);
+ }
}
wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xffffffff);
return 1;
}
-
/* process in/out prox events */
result = wacom_intuos_inout(wacom, wcombo);
if (result)
return result-1;
- /* Only large I3 and I1 & I2 support Lense Cursor */
+ /* don't proceed if we don't know the ID */
+ if (!wacom->id[idx])
+ return 0;
+
+ /* Only large Intuos support Lense Cursor */
if ((wacom->tool[idx] == BTN_TOOL_LENS)
&& ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))
+ || (wacom->features->type == INTUOS3S)
+ || (wacom->features->type == INTUOS4)
+ || (wacom->features->type == INTUOS4S)))
return 0;
/* Cintiq doesn't send data when RDY bit isn't set */
@@ -475,8 +518,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
/* process general packets */
wacom_intuos_general(wacom, wcombo);
- /* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */
- if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) {
+ /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */
+ if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {
if (data[1] & 0x02) {
/* Rotation packet */
@@ -505,20 +548,35 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
wacom_report_abs(wcombo, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);
} else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
- /* 2D mouse packet */
- wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x04);
- wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x08);
- wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x10);
- wacom_report_rel(wcombo, REL_WHEEL, (data[8] & 0x01)
+ /* I4 mouse */
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ wacom_report_key(wcombo, BTN_LEFT, data[6] & 0x01);
+ wacom_report_key(wcombo, BTN_MIDDLE, data[6] & 0x02);
+ wacom_report_key(wcombo, BTN_RIGHT, data[6] & 0x04);
+ wacom_report_rel(wcombo, REL_WHEEL, ((data[7] & 0x80) >> 7)
+ - ((data[7] & 0x40) >> 6));
+ wacom_report_key(wcombo, BTN_SIDE, data[6] & 0x08);
+ wacom_report_key(wcombo, BTN_EXTRA, data[6] & 0x10);
+
+ wacom_report_abs(wcombo, ABS_TILT_X,
+ ((data[7] << 1) & 0x7e) | (data[8] >> 7));
+ wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f);
+ } else {
+ /* 2D mouse packet */
+ wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x04);
+ wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x08);
+ wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x10);
+ wacom_report_rel(wcombo, REL_WHEEL, (data[8] & 0x01)
- ((data[8] & 0x02) >> 1));
- /* I3 2D mouse side buttons */
- if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) {
- wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40);
- wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20);
+ /* I3 2D mouse side buttons */
+ if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) {
+ wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40);
+ wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20);
+ }
}
-
- } else if (wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L) {
+ } else if ((wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L ||
+ wacom->features->type == INTUOS4L) && (wacom->tool[idx] = BTN_TOOL_LENS)) {
/* Lens cursor packets */
wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01);
wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02);
@@ -670,6 +728,9 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
case INTUOS3L:
case CINTIQ:
case WACOM_BEE:
+ case INTUOS4S:
+ case INTUOS4:
+ case INTUOS4L:
return (wacom_intuos_irq(wacom_wac, wcombo));
break;
case TABLETPC:
@@ -705,6 +766,14 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
case INTUOS:
input_dev_i(input_dev, wacom_wac);
break;
+ case INTUOS4:
+ case INTUOS4L:
+ input_dev_i4(input_dev, wacom_wac);
+ /* fall through */
+ case INTUOS4S:
+ input_dev_i4s(input_dev, wacom_wac);
+ input_dev_i(input_dev, wacom_wac);
+ break;
case PL:
case PTU:
case TABLETPC:
@@ -718,61 +787,65 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
}
static struct wacom_features wacom_features[] = {
- { "Wacom Penpartner", 7, 5040, 3780, 255, 0, PENPARTNER, 0, 0 },
- { "Wacom Graphire", 8, 10206, 7422, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire3", 8, 10208, 7424, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4, 0, 0 },
- { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4, 0, 0 },
- { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO, 0, 0 },
- { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO, 0, 0 },
- { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE, 0, 0 },
- { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom PenPartner2", 8, 3250, 2320, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO, 0, 0 },
- { "Wacom Bamboo1", 8, 5104, 3712, 511, 63, GRAPHIRE, 0, 0 },
- { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom PL400", 8, 5408, 4056, 255, 0, PL, 0, 0 },
- { "Wacom PL500", 8, 6144, 4608, 255, 0, PL, 0, 0 },
- { "Wacom PL600", 8, 6126, 4604, 255, 0, PL, 0, 0 },
- { "Wacom PL600SX", 8, 6260, 5016, 255, 0, PL, 0, 0 },
- { "Wacom PL550", 8, 6144, 4608, 511, 0, PL, 0, 0 },
- { "Wacom PL800", 8, 7220, 5780, 511, 0, PL, 0, 0 },
- { "Wacom PL700", 8, 6758, 5406, 511, 0, PL, 0, 0 },
- { "Wacom PL510", 8, 6282, 4762, 511, 0, PL, 0, 0 },
- { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL, 0, 0 },
- { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL, 0, 0 },
- { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL, 0, 0 },
- { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL, 0, 0 },
- { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU, 0, 0 },
- { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 31, INTUOS, 0, 0 },
- { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 63, INTUOS3S, 0, 0 },
- { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 63, INTUOS3, 0, 0 },
- { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 63, INTUOS3, 0, 0 },
- { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 63, INTUOS3L, 0, 0 },
- { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L, 0, 0 },
- { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3, 0, 0 },
- { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S, 0, 0 },
- { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ, 0, 0 },
- { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE, 0, 0 },
- { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE, 0, 0 },
- { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC, 1023, 1023 },
- { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC, 1023, 1023 },
- { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC, 1023, 1023 },
- { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS, 0, 0 },
+ { "Wacom Penpartner", 7, 5040, 3780, 255, 0, PENPARTNER },
+ { "Wacom Graphire", 8, 10206, 7422, 511, 63, GRAPHIRE },
+ { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 63, GRAPHIRE },
+ { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE },
+ { "Wacom Graphire3", 8, 10208, 7424, 511, 63, GRAPHIRE },
+ { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE },
+ { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4 },
+ { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 },
+ { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO },
+ { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO },
+ { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE },
+ { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE },
+ { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE },
+ { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE },
+ { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE },
+ { "Wacom PenPartner2", 8, 3250, 2320, 511, 63, GRAPHIRE },
+ { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO },
+ { "Wacom Bamboo1", 8, 5104, 3712, 511, 63, GRAPHIRE },
+ { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
+ { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
+ { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS },
+ { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 31, INTUOS },
+ { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 31, INTUOS },
+ { "Wacom PL400", 8, 5408, 4056, 255, 0, PL },
+ { "Wacom PL500", 8, 6144, 4608, 255, 0, PL },
+ { "Wacom PL600", 8, 6126, 4604, 255, 0, PL },
+ { "Wacom PL600SX", 8, 6260, 5016, 255, 0, PL },
+ { "Wacom PL550", 8, 6144, 4608, 511, 0, PL },
+ { "Wacom PL800", 8, 7220, 5780, 511, 0, PL },
+ { "Wacom PL700", 8, 6758, 5406, 511, 0, PL },
+ { "Wacom PL510", 8, 6282, 4762, 511, 0, PL },
+ { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL },
+ { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL },
+ { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL },
+ { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL },
+ { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU },
+ { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
+ { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
+ { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 31, INTUOS },
+ { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 31, INTUOS },
+ { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 31, INTUOS },
+ { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 63, INTUOS3S },
+ { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 63, INTUOS3 },
+ { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 63, INTUOS3 },
+ { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 63, INTUOS3L },
+ { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L },
+ { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3 },
+ { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S },
+ { "Wacom Intuos4 4x6", 10, 31496, 19685, 2047, 63, INTUOS4S },
+ { "Wacom Intuos4 6x9", 10, 44704, 27940, 2047, 63, INTUOS4 },
+ { "Wacom Intuos4 8x13", 10, 65024, 40640, 2047, 63, INTUOS4L },
+ { "Wacom Intuos4 12x19", 10, 97536, 60960, 2047, 63, INTUOS4L },
+ { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ },
+ { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE },
+ { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE },
+ { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
{ }
};
@@ -825,6 +898,10 @@ static struct usb_device_id wacom_ids[] = {
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB8) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB9) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBA) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBB) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
diff --git a/src/2.6.22/wacom_sys.c b/src/2.6.22/wacom_sys.c
index 9383348..cf7212d 100755
--- a/src/2.6.22/wacom_sys.c
+++ b/src/2.6.22/wacom_sys.c
@@ -211,6 +211,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_7) | BIT(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[LONG(BTN_MISC)] |= BIT(BTN_8) | BIT(BTN_9);
@@ -378,6 +391,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.22/wacom_wac.h b/src/2.6.22/wacom_wac.h
index 5817f4d..a0c8818 100755
--- a/src/2.6.22/wacom_wac.h
+++ b/src/2.6.22/wacom_wac.h
@@ -27,6 +27,9 @@ enum {
INTUOS3L,
CINTIQ,
WACOM_BEE,
+ INTUOS4S,
+ INTUOS4,
+ INTUOS4L,
WACOM_MO,
TABLETPC,
MAX_TYPE
diff --git a/src/2.6.24/wacom_sys.c b/src/2.6.24/wacom_sys.c
index dd6fc02..76bca5e 100755
--- a/src/2.6.24/wacom_sys.c
+++ b/src/2.6.24/wacom_sys.c
@@ -219,6 +219,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) | BIT_MASK(BTN_5) | BIT_MASK(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_7) | BIT_MASK(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
@@ -391,6 +404,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.26/wacom.h b/src/2.6.26/wacom.h
index 48fa684..390f7d2 100755
--- a/src/2.6.26/wacom.h
+++ b/src/2.6.26/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -87,7 +87,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.49"
+#define DRIVER_VERSION "v1.49-pc-1"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -127,6 +127,8 @@ extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.26/wacom_sys.c b/src/2.6.26/wacom_sys.c
index d4bbe4c..1b5165b 100755
--- a/src/2.6.26/wacom_sys.c
+++ b/src/2.6.26/wacom_sys.c
@@ -237,6 +237,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) | BIT_MASK(BTN_5) | BIT_MASK(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_7) | BIT_MASK(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
@@ -411,6 +424,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.27/wacom.h b/src/2.6.27/wacom.h
index 9f1dfd9..046b6c1 100755
--- a/src/2.6.27/wacom.h
+++ b/src/2.6.27/wacom.h
@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -87,7 +87,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.49"
+#define DRIVER_VERSION "v1.49-pc-1"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL"
@@ -127,6 +127,8 @@ extern void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac
extern void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
diff --git a/src/2.6.27/wacom_sys.c b/src/2.6.27/wacom_sys.c
index 9e534d1..50c17fe 100755
--- a/src/2.6.27/wacom_sys.c
+++ b/src/2.6.27/wacom_sys.c
@@ -237,6 +237,19 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
}
+void input_dev_i4s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) | BIT_MASK(BTN_5) | BIT_MASK(BTN_6);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+}
+
+void input_dev_i4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_7) | BIT_MASK(BTN_8);
+}
+
void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
{
input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
@@ -411,6 +424,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc;
+ /* Initialize touch_x_max and touch_y_max in case it is not defined */
+ if (wacom_wac->features->type == TABLETPC) {
+ wacom_wac->features->touch_x_max = 1023;
+ wacom_wac->features->touch_y_max = 1023;
+ } else {
+ wacom_wac->features->touch_x_max = 0;
+ wacom_wac->features->touch_y_max = 0;
+ }
+
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/src/2.6.9/wacom.c b/src/2.6.9/wacom.c
index b912b9b..c0ba32c 100644
--- a/src/2.6.9/wacom.c
+++ b/src/2.6.9/wacom.c
@@ -9,7 +9,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
- * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
+ * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
*
* ChangeLog:
* v0.1 (vp) - Initial release
@@ -68,6 +68,7 @@
* v1.40-2.6.9-pc-0.11 - Added Bamboo
* v1.40-2.6.9-pc-0.12 - added Bamboo1, Bamboo Fun, and Hummingbird
* v1.40-2.6.9-pc-0.13 - Added Cintiq 20WSX
+ * v1.40-2.6.9-pc-0.14 - Added Intuos4
*/
/*
@@ -114,6 +115,9 @@ enum {
INTUOS3,
INTUOS3L,
CINTIQ,
+ INTUOS4S,
+ INTUOS4,
+ INTUOS4L,
MO,
BEE,
MAX_TYPE
@@ -131,7 +135,7 @@ struct wacom_features {
};
struct wacom {
- signed char *data;
+ unsigned char *data;
dma_addr_t data_dma;
struct input_dev dev;
struct usb_device *usbdev;
@@ -566,6 +570,7 @@ static int wacom_intuos_inout(struct urb *urb)
switch (wacom->id[idx]) {
case 0x812: /* Inking pen */
case 0x801: /* Intuos3 Inking pen */
+ case 0x20802: /* Intuos4 Inking Pen */
case 0x012:
wacom->tool[idx] = BTN_TOOL_PENCIL;
break;
@@ -575,6 +580,9 @@ static int wacom_intuos_inout(struct urb *urb)
case 0x823: /* Intuos3 Grip Pen */
case 0x813: /* Intuos3 Classic Pen */
case 0x885: /* Intuos3 Marker Pen */
+ case 0x802: /* Intuos4 Grip Pen Eraser */
+ case 0x804: /* Intuos4 Marker Pen */
+ case 0x40802: /* Intuos4 Classic Pen */
case 0x022:
wacom->tool[idx] = BTN_TOOL_PEN;
break;
@@ -586,10 +594,12 @@ static int wacom_intuos_inout(struct urb *urb)
case 0x09c:
case 0x094:
case 0x017: /* Intuos3 2D Mouse */
+ case 0x806: /* Intuos4 Mouse */
wacom->tool[idx] = BTN_TOOL_MOUSE;
break;
case 0x096: /* Lens cursor */
case 0x097: /* Intuos3 Lens cursor */
+ case 0x006: /* Intuos4 Lens cursor */
wacom->tool[idx] = BTN_TOOL_LENS;
break;
case 0x82a: /* Eraser */
@@ -600,12 +610,17 @@ static int wacom_intuos_inout(struct urb *urb)
case 0x82b: /* Intuos3 Grip Pen Eraser */
case 0x81b: /* Intuos3 Classic Pen Eraser */
case 0x91b: /* Intuos3 Airbrush Eraser */
+ case 0x80c: /* Intuos4 Marker Pen Eraser */
+ case 0x80a: /* Intuos4 Grip Pen Eraser */
+ case 0x4080a: /* Intuos4 Classic Pen Eraser */
+ case 0x90a: /* Intuos4 Airbrush Eraser */
wacom->tool[idx] = BTN_TOOL_RUBBER;
break;
case 0xd12: /* Airbrush */
case 0x912:
case 0x112:
case 0x913: /* Intuos3 Airbrush */
+ case 0x902: /* Intuos4 Airbrush */
wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
break;
default: /* Unknown tool */
@@ -657,6 +672,8 @@ static void wacom_intuos_general(struct urb *urb)
if ((data[1] & 0xb8) == 0xa0)
{
t = (data[6] << 2) | ((data[7] >> 6) & 3);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L)
+ t = (t << 1) | (data[1] & 1);
input_report_abs(dev, ABS_PRESSURE, t);
input_report_abs(dev, ABS_TILT_X,
((data[7] << 1) & 0x7e) | (data[8] >> 7));
@@ -719,26 +736,50 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
if (wacom->tool[1] != BTN_TOOL_FINGER)
wacom->tool[1] = BTN_TOOL_FINGER;
- input_report_key(dev, BTN_0, (data[5] & 0x01));
- input_report_key(dev, BTN_1, (data[5] & 0x02));
- input_report_key(dev, BTN_2, (data[5] & 0x04));
- input_report_key(dev, BTN_3, (data[5] & 0x08));
- input_report_key(dev, BTN_4, (data[6] & 0x01));
- input_report_key(dev, BTN_5, (data[6] & 0x02));
- input_report_key(dev, BTN_6, (data[6] & 0x04));
- input_report_key(dev, BTN_7, (data[6] & 0x08));
- input_report_key(dev, BTN_8, (data[5] & 0x10));
- input_report_key(dev, BTN_9, (data[6] & 0x10));
- input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
- input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
-
- if((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
- data[2] | (data[3] & 0x1f) | data[4]) {
- input_report_key(dev, wacom->tool[1], 1);
- input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ input_report_key(dev, BTN_0, (data[2] & 0x01));
+ input_report_key(dev, BTN_1, (data[3] & 0x01));
+ input_report_key(dev, BTN_2, (data[3] & 0x02));
+ input_report_key(dev, BTN_3, (data[3] & 0x04));
+ input_report_key(dev, BTN_4, (data[3] & 0x08));
+ input_report_key(dev, BTN_5, (data[3] & 0x10));
+ input_report_key(dev, BTN_6, (data[3] & 0x20));
+ if (data[1] & 0x80) {
+ input_report_abs(dev, ABS_WHEEL, (data[1] & 0x7f));
+ }
+ if (wacom->features->type != INTUOS4S) {
+ input_report_key(dev, BTN_7, (data[3] & 0x40));
+ input_report_key(dev, BTN_8, (data[3] & 0x80));
+ }
+ if (data[1] | (data[2] & 0x01) | data[3]) {
+ input_report_key(dev, wacom->tool[1], 1);
+ input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ input_report_key(dev, wacom->tool[1], 0);
+ input_report_abs(dev, ABS_MISC, 0);
+ }
} else {
- input_report_key(dev, wacom->tool[1], 0);
- input_report_abs(dev, ABS_MISC, 0);
+ input_report_key(dev, BTN_0, (data[5] & 0x01));
+ input_report_key(dev, BTN_1, (data[5] & 0x02));
+ input_report_key(dev, BTN_2, (data[5] & 0x04));
+ input_report_key(dev, BTN_3, (data[5] & 0x08));
+ input_report_key(dev, BTN_4, (data[6] & 0x01));
+ input_report_key(dev, BTN_5, (data[6] & 0x02));
+ input_report_key(dev, BTN_6, (data[6] & 0x04));
+ input_report_key(dev, BTN_7, (data[6] & 0x08));
+ input_report_key(dev, BTN_8, (data[5] & 0x10));
+ input_report_key(dev, BTN_9, (data[6] & 0x10));
+ input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
+ input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
+
+ if((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
+ data[2] | (data[3] & 0x1f) | data[4]) {
+ input_report_key(dev, wacom->tool[1], 1);
+ input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
+ } else {
+ input_report_key(dev, wacom->tool[1], 0);
+ input_report_abs(dev, ABS_MISC, 0);
+ }
}
input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff);
input_sync(dev);
@@ -748,10 +789,15 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process in/out prox events */
if (wacom_intuos_inout(urb)) goto exit;
- /* Only large I3 and I1 & I2 support Lense Cursor */
+ /* don't proceed if we don't know the ID */
+ if (!wacom->id[idx]) goto exit;
+
+ /* Only large Intuos support Lense Cursor */
if((wacom->tool[idx] == BTN_TOOL_LENS)
&& ((wacom->features->type == INTUOS3)
- || (wacom->features->type == INTUOS3S)))
+ || (wacom->features->type == INTUOS3S)
+ || (wacom->features->type == INTUOS4)
+ || (wacom->features->type == INTUOS4S)))
goto exit;
/* Cintiq doesn't send data when RDY bit isn't set */
@@ -773,8 +819,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* process general packets */
wacom_intuos_general(urb);
- /* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */
- if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) {
+ /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */
+ if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {
/* Rotation packet */
if (data[1] & 0x02)
{
@@ -806,24 +852,40 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
t = (data[6] << 2) | ((data[7] >> 6) & 3);
input_report_abs(dev, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);
}
- /* 2D mouse packets */
else if (wacom->tool[idx] == BTN_TOOL_MOUSE)
{
- input_report_key(dev, BTN_LEFT, data[8] & 0x04);
- input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
- input_report_key(dev, BTN_RIGHT, data[8] & 0x10);
- input_report_rel(dev, REL_WHEEL, (data[8] & 0x01)
+ /* I4 mouse */
+ if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
+ input_report_key(dev, BTN_LEFT, data[6] & 0x01);
+ input_report_key(dev, BTN_MIDDLE, data[6] & 0x02);
+ input_report_key(dev, BTN_RIGHT, data[6] & 0x04);
+ input_report_rel(dev, REL_WHEEL, ((data[7] & 0x80) >> 7)
+ - ((data[7] & 0x40) >> 6));
+ input_report_key(dev, BTN_SIDE, data[6] & 0x08);
+ input_report_key(dev, BTN_EXTRA, data[6] & 0x10);
+
+ input_report_abs(dev, ABS_TILT_X,
+ ((data[7] << 1) & 0x7e) | (data[8] >> 7));
+ input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f);
+ } else {
+ /* 2D mouse packets */
+ input_report_key(dev, BTN_LEFT, data[8] & 0x04);
+ input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
+ input_report_key(dev, BTN_RIGHT, data[8] & 0x10);
+ input_report_rel(dev, REL_WHEEL, (data[8] & 0x01)
- ((data[8] & 0x02) >> 1));
- /* I3 2D mouse side buttons */
- if (wacom->features->type <= INTUOS3S && wacom->features->type >= INTUOS3L)
- {
- input_report_key(dev, BTN_SIDE, data[8] & 0x40);
- input_report_key(dev, BTN_EXTRA, data[8] & 0x20);
+ /* I3 2D mouse side buttons */
+ if (wacom->features->type <= INTUOS3S && wacom->features->type >= INTUOS3L)
+ {
+ input_report_key(dev, BTN_SIDE, data[8] & 0x40);
+ input_report_key(dev, BTN_EXTRA, data[8] & 0x20);
+ }
}
}
/* Lens cursor packets */
- else if (wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L)
+ else if ((wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L ||
+ wacom->features->type == INTUOS4L) && (wacom->tool[idx] = BTN_TOOL_LENS))
{
input_report_key(dev, BTN_LEFT, data[8] & 0x01);
input_report_key(dev, BTN_MIDDLE, data[8] & 0x02);
@@ -850,7 +912,7 @@ static struct wacom_features wacom_features[] = {
{ "Wacom Graphire", 8, 10206, 7422, 511, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE, wacom_graphire_irq },
- { "Wacom Graphire3", 8, 10208, 7424, 511, 63, GRAPHIRE, wacom_graphire_irq },
+ { "Wacom Graphire3 4x5", 8, 10208, 7424, 511, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE, wacom_graphire_irq },
{ "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, G4, wacom_graphire_irq },
{ "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, G4, wacom_graphire_irq },
@@ -892,6 +954,10 @@ static struct wacom_features wacom_features[] = {
{ "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L, wacom_intuos_irq },
{ "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3, wacom_intuos_irq },
{ "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S, wacom_intuos_irq },
+ { "Wacom Intuos4 4x6", 10, 31496, 19685, 2047, 63, INTUOS4S, wacom_intuos_irq },
+ { "Wacom Intuos4 6x9", 10, 44704, 27940, 2047, 63, INTUOS4, wacom_intuos_irq },
+ { "Wacom Intuos4 8x13", 10, 65024, 40640, 2047, 63, INTUOS4L, wacom_intuos_irq },
+ { "Wacom Intuos4 12x19", 10, 97536, 60960, 2047, 63, INTUOS4L, wacom_intuos_irq },
{ "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ, wacom_intuos_irq },
{ "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, BEE, wacom_intuos_irq },
{ "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, BEE, wacom_intuos_irq },
@@ -946,6 +1012,10 @@ static struct usb_device_id wacom_ids[] = {
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB8) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB9) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBA) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBB) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
@@ -1056,6 +1126,24 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE);
break;
+ case INTUOS4:
+ case INTUOS4L:
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_7) | BIT(BTN_8);
+ /* fall through */
+
+ case INTUOS4S:
+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6);
+ wacom->dev.evbit[0] |= BIT(EV_MSC) | BIT(EV_REL);
+ wacom->dev.mscbit[0] |= BIT(MSC_SERIAL);
+ wacom->dev.relbit[0] |= BIT(REL_WHEEL);
+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA);
+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH)
+ | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2);
+ wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE);
+ break;
+
case PL:
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER);
break;
@@ -1075,6 +1163,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
wacom->dev.absmin[ABS_RZ] = -900;
wacom->dev.absmax[ABS_RZ] = 899;
+ wacom->dev.absmin[ABS_Z] = -900;
+ wacom->dev.absmax[ABS_Z] = 899;
wacom->dev.absmin[ABS_THROTTLE] = -1023;
wacom->dev.absmax[ABS_THROTTLE] = 1023;
diff --git a/src/include/Xwacom.h b/src/include/Xwacom.h
index b92d608..6618a49 100755
--- a/src/include/Xwacom.h
+++ b/src/include/Xwacom.h
@@ -1,6 +1,6 @@
/*
* Copyright 2003 by John Joganic <john@joganic.com>
- * Copyright 2003 - 2008 by Ping Cheng <pingc@wacom.com>
+ * Copyright 2003 - 2009 by Ping Cheng <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -95,6 +95,7 @@
#define XWACOM_PARAM_TVRESOLUTION0 207
#define XWACOM_PARAM_TVRESOLUTION1 208
#define XWACOM_PARAM_COREEVENT 209
+#define XWACOM_PARAM_THRESHOLD 210
#define XWACOM_PARAM_GETONLYPARAM 320
#define XWACOM_PARAM_TID 321
@@ -138,6 +139,9 @@
#define TV_NONE 0
#define TV_ABOVE_BELOW 1
#define TV_LEFT_RIGHT 2
+#define TV_BELOW_ABOVE 3
+#define TV_RIGHT_LEFT 4
+#define TV_MAX 4
#define ROTATE_NONE 0
#define ROTATE_CW 1
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 43616d6..75afb8a 100755
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -9,7 +9,7 @@ WACOMCFG_INCLUDES = -I$(WCM_XORGSDK_DIR) $(X_CFLAGS)
endif
if WCM_ENV_XFREE86
-WACOMCFG_INCLUDES = -I$(WCM_XFREE86_DIR)
+WACOMCFG_INCLUDES = -I$(WCM_XFREE86_DIR) $(HAL_CFLAGS)
endif
AM_CFLAGS = -Wall -pedantic $(WACOMCFG_INCLUDES)
@@ -18,6 +18,7 @@ AM_CFLAGS = -Wall -pedantic $(WACOMCFG_INCLUDES)
# potentially be built or installed depending on the results of
# the configuration.
EXTRA_PROGRAMS = wacdump xidump xsetwacom
+libexec_PROGRAMS = hal-setup-wacom
# Source dependencies
wacdump_SOURCES = wacdump.c wacscrn.c wacscrn.h \
@@ -40,3 +41,8 @@ libwacomcfg_la_LIBADD = @WCM_LIBWACOMCFG_LIBS@
xsetwacom_SOURCES = xsetwacom.c wacomcfg.h wcmAction.c wcmAction.h ../include/Xwacom.h
xsetwacom_LDADD = libwacomcfg.la
+
+hal_setup_wacom_SOURCES = hal-setup-wacom.c
+hal_setup_wacom_LDADD = $(HAL_LIBS)
+
+
diff --git a/src/util/wacusb.c b/src/util/wacusb.c
index 595f3ba..c83f7f4 100755
--- a/src/util/wacusb.c
+++ b/src/util/wacusb.c
@@ -2,7 +2,7 @@
** wacusb.c
**
** Copyright (C) 2002 - 2004 - John E. Joganic
-** Copyright (C) 2003 - 2008 - Ping Cheng
+** Copyright (C) 2003 - 2009 - Ping Cheng
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
@@ -48,6 +48,10 @@
#define MSC_SERIAL 0x00
#endif
+#ifndef BTN_TOOL_DOUBLETAP
+#define BTN_TOOL_DOUBLETAP 0x14d
+#endif
+
/*****************************************************************************
** Defines
*****************************************************************************/
@@ -299,6 +303,15 @@ static int USBIdentifyModel(USBTABLET* pUSB);
{ NULL }
};
+ static USBSUBTYPE xIntuos4[] =
+ {
+ { "PTK-440", "Wacom Intuos4 4x6", 1, 0xB8 },
+ { "PTK-640", "Wacom Intuos4 6x9", 2, 0xB9 },
+ { "PTK-840", "Wacom Intuos4 8x13", 3, 0xBA },
+ { "PTZ-1240", "Wacom Intuos4 12x19", 4, 0xBB },
+ { NULL }
+ };
+
static USBDEVICE xWacomDevices[] =
{
{ "pp", "PenPartner", WACOMDEVICE_PENPARTNER, xPenPartner, 1 },
@@ -309,6 +322,7 @@ static int USBIdentifyModel(USBTABLET* pUSB);
{ "int", "Intuos", WACOMDEVICE_INTUOS, xIntuos, 2 },
{ "int2", "Intuos2", WACOMDEVICE_INTUOS2, xIntuos2, 2 },
{ "int3", "Intuos3", WACOMDEVICE_INTUOS3, xIntuos3, 2 },
+ { "int4", "Intuos4", WACOMDEVICE_INTUOS3, xIntuos4, 2 },
{ "ctq", "Cintiq (V5)", WACOMDEVICE_CINTIQV5, xCintiqV5, 2 },
{ "pl", "Cintiq (PL)", WACOMDEVICE_CINTIQ, xCintiq, 1 },
{ "ptu", "Cintiq Partner (PTU)", WACOMDEVICE_PTU, xCintiqPartner, 1 },
diff --git a/src/util/xidump.c b/src/util/xidump.c
index 4a7ef8e..319ce05 100755
--- a/src/util/xidump.c
+++ b/src/util/xidump.c
@@ -2,7 +2,7 @@
** xidump.c
**
** Copyright (C) 2003 - 2004 - John E. Joganic
-** Copyright (C) 2004 - 2008 - Ping Cheng
+** Copyright (C) 2004 - 2009 - Ping Cheng
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
@@ -32,6 +32,7 @@
** 2007-01-10 0.7.7 - Don't list uninitialized tools
** 2008-05-06 0.8.0 - Support Xorg 7.3 or later
** 2008-12-31 0.8.2 - Support USB Tabket PCs
+** 2009-03-06 0.8.3 - Support Intuos4
**
****************************************************************************/
@@ -43,7 +44,7 @@
#include <sys/time.h>
#include <math.h>
-#define XIDUMP_VERSION "0.8.2"
+#define XIDUMP_VERSION "0.8.3"
#include "../include/util-config.h"
@@ -416,7 +417,7 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
int nRow=0, nTitleRow, nPressRow, nProxRow, nFocusRow, nButtonRow,
nKeyRow, nValRow;
int nMaxPress=100, nMinPress=0;
- int bStylus = 0;
+ int bTilt = 0;
char chBuf[1024];
XEvent event;
XAnyEvent* pAny;
@@ -445,19 +446,16 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
pClass = (XAnyClassPtr)((char*)pClass + pClass->length);
}
- snprintf(chBuf,sizeof(chBuf),"InputDevice: %s",pDevInfo->name);
- wacscrn_output(nRow,0,chBuf);
- nRow += 1;
-
/* display valuator related info */
nTitleRow = nRow;
if (pValInfo)
{
- snprintf(chBuf,sizeof(chBuf),"Valuators: %s ID: Unreported Serial Number: Unreported",
+ snprintf(chBuf,sizeof(chBuf),"InputDevice: %s Valuators: %s",pDevInfo->name,
pValInfo->mode == Absolute ? "Absolute" :
pValInfo->mode == Relative ? "Relative" : "Unknown");
wacscrn_output(nRow,0,chBuf);
- nRow += 2;
+ nRow += 1;
+
nValRow = nRow;
nRow += 6;
@@ -470,10 +468,11 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
nMaxPress = pValInfo->axes[2].max_value;
nMinPress = pValInfo->axes[2].min_value;
- /* should be a better way to identify the stylus */
+ /* Decide tilts or rotation/throttle */
if ((pValInfo->axes[3].min_value == -64) &&
(pValInfo->axes[4].min_value == -64))
- bStylus = 1;
+ bTilt = 1;
+
for (k=0; k<pValInfo->num_axes && k<6; ++k)
{
@@ -481,8 +480,8 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
k == 0 ? " x-axis " :
k == 1 ? " y-axis " :
k == 2 ? "pressure" :
- k == 3 ? (bStylus ? " x-tilt " : "rotation" ) :
- k == 4 ? (bStylus ? " y-tilt " : "throttle" ) :
+ k == 3 ? (bTilt ? " x-tilt " : "rotation" ) :
+ k == 4 ? (bTilt ? " y-tilt " : "throttle" ) :
k == 5 ? " wheel " : " error ");
snprintf(chBuf,sizeof(chBuf),"%+06d",
@@ -498,6 +497,7 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
}
nPressRow = nRow++;
+
nProxRow = nRow++;
nFocusRow = nRow++;
nButtonRow = nRow++;
@@ -547,12 +547,6 @@ static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
}
else
{
- /* title value */
- snprintf(chBuf,sizeof(chBuf),"%s",
- pValInfo->mode == Absolute ? "Absolute" :
- pValInfo->mode == Relative ? "Relative" : "Unknown");
- wacscrn_output(nTitleRow,11,chBuf);
-
/* Device/tool ID can only be retrieved through the ToolID option
* of xsetwacom due to valuator backward compatibility concern
*
@@ -709,19 +703,15 @@ static int RawRunDefault(Display* pDisp, XDeviceInfo* pDevInfo)
else if (pAny->type == gnInputEvent[INPUTEVENT_MOTION_NOTIFY])
{
XDeviceMotionEvent* pMove = (XDeviceMotionEvent*)pAny;
- int v = (pMove->axis_data[4]&0xffff0000) |
- ((pMove->axis_data[5]&0xffff0000)>>16);
printf("Motion: x=%+6d y=%+6d p=%4d tx=%+4d ty=%+4d "
- "w=%+5d ID: %4d Serial: %11d \n",
+ "w=%+5d \n",
pMove->axis_data[0],
pMove->axis_data[1],
pMove->axis_data[2],
(short)(pMove->axis_data[3]&0xffff),
(short)(pMove->axis_data[4]&0xffff),
- (short)(pMove->axis_data[5]&0xffff),
- (pMove->axis_data[3]&0xffff0000)>>16,
- v);
+ (short)(pMove->axis_data[5]&0xffff));
}
else if ((pAny->type == gnInputEvent[INPUTEVENT_BTN_PRESS]) ||
@@ -1056,6 +1046,8 @@ int main(int argc, char** argv)
const char* pa;
Display* pDisp = NULL;
const char* pszDeviceName = NULL;
+ char sCallString[256], serialNum[256], toolID[256];
+ FILE* ptr;
++argv;
while ((pa = *(argv++)) != NULL)
@@ -1131,6 +1123,19 @@ int main(int argc, char** argv)
Usage(1);
}
+ /* get tool ID and serial number from xsetwacom */
+ if (pszDeviceName)
+ {
+ sprintf(sCallString, "xsetwacom get %s toolId", pszDeviceName);
+ if ((ptr = popen(sCallString, "r")) != NULL)
+ fgets(toolID, 32, ptr);
+ pclose(ptr);
+ sprintf(sCallString, "xsetwacom get %s ToolSerial", pszDeviceName);
+ if ((ptr = popen(sCallString, "r")) != NULL)
+ fgets(serialNum, 32, ptr);
+ pclose(ptr);
+ }
+
/* default to first valid UI, if not specified */
if (pUI == NULL)
pUI = gpUIs[0];
diff --git a/src/util/xsetwacom.c b/src/util/xsetwacom.c
index a492301..cf478fb 100755
--- a/src/util/xsetwacom.c
+++ b/src/util/xsetwacom.c
@@ -2,7 +2,7 @@
** xsetwacom.c
**
** Copyright (C) 2003 - John E. Joganic
-** Copyright (C) 2004-2008 - Ping Cheng
+** Copyright (C) 2004-2009 - Ping Cheng
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public License
@@ -34,10 +34,11 @@
** 2008-01-17 0.1.5 - PC - Add DISPLAYTOGGLE command
** 2008-03-24 0.1.6 - PC - Added Touch for serial Tablet PC (ISDv4)
** 2008-08-27 0.1.7 - PC - Added get XORGVER to xsetwacom
+** 2009-02-27 0.1.8 - PC - Added LeftOf and AboveOf to TwinView
**
****************************************************************************/
-#define XSETWACOM_VERSION "0.1.7"
+#define XSETWACOM_VERSION "0.1.8"
#include "../include/util-config.h"
@@ -105,6 +106,8 @@ static const char* tv_char[] =
"none",
"vertical",
"horizontal",
+ "aboveof"
+ "leftof"
"NULL"
};
@@ -302,7 +305,7 @@ static PARAMINFO gParamInfo[] =
{ "CommonDBG",
"Level of debugging statements applied to all devices "
- "associated with the same tablet. default is 0 (off). ",
+ "associated with the same tablet. \n\t\t default is 0 (off). ",
XWACOM_PARAM_COMMONDBG, VALUE_OPTIONAL, RANGE,
0, 100, SINGLE_VALUE, 0 },
@@ -329,10 +332,10 @@ static PARAMINFO gParamInfo[] =
0, 100, PACKED_CURVE, 0x00006464},
{ "TwinView",
- "Sets the mapping to TwinView horizontal/vertical/none. "
- "Values = none, vertical, horizontal (default is none).",
+ "Sets the mapping to TwinView horizontal/vertical/leftof/aboveof/none. \n"
+ "\t\t Values = none, vertical, horizontal, leftof, aboveof (default is none).",
XWACOM_PARAM_TWINVIEW, VALUE_OPTIONAL, RANGE,
- TV_NONE, TV_LEFT_RIGHT, SINGLE_VALUE, TV_NONE },
+ TV_NONE, TV_MAX, SINGLE_VALUE, TV_NONE },
{ "Mode",
"Switches cursor movement mode (default is absolute/on). ",
@@ -353,21 +356,23 @@ static PARAMINFO gParamInfo[] =
{ "Capacity",
"Touch sensitivity level (default is 3, "
- "-1 for none capacitive tools).",
+ "-1 for none capacitive tools). ",
XWACOM_PARAM_CAPACITY, VALUE_OPTIONAL,
RANGE, -1, 5, SINGLE_VALUE, 3 },
{ "CursorProx",
"Sets cursor distance for proximity-out "
- "in distance from the tablet. "
- "(default is 10 for Intuos series, "
- "42 for Graphire series).",
+ "in distance from the tablet. \n"
+ "\t\t (default is 10 for Intuos series, "
+ "42 for Graphire series). ",
XWACOM_PARAM_CURSORPROX, VALUE_OPTIONAL, RANGE,
0, 255, SINGLE_VALUE, 47 },
{ "Rotate",
"Sets the rotation of the tablet. "
- "Values = NONE, CW, CCW, HALF (default is NONE).",
+ "Values = NONE, CW, CCW, HALF (default is NONE). \n"
+ "\t\t Tablet mappings applied after this command will "
+ "be based on the new tablet orientation. ",
XWACOM_PARAM_ROTATE, VALUE_OPTIONAL, RANGE,
ROTATE_NONE, ROTATE_HALF, SINGLE_VALUE, ROTATE_NONE },
@@ -438,6 +443,11 @@ static PARAMINFO gParamInfo[] =
XWACOM_PARAM_CLICKFORCE, VALUE_OPTIONAL, RANGE,
1, 21, SINGLE_VALUE, 6 },
+ { "Threshold",
+ "Sets tip/eraser pressure threshold directly to the pressure "
+ "(default is 6*MaxZ/100)",
+ XWACOM_PARAM_THRESHOLD, VALUE_REQUIRED },
+
{ "Accel",
"Sets relative cursor movement acceleration "
"(default is 1)",
@@ -1152,13 +1162,14 @@ static void DisplayValue (WACOMDEVICE *hDev, const char *devname, PARAMINFO *p,
}
break;
default:
- if ( ((value & AC_TYPE) != AC_KEY) &&
- ((value & AC_TYPE) != AC_MODETOGGLE) &&
- ((value & AC_TYPE) != AC_DBLCLICK) &&
- ((value & AC_TYPE) != AC_DISPLAYTOGGLE) )
- printf ("%d\n", value);
- else
+ if ( (p->nType == ACTION_VALUE) &&
+ (((value & AC_TYPE) == AC_KEY) ||
+ ((value & AC_TYPE) == AC_MODETOGGLE) ||
+ ((value & AC_TYPE) == AC_DBLCLICK) ||
+ ((value & AC_TYPE) == AC_DISPLAYTOGGLE)) )
printf ("%s\n", strval);
+ else
+ printf ("%d\n", value);
break;
}
}
diff --git a/src/wacom.4x b/src/wacom.4x
index ea3406a..1ed9885 100644
--- a/src/wacom.4x
+++ b/src/wacom.4x
@@ -1,7 +1,7 @@
.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/wacom.man,v 1.1 2001/01/24 00:06:39 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
-.TH WACOM 4x "linuxwacom 0.8.2" "X Version 11"
+.TH WACOM 4x "linuxwacom 0.8.3" "X Version 11"
.SH NAME
wacom \- Wacom input driver
.SH SYNOPSIS
@@ -144,7 +144,7 @@ A Rspeed greater than 1.0 will speed up the cursor's relative movement. A Rspee
less than 1.0 but greater than 0 will slow down the cursor's relative movement.
A Rspeed too close to 0 is not recommanded.
.TP 4
-.B Option \fI"Twinview"\fP \fI"horizontal"|"vertical"|"none"\fP
+.B Option \fI"Twinview"\fP \fI"horizontal"|"vertical"|"leftof"|"aboveof"|"none"\fP
sets the orientation of TwinView to map the tablet to one screen and to be able
to move the screen cursor from one screen to the other when tool reaches the
edge of the tablet. The cursor can be constrained in a specific screen if
@@ -167,7 +167,9 @@ In a multi-monitor environment, specifies the screen number in which the cursor
turns on/off across monitor movement on a non-TwinView multi-monitor desktop. The default is "on".
.TP 4
.B Option \fI"Rotate"\fP \fI"CW"|"CCW"|"HALF"|"NONE"\fP
-rotates the tablet orientation clockwise (CCW) or anti-clockwise (CW) or 180 degrees (HALF). The default is "NONE".
+rotates the tablet orientation counterclockwise (CCW) or clockwise (CW) or 180 degrees (HALF).
+If you have specific tablet mappings, i.e. TopX/Y or BottomX/Y were set, the mapping will be
+applied before rotation. The default is "NONE".
.TP 4
.B Option \fI"PressCurve"\fP \fI"x1,y1,x2,y2"\fP
sets pressure curve by control points x1, y1, x2, and y2. Their values are in range
@@ -196,13 +198,15 @@ messages with a level less than or equal to the "number" will
be logged into /etc/X11/Xorg.0.log.
.TP 4
.B Option \fI"CursorProx"\fP \fI"number"\fP
-sets the max distance from tablet to stop reporting movement for cursor in relative mode. Default for Intuos series is 10, for Graphire series (including Volitos) is 42.
+sets the max distance from tablet to stop reporting movement for cursor in relative mode.
+Default for Intuos series is 10, for Graphire series (including Volitos) is 42.
.TP 4
.B Option \fI"Serial"\fP \fI"number"\fP
sets the serial number associated with the physical device. This allows
to have multiple devices of the same type (i.e. multiple pens). This
option is only available on wacom V devices (Intuos series and Cintiq 21U).
-To see which serial number belongs to a device, you need to run the utility program, xsetwacom, which comes with linuxwacom package.
+To see which serial number belongs to a device, you need to run the utility program,
+xsetwacom, which comes with linuxwacom package.
.TP 4
.B Option \fI"Threshold"\fP \fI"number"\fP
sets the pressure threshold used to generate a button 1 events of stylus.
diff --git a/src/wacomxi/wacomcpl-exec b/src/wacomxi/wacomcpl-exec
index 1e7c3ce..c8cba71 100755
--- a/src/wacomxi/wacomcpl-exec
+++ b/src/wacomxi/wacomcpl-exec
@@ -135,16 +135,14 @@ proc updateXinitrc {device option value} {
proc calibrationSequence {which xDev yDev} {
global device calibResults screenY_org screenX_org
global workingTags screenTags size numScreens
- global swapThresh screenWidth screenHeight
+ global swapThresh screenWidth screenHeight getOptionDefault
global getDeviceModel screenXBottom screenYBottom
set scaling [exec xsetwacom get $device xscaling]
- set bottomX [exec xsetwacom getdefault $device BottomX]
- set bottomY [exec xsetwacom getdefault $device BottomY]
if { $scaling == 1 } {
- set xNewDev [expr (($xDev - $screenX_org) * $bottomX)]
+ set xNewDev [expr (($xDev - $screenX_org) * $getOptionDefault($device,BottomX))]
set xDev [expr ($xNewDev / ($screenXBottom - $screenX_org))]
- set yNewDev [expr (($yDev - $screenY_org) * $bottomY)]
+ set yNewDev [expr (($yDev - $screenY_org) * $getOptionDefault($device,BottomY))]
set yDev [expr ($yNewDev / ($screenYBottom - $screenY_org))]
}
set calibResults(xDev,$which) $xDev
@@ -160,6 +158,17 @@ proc calibrationSequence {which xDev yDev} {
.bottomright.m configure -background "#505075"
wacomxi::bindevent .bottomright.m $device <ButtonRelease> ""
set borderOffset [expr ($size / 2 )]
+
+ # set tablet values to normal
+ if { $calibResults(xDev,0) > [expr ($getOptionDefault($device,BottomX) / 2)] } {
+ set calibResults(xDev,0) [expr ($calibResults(xDev,0) - $getOptionDefault($device,BottomX))]
+ set calibResults(xDev,1) [expr ($calibResults(xDev,1) - $getOptionDefault($device,BottomX))]
+ }
+ if { $calibResults(yDev,0) > [expr ($getOptionDefault($device,BottomY) / 2)] } {
+ set calibResults(yDev,0) [expr ($calibResults(yDev,0) - $getOptionDefault($device,BottomY))]
+ set calibResults(yDev,1) [expr ($calibResults(yDev,1) - $getOptionDefault($device,BottomY))]
+ }
+
set widthDev [expr $calibResults(xDev,1) - $calibResults(xDev,0)]
set heightDev [expr $calibResults(yDev,1) - $calibResults(yDev,0)]
set widthX [expr $screenWidth-$size]
@@ -223,8 +232,13 @@ proc calibrationSequence {which xDev yDev} {
proc Calibration {} {
global numScreens device screenTags getOption Option
- set Option(1) "Mode"
- getDeviceOptionProc $device 1
+ set Option(1) "TopX"
+ set Option(2) "TopY"
+ set Option(3) "BottomX"
+ set Option(4) "BottomY"
+ set Option(5) "Mode"
+
+ getDeviceOptionProc $device 5
set mode $getOption($device,Mode)
if { $mode != 1 } {
disableButtons
@@ -421,7 +435,7 @@ proc getDeviceOptionProc { dev i } {
set getOption($dev,$Option($j)) $ignoreButton
}
}
- if { $value == 0 } {
+ if { $value1 == 0 } {
set getOptionDefault($dev,$Option($j)) $ignoreButton
}
}
@@ -635,7 +649,7 @@ proc updateButton {} {
} }
"Ignore"
{ set j $ignoreButton
- set v "Button 0" }
+ set v "Button $j" }
}
set getOption($device,$spName($k)) $j
updateXinitrc $device $spName($k) $v
@@ -672,17 +686,17 @@ proc updateButton {} {
proc defaultButton {} {
global db db1 db2 db3 db4 db5 db6 db7 db8 db9 db10
- global db11 db12 db13 db14 isLCD spName
- global dm sm dmv smv numButton startS numStrips
+ global db11 db12 db13 db14 isLCD
+ global dm sm dmv smv numButton startS numStrips spName
global device getOptionDefault getDeviceModel
-
for { set i 1 } { $i <= $numButton } { incr i 1 } {
set db$i $db($getOptionDefault($device,$spName($i)))
}
if { $startS } {
for { set i $startS } { $i <= [ expr ($startS+$numStrips-1) ] } { incr i 1 } {
- set db$i $db($getOptionDefault($device,$spName([ expr ($numButton+$i) ])))
+ set k [ expr ($numButton+$i-$startS+1) ]
+ set db$k $db($getOptionDefault($device,$spName($k)))
}
}
@@ -913,9 +927,9 @@ proc closeTabWindow {} {
proc expressKeys { } {
global db db1 db2 db3 db4 db5 db6 db7 db8 db9 db10
- global db11 db12 db13 db14 startS getOption
+ global db11 db12 db13 db14 startS
global currentW device numButton spName numStrips
- global getDeviceModel cKeys oldKeys
+ global getDeviceModel cKeys oldKeys getOption
global displayToggleB ignoreButton keystrokeB
global numPadRings numPadStrips numPadAbsW numPadRelW
@@ -970,21 +984,15 @@ proc expressKeys { } {
proc addMenu { curb } {
global db db1 db2 db3 db4 db5 db6 db7 db8 db9 db10
- global db11 db12 db13 db14 currentW
- global getOption getDeviceModel cKeys oldKeys device spName
- global doubleClickB displayToggleB ignoreButton modeToggleB keystrokeB
+ global db11 db12 db13 db14 currentW device spName
+ global getOption getDeviceModel cKeys oldKeys keystrokeB
+ global doubleClickB displayToggleB ignoreButton modeToggleB
set model $getDeviceModel($device,model)
set type $getDeviceModel($device,type)
set opt $getOption($device,$spName($curb))
if { $opt == "" } { set opt $curb }
- if { ![string compare $type "pad"] } {
- # values 30 or larger are special functions
- if { ($opt > 8 && $opt < 30) } {
- set opt [ expr ($opt-8) ]
- }
- }
set db$curb $db($opt)
#reset keys
@@ -1264,13 +1272,16 @@ proc initialSet {} {
set tv(0) "None"
set tv(1) "Vertical"
set tv(2) "Horizontal"
- for { set i 0 } { $i < 3 } { incr i 1 } {
+ set tv(3) "AboveOf"
+ set tv(4) "LeftOf"
+
+ for { set i 0 } { $i < 5 } { incr i 1 } {
if { $tvID == $i } {
set tvd $tv($i)
}
}
- tk_optionMenu $currentW.f.tvmenu tvd $tv(0) $tv(1) $tv(2)
+ tk_optionMenu $currentW.f.tvmenu tvd $tv(0) $tv(1) $tv(2) $tv(3) $tv(4)
grid $currentW.f.tv -row 2 -column 0
grid $currentW.f.tvmenu -row 2 -column 1
@@ -1315,6 +1326,12 @@ proc updateSet {} {
if { ![ string compare $tv "Vertical" ] } {
set tv 1
}
+ if { ![ string compare $tv "LeftOf" ] } {
+ set tv 4
+ }
+ if { ![ string compare $tv "AboveOf" ] } {
+ set tv 3
+ }
set tvID [ exec xsetwacom get $device TwinView ]
if { $tv != $tvID } {
@@ -1637,7 +1654,6 @@ proc createPanel { pressure button mapping calibrate } {
# buttons and expresskeys
getNumButton $type
setspName
-
set SN [ exec xsetwacom get $device ToolSerial ]
if { $SN && [string compare type "pad"] } {
set hexSN [format %X $SN]
@@ -1783,6 +1799,13 @@ proc updateModelInfo { } {
set numPadButtons(198) 10
set numPadStrips(198) 2
+ set numPadButtons(184) 7
+ set numPadRings(184) 1
+ for { set i 185 } { $i <= 187 } { incr i 1 } {
+ set numPadButtons($i) 9
+ set numPadRings($i) 1
+ }
+
for { set i 0 } { $i <= 198 } { incr i 1 } {
if { $numPadButtons($i) || $numPadRings($i)
|| $numPadStrips($i) || $numPadAbsW($i)
diff --git a/src/xdrv/Makefile.am b/src/xdrv/Makefile.am
index a0ba643..be4f2d4 100755
--- a/src/xdrv/Makefile.am
+++ b/src/xdrv/Makefile.am
@@ -12,7 +12,7 @@ EXTRA_DIST = xf86Wacom.c wcmXCommand.c xf86Wacom.h \
wcmSerial.c wcmISDV4.c wcmUSB.c \
wcmCommon.c wcmCompat.c wcmConfig.c \
wcmFilter.c wcmFilter.h wcmSerial.h \
- ../include/Xwacom.h
+ ../include/Xwacom.h wcmTilt2Rotation.c
if WCM_ENV_XORGSDK
DRIVER_INCLUDES = -I../include -I$(WCM_XORGSDK_DIR) $(X_CFLAGS)
@@ -41,7 +41,7 @@ endif
XF86OBJS = xf86Wacom.o wcmSerial.o wcmUSB.o wcmISDV4.o \
wcmXCommand.o wcmCommon.o wcmCompat.o wcmConfig.o \
- wcmFilter.o
+ wcmFilter.o wcmTilt2Rotation.o
$(XF86OBJS):
$(CC) $(CFLAGS) $(WCM_DEPFLAGS) $(DLLOADER) -pipe $(WCM_CLEVEL) \
diff --git a/src/xdrv/wcmCommon.c b/src/xdrv/wcmCommon.c
index ff834f4..30de949 100755
--- a/src/xdrv/wcmCommon.c
+++ b/src/xdrv/wcmCommon.c
@@ -1,6 +1,6 @@
/*
* Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org>
- * Copyright 2002-2008 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
+ * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -45,6 +45,9 @@ WacomDeviceClass* wcmDeviceClasses[] =
extern int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode);
extern void xf86WcmChangeScreen(LocalDevicePtr local, int value);
extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
+extern void xf86WcmVirtaulTabletSize(LocalDevicePtr local);
+extern void xf86WcmVirtaulTabletPadding(LocalDevicePtr local);
+extern void xf86WcmTilt2R(WacomDeviceStatePtr ds);
/*****************************************************************************
* Static functions
@@ -56,7 +59,7 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
static void resetSampleCounter(const WacomChannelPtr pChannel);
static void sendAButton(LocalDevicePtr local, int button, int mask,
int rx, int ry, int rz, int v3, int v4, int v5);
-
+
/*****************************************************************************
* xf86WcmMappingFactor --
* calculate the proper tablet to screen mapping factor according to the
@@ -66,13 +69,10 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
void xf86WcmMappingFactor(LocalDevicePtr local)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
- int i = 0, minX = 0, minY = 0, maxX = 0, maxY = 0;
DBG(10, priv->debugLevel, ErrorF("xf86WcmMappingFactor \n"));
- priv->sizeX = priv->bottomX - priv->topX - 2*priv->tvoffsetX;
- priv->sizeY = priv->bottomY - priv->topY - 2*priv->tvoffsetY;
- priv->maxWidth = 0, priv->maxHeight = 0;
+ xf86WcmVirtaulTabletSize(local);
if (!(priv->flags & ABSOLUTE_FLAG) || !priv->wcmMMonitor)
{
@@ -104,44 +104,11 @@ void xf86WcmMappingFactor(LocalDevicePtr local)
if (priv->currentScreen == -1) /* tool on the tablet */
priv->currentScreen = 0;
- if ( ((priv->twinview != TV_NONE) || /* TwinView & whole desktop */
- /* stay in one screen at a time (multimonitor) */
- !priv->wcmMMonitor ||
- /* always stay in the configured screen */
- (screenInfo.numScreens > 1 && priv->screen_no != -1))
- && (priv->flags & ABSOLUTE_FLAG) )
- {
- priv->maxWidth = priv->screenBottomX[priv->currentScreen] -
- priv->screenTopX[priv->currentScreen];
- priv->maxHeight = priv->screenBottomY[priv->currentScreen] -
- priv->screenTopY[priv->currentScreen];
- }
- else
- {
- /* count the whole desktop when no specific screen is defined or
- * tool is in relative mode
- */
- minX = priv->screenTopX[0];
- minY = priv->screenTopY[0];
- maxX = priv->screenBottomX[0];
- maxY = priv->screenBottomY[0];
- for (i = 1; i < priv->numScreen; i++)
- {
- if (priv->screenTopX[i] < minX)
- minX = priv->screenTopX[i];
- if (priv->screenTopY[i] < minY)
- minY = priv->screenTopY[i];
- if (priv->screenBottomX[i] > maxX)
- maxX = priv->screenBottomX[i];
- if (priv->screenBottomY[i] > maxY)
- maxY = priv->screenBottomY[i];
- }
- priv->maxWidth = maxX - minX;
- priv->maxHeight = maxY - minY;
- }
DBG(10, priv->debugLevel, ErrorF("xf86WcmMappingFactor"
- " Active tablet area x=%d y=%d map to maxWidth =%d maxHeight =%d\n",
- priv->sizeX, priv->sizeY, priv->maxWidth, priv->maxHeight));
+ " Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map"
+ " to maxWidth =%d maxHeight =%d\n",
+ priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY,
+ priv->maxWidth, priv->maxHeight));
priv->factorX = (double)priv->maxWidth / (double)priv->sizeX;
priv->factorY = (double)priv->maxHeight / (double)priv->sizeY;
@@ -157,15 +124,20 @@ void xf86WcmMappingFactor(LocalDevicePtr local)
* combined horizontal and vertical setups
****************************************************************************/
-static void xf86WcmSetScreen(LocalDevicePtr local, int *value0, int *value1)
+static void xf86WcmSetScreen(LocalDevicePtr local, int v0, int v1)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
- int screenToSet = -1, letfPadding = 0, topPadding = 0;
- int i, j, x, y, v0 = *value0, v1 = *value1;
+ int screenToSet = -1, i, j, x, y, tabletSize = 0;
- DBG(6, priv->debugLevel, ErrorF("xf86WcmSetScreen "
- "v0=%d v1=%d currentScreen=%d\n", *value0,
- *value1, priv->currentScreen));
+ DBG(6, priv->debugLevel, ErrorF("xf86WcmSetScreen v0=%d v1=%d "
+ "currentScreen=%d\n", v0, v1, priv->currentScreen));
+
+ if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen)
+ {
+ ErrorF("xf86WcmSetScreen Screen%d is larger than number of available screens (%d)\n",
+ priv->screen_no, priv->numScreen);
+ priv->screen_no = -1;
+ }
if (!(local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER))) return;
@@ -173,18 +145,38 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int *value0, int *value1)
{
if (priv->twinview == TV_LEFT_RIGHT)
{
- if (v0 > priv->bottomX - priv->tvoffsetX && v0 <= priv->bottomX)
+ tabletSize = priv->bottomX - priv->tvoffsetX;
+ if (v0 > tabletSize && v0 <= priv->bottomX)
priv->currentScreen = 1;
if (v0 > priv->topX && v0 <= priv->topX + priv->tvoffsetX)
priv->currentScreen = 0;
}
if (priv->twinview == TV_ABOVE_BELOW)
{
- if (v1 > priv->bottomY - priv->tvoffsetY && v1 <= priv->bottomY)
+ tabletSize = priv->bottomY - priv->tvoffsetY;
+ if (v0 > tabletSize && v0 <= priv->bottomY)
+ priv->currentScreen = 1;
+ if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY)
+ priv->currentScreen = 0;
+ }
+ if (priv->twinview == TV_RIGHT_LEFT)
+ {
+ tabletSize = priv->bottomX - priv->tvoffsetX;
+ if (v0 > tabletSize && v0 <= priv->bottomX)
+ priv->currentScreen = 0;
+ if (v0 > priv->topX && v0 <= priv->topX + priv->tvoffsetX)
priv->currentScreen = 1;
- if (v1 > priv->topY && v1 <= priv->topY + priv->tvoffsetY)
+ }
+ if (priv->twinview == TV_BELOW_ABOVE)
+ {
+ tabletSize = priv->bottomY - priv->tvoffsetY;
+ if (v0 > tabletSize && v0 <= priv->bottomY)
priv->currentScreen = 0;
+ if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY)
+ priv->currentScreen = 1;
}
+ DBG(10, priv->debugLevel, ErrorF("xf86WcmSetScreen TwinView setup screenToSet=%d\n",
+ priv->currentScreen));
}
xf86WcmMappingFactor(local);
@@ -219,24 +211,21 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int *value0, int *value1)
break;
}
}
- if (screenToSet != -1)
- {
- letfPadding = priv->screenTopX[screenToSet];
- topPadding = priv->screenTopY[screenToSet];
- }
- else
- {
- DBG(3, priv->debugLevel, ErrorF("xf86WcmSetScreen Error: "
- "Can not find valid screen (currentScreen=%d)\n",
- priv->currentScreen));
- return;
- }
}
else
screenToSet = priv->screen_no;
- x = (double)v0 * priv->factorX - letfPadding + 0.5;
- y = (double)v1 * priv->factorY - topPadding + 0.5;
+ if (screenToSet == -1)
+ {
+ DBG(3, priv->debugLevel, ErrorF("xf86WcmSetScreen Error: "
+ "Can not find valid screen (currentScreen=%d)\n",
+ priv->currentScreen));
+ return;
+ }
+
+ xf86WcmVirtaulTabletPadding(local);
+ x = ((double)(v0 + priv->leftPadding) * priv->factorX) - priv->screenTopX[screenToSet] + 0.5;
+ y = ((double)(v1 + priv->topPadding) * priv->factorY) - priv->screenTopY[screenToSet] + 0.5;
if (x >= screenInfo.screens[screenToSet]->width)
x = screenInfo.screens[screenToSet]->width - 1;
@@ -244,8 +233,7 @@ static void xf86WcmSetScreen(LocalDevicePtr local, int *value0, int *value1)
y = screenInfo.screens[screenToSet]->height - 1;
xf86XInputSetScreen(local, screenToSet, x, y);
- DBG(10, priv->debugLevel, ErrorF("xf86WcmSetScreen"
- " current=%d ToSet=%d\n",
+ DBG(10, priv->debugLevel, ErrorF("xf86WcmSetScreen current=%d ToSet=%d\n",
priv->currentScreen, screenToSet));
priv->currentScreen = screenToSet;
}
@@ -515,21 +503,9 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
#if WCM_XINPUTABI_MAJOR == 0
int is_core = local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER);
#endif
- int button_idx, naxes = priv->naxes;
-
- if (IsPad(priv))
- button -= 8;
-
- if (button < 0 || button >= priv->nbuttons)
- {
- /* should never happen */
- ErrorF ("sendAButton: Invalid button index %d (number of defined buttons = %d)\n", button, priv->nbuttons);
- return;
- }
+ int naxes = priv->naxes;
- button_idx = button;
- button = priv->button[button];
- if (!button) /* ignore this button event */
+ if (!priv->button[button]) /* ignore this button event */
return;
#if WCM_XINPUTABI_MAJOR == 0
@@ -542,23 +518,18 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
"sendAButton TPCButton(%s) button=%d state=%d "
"code=%08x, for %s coreEvent=%s \n",
common->wcmTPCButton ? "on" : "off",
- button_idx, mask, button,
- local->name, (button & AC_CORE) ? "yes" : "no"));
+ button, mask, priv->button[button],
+ local->name, (priv->button[button] & AC_CORE) ? "yes" : "no"));
switch (button & AC_TYPE)
{
case AC_BUTTON:
-/* xf86PostButtonEvent(local->dev, is_absolute, button & AC_CODE,
-*/ /* Dynamically modify the button map as required --
- * to be moved in the place where button mappings are changed
- */
- local->dev->button->map [button_idx] = button & AC_CODE;
- xf86PostButtonEvent(local->dev, is_absolute, button_idx,
+ xf86PostButtonEvent(local->dev, is_absolute, priv->button[button] & AC_CODE,
mask != 0,0,naxes,rx,ry,rz,v3,v4,v5);
break;
case AC_KEY:
- sendKeystroke(local, button, priv->keys[button_idx], mask);
+ sendKeystroke(local, priv->button[button], priv->keys[button], mask);
break;
case AC_MODETOGGLE:
@@ -599,27 +570,19 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
break;
case AC_DBLCLICK:
- /* Dynamically modify the button map as required --
- * to be moved in the place where button mappings are changed.
- * Only left double is supported.
- */
- local->dev->button->map [button_idx] = 1;
-
if (mask)
{
/* Left button down */
xf86PostButtonEvent(local->dev, is_absolute,
- button_idx, 1,0,naxes,
- rx,ry,rz,v3,v4,v5);
+ 1,1,0,naxes, rx,ry,rz,v3,v4,v5);
/* Left button up */
xf86PostButtonEvent(local->dev, is_absolute,
- button_idx,0,0,naxes,
- rx,ry,rz,v3,v4,v5);
+ 1,0,0,naxes,rx,ry,rz,v3,v4,v5);
}
/* Left button down/up upon mask is 1/0 */
- xf86PostButtonEvent(local->dev, is_absolute, button_idx,
+ xf86PostButtonEvent(local->dev, is_absolute, 1,
mask != 0,0,naxes,rx,ry,rz,v3,v4,v5);
break;
}
@@ -636,7 +599,8 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
* Send events defined for relative/absolute wheels or strips
****************************************************************************/
-static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* ds, int x, int y, int z, int v3, int v4, int v5)
+static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* ds,
+ int x, int y, int z, int v3, int v4, int v5)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
int fakeButton = 0, i, value = 0, naxes = priv->naxes;
@@ -747,13 +711,11 @@ static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* d
switch (fakeButton & AC_TYPE)
{
case AC_BUTTON:
- /* send both button on/off in the same event for pad */
- local->dev->button->map [0] = fakeButton & AC_CODE;
-
- xf86PostButtonEvent(local->dev, is_absolute, 0,
+ /* send both button on/off in the same event for pad */
+ xf86PostButtonEvent(local->dev, is_absolute, fakeButton & AC_CODE,
1,0,naxes,x,y,z,v3,v4,v5);
- xf86PostButtonEvent(local->dev, is_absolute, 0,
+ xf86PostButtonEvent(local->dev, is_absolute, fakeButton & AC_CODE,
0,0,naxes,x,y,z,v3,v4,v5);
break;
@@ -850,13 +812,13 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
tx, ty, wheel, rot, throttle));
/* rotation mixes x and y up a bit */
- if (common->wcmRotate == ROTATE_CW)
+ if (common->wcmRotate == ROTATE_CCW)
{
tmp_coord = x;
x = y;
y = priv->wcmMaxY - tmp_coord;
}
- else if (common->wcmRotate == ROTATE_CCW)
+ else if (common->wcmRotate == ROTATE_CW)
{
tmp_coord = y;
y = x;
@@ -873,7 +835,7 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
v3 = rot;
v4 = throttle;
}
- else
+ else /* Intuos styli have tilt */
{
v3 = tx;
v4 = ty;
@@ -951,7 +913,7 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
* screen and modify the axes before posting events */
if(!(priv->flags & BUTTONS_ONLY_FLAG))
{
- xf86WcmSetScreen(local, &x, &y);
+ xf86WcmSetScreen(local, x, y);
}
/* unify acceleration in both directions
@@ -959,6 +921,13 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
*/
if (!is_absolute)
x *= priv->factorY / priv->factorX;
+ else
+ {
+ /* Padding virtual values */
+ xf86WcmVirtaulTabletPadding(local);
+ x += priv->leftPadding;
+ y += priv->topPadding;
+ }
#ifdef WCM_XORG_TABLET_SCALING
/* Ugly hack for Xorg 7.3, which doesn't call xf86WcmDevConvert
@@ -969,16 +938,15 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
if(is_absolute) {
x -= priv->topX;
y -= priv->topY;
+ if (priv->currentScreen == 1 && priv->twinview != TV_NONE)
+ {
+ x -= priv->tvoffsetX;
+ y -= priv->tvoffsetY;
+ }
}
x = (int)((double)x * priv->factorX + (x>=0?0.4:-0.4));
y = (int)((double)y * priv->factorY + (y>=0?0.4:-0.4));
- /* map to a specific screen */
- if (priv->screen_no != -1 || priv->twinview != TV_NONE)
- {
- x += priv->screenTopX[priv->currentScreen];
- y += priv->screenTopY[priv->currentScreen];
- }
priv->currentSX = x;
priv->currentSY = y;
#endif
@@ -1022,7 +990,7 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
x = 0;
y = 0;
if ( v3 || v4 || v5 )
- xf86WcmSetScreen(local, &x, &y);
+ xf86WcmSetScreen(local, x, y);
/* don't emit proximity events if device does not support proximity */
if ((local->dev->proximity && !priv->oldProximity))
@@ -1117,11 +1085,14 @@ static int xf86WcmSuppress(WacomCommonPtr common, const WacomDeviceState* dsOrig
if ((ABS(dsOrig->abswheel - dsNew->abswheel) > suppress)
|| (dsNew->relwheel != 0)) returnV = 1;
- /* need to check if cursor moves or not */
+ /* cursor moves or not? */
if ((ABS(dsOrig->x - dsNew->x) > suppress) ||
(ABS(dsOrig->y - dsNew->y) > suppress))
- returnV = 2;
- else if (returnV == 1) /* don't move the cursor */
+ {
+ if (!returnV) /* need to check if cursor moves or not */
+ returnV = 2;
+ }
+ else /* don't move cursor */
{
dsNew->x = dsOrig->x;
dsNew->y = dsOrig->y;
@@ -1243,6 +1214,13 @@ void xf86WcmEvent(WacomCommonPtr common, unsigned int channel,
return; /* discard */
}
#endif
+
+ if (strstr(common->wcmModel->name, "Intuos4"))
+ {
+ /* convert Intuos4 mouse tilt to rotation */
+ xf86WcmTilt2R(&ds);
+ }
+
fs = &pChannel->rawFilter;
if (!fs->npoints && ds.proximity)
{
@@ -1480,10 +1458,8 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
if (pDev && !miPointerGetScreen(pDev->dev))
#endif
{
- DBG(1, common->debugLevel, ErrorF("xf86WcmEvent: "
- "Wacom driver can not get Current Screen ID\n"));
- DBG(1, common->debugLevel, ErrorF(
- "Please remove Wacom tool from the tablet.\n"));
+ ErrorF("xf86WcmEvent: Wacom driver can not get Current Screen ID\n");
+ ErrorF("Please remove Wacom tool from the tablet and bring it back again.\n");
return;
}
@@ -1543,10 +1519,18 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
if (IsStylus(priv) || IsEraser(priv))
{
- if (filtered.pressure < common->wcmThreshold )
- filtered.buttons &= ~button;
- else
+ /* set button1 (left click) on/off */
+ if (filtered.pressure >= common->wcmThreshold)
filtered.buttons |= button;
+ else
+ {
+ /* threshold tolerance */
+ int tol = common->wcmMaxZ / 250;
+ if (strstr(common->wcmModel->name, "Intuos4"))
+ tol = common->wcmMaxZ / 125;
+ if (filtered.pressure < common->wcmThreshold + tol)
+ filtered.buttons &= ~button;
+ }
/* transform pressure */
transPressureCurve(priv,&filtered);
}
@@ -1620,10 +1604,10 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
#endif /* throttle */
- if (!(priv->flags & ABSOLUTE_FLAG) && (suppress == 2))
+ if (!(priv->flags & ABSOLUTE_FLAG))
{
/* To improve the accuracy of relative x/y,
- * don't send event when there is no movement.
+ * don't send motion event when there is no movement.
*/
double deltx = filtered.x - priv->oldX;
double delty = filtered.y - priv->oldY;
@@ -1632,9 +1616,15 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel,
if (ABS(deltx)<1 && ABS(delty)<1)
{
- DBG(10, common->debugLevel, ErrorF(
- "Ignore non-movement relative data \n"));
- return;
+ /* don't move the cursor */
+ if (suppress == 1)
+ {
+ /* send other events, such as button/wheel */
+ filtered.x = priv->oldX;
+ filtered.y = priv->oldY;
+ }
+ else /* no other events to send */
+ return;
}
else
{
@@ -1725,7 +1715,10 @@ int xf86WcmInitTablet(LocalDevicePtr local, const char* id, float version)
if (common->wcmThreshold <= 0)
{
/* Threshold for counting pressure as a button */
- common->wcmThreshold = common->wcmMaxZ * 3 / 50;
+ if (strstr(common->wcmModel->name, "Intuos4"))
+ common->wcmThreshold = common->wcmMaxZ * 3 / 25;
+ else
+ common->wcmThreshold = common->wcmMaxZ * 3 / 50;
ErrorF("%s Wacom using pressure threshold of %d for button 1\n",
XCONFIG_PROBED, common->wcmThreshold);
}
@@ -1822,7 +1815,7 @@ static void xf86WcmInitialTVScreens(LocalDevicePtr local)
priv->numScreen = 2;
- if (priv->twinview == TV_LEFT_RIGHT)
+ if ((priv->twinview == TV_LEFT_RIGHT) || (priv->twinview == TV_RIGHT_LEFT))
{
/* it does not need the offset if always map to a specific screen */
if (priv->screen_no == -1)
@@ -1840,7 +1833,7 @@ static void xf86WcmInitialTVScreens(LocalDevicePtr local)
priv->tvResolution[3] = priv->tvResolution[1];
}
}
- else if (priv->twinview == TV_ABOVE_BELOW)
+ else if ((priv->twinview == TV_ABOVE_BELOW) || (priv->twinview == TV_BELOW_ABOVE))
{
/* it does not need the offset if always map to a specific screen */
if (priv->screen_no == -1)
@@ -1860,12 +1853,12 @@ static void xf86WcmInitialTVScreens(LocalDevicePtr local)
}
/* initial screen info */
- priv->screenTopX[0] = 0;
- priv->screenTopY[0] = 0;
- priv->screenBottomX[0] = priv->tvResolution[0];
- priv->screenBottomY[0] = priv->tvResolution[1];
if (priv->twinview == TV_ABOVE_BELOW)
{
+ priv->screenTopX[0] = 0;
+ priv->screenTopY[0] = 0;
+ priv->screenBottomX[0] = priv->tvResolution[0];
+ priv->screenBottomY[0] = priv->tvResolution[1];
priv->screenTopX[1] = 0;
priv->screenTopY[1] = priv->tvResolution[1];
priv->screenBottomX[1] = priv->tvResolution[2];
@@ -1873,11 +1866,37 @@ static void xf86WcmInitialTVScreens(LocalDevicePtr local)
}
if (priv->twinview == TV_LEFT_RIGHT)
{
+ priv->screenTopX[0] = 0;
+ priv->screenTopY[0] = 0;
+ priv->screenBottomX[0] = priv->tvResolution[0];
+ priv->screenBottomY[0] = priv->tvResolution[1];
priv->screenTopX[1] = priv->tvResolution[0];
priv->screenTopY[1] = 0;
priv->screenBottomX[1] = priv->tvResolution[0] + priv->tvResolution[2];
priv->screenBottomY[1] = priv->tvResolution[3];
}
+ if (priv->twinview == TV_BELOW_ABOVE)
+ {
+ priv->screenTopX[0] = 0;
+ priv->screenTopY[0] = priv->tvResolution[1];
+ priv->screenBottomX[0] = priv->tvResolution[2];
+ priv->screenBottomY[0] = priv->tvResolution[1] + priv->tvResolution[3];
+ priv->screenTopX[1] = 0;
+ priv->screenTopY[1] = 0;
+ priv->screenBottomX[1] = priv->tvResolution[0];
+ priv->screenBottomY[1] = priv->tvResolution[1];
+ }
+ if (priv->twinview == TV_RIGHT_LEFT)
+ {
+ priv->screenTopX[0] = priv->tvResolution[0];
+ priv->screenTopY[0] = 0;
+ priv->screenBottomX[0] = priv->tvResolution[0] + priv->tvResolution[2];
+ priv->screenBottomY[0] = priv->tvResolution[3];
+ priv->screenTopX[1] = 0;
+ priv->screenTopY[1] = 0;
+ priv->screenBottomX[1] = priv->tvResolution[0];
+ priv->screenBottomY[1] = priv->tvResolution[1];
+ }
DBG(10, priv->debugLevel, ErrorF("xf86WcmInitialTVScreens for \"%s\" "
"topX0=%d topY0=%d bottomX0=%d bottomY0=%d "
@@ -1974,13 +1993,13 @@ static void rotateOneTool(WacomDevicePtr priv)
}
switch (common->wcmRotate) {
- case ROTATE_CW:
+ case ROTATE_CCW:
area->topX = priv->topX = tmpTopY;
area->bottomX = priv->bottomX = tmpBottomY;
area->topY = priv->topY = oldMaxX - tmpBottomX;
area->bottomY = priv->bottomY =oldMaxX - tmpTopX;
break;
- case ROTATE_CCW:
+ case ROTATE_CW:
area->topX = priv->topX = oldMaxY - tmpBottomY;
area->bottomX = priv->bottomX = oldMaxY - tmpTopY;
area->topY = priv->topY = tmpTopX;
@@ -1993,7 +2012,6 @@ static void rotateOneTool(WacomDevicePtr priv)
area->bottomY = priv->bottomY = oldMaxY - tmpTopY;
break;
}
- xf86WcmInitialScreens(priv->local);
xf86WcmMappingFactor(priv->local);
xf86WcmInitialCoordinates(priv->local, 0);
xf86WcmInitialCoordinates(priv->local, 1);
@@ -2009,10 +2027,10 @@ static void rotateOneTool(WacomDevicePtr priv)
}
/*****************************************************************************
- * xf86WcmRotateScreen
+ * xf86WcmRotateTablet
****************************************************************************/
-void xf86WcmRotateScreen(LocalDevicePtr local, int value)
+void xf86WcmRotateTablet(LocalDevicePtr local, int value)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
@@ -2020,7 +2038,7 @@ void xf86WcmRotateScreen(LocalDevicePtr local, int value)
int oldRotation;
int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
- DBG(10, priv->debugLevel, ErrorF("xf86WcmRotateScreen for \"%s\" \n", local->name));
+ DBG(10, priv->debugLevel, ErrorF("xf86WcmRotateTablet for \"%s\" \n", local->name));
if (common->wcmRotate == value) /* initialization */
{
@@ -2050,13 +2068,13 @@ void xf86WcmRotateScreen(LocalDevicePtr local, int value)
/* recover to the unrotated xy-rectangles */
switch (oldRotation) {
- case ROTATE_CW:
+ case ROTATE_CCW:
tmppriv->topX = oldMaxY - tmpBottomY;
tmppriv->bottomX = oldMaxY - tmpTopY;
tmppriv->topY = tmpTopX;
tmppriv->bottomY = tmpBottomX;
break;
- case ROTATE_CCW:
+ case ROTATE_CW:
tmppriv->topX = tmpTopY;
tmppriv->bottomX = tmpBottomY;
tmppriv->topY = oldMaxX - tmpBottomX;
@@ -2089,5 +2107,4 @@ void xf86WcmRotateScreen(LocalDevicePtr local, int value)
}
}
}
-
}
diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index c0d4a7f..98dee3a 100755
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -137,8 +137,7 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag)
/* Default button and expresskey values */
for (i=0; i<MAX_BUTTONS; i++)
- priv->button[i] = IsPad (priv) ?
- (AC_BUTTON | (MAX_MOUSE_BUTTONS/2 + i + 1)) : (AC_BUTTON | (i + 1));
+ priv->button[i] = (AC_BUTTON | (i + 1));
for (i=0; i<MAX_BUTTONS; i++)
for (j=0; j<256; j++)
@@ -148,8 +147,8 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag)
priv->relup = 5; /* Default relative wheel up event */
priv->reldn = 4; /* Default relative wheel down event */
- priv->wheelup = IsPad (priv) ? 5 : 0; /* Default absolute wheel up event */
- priv->wheeldn = IsPad (priv) ? 4 : 0; /* Default absolute wheel down event */
+ priv->wheelup = IsPad (priv) ? 4 : 0; /* Default absolute wheel up event */
+ priv->wheeldn = IsPad (priv) ? 5 : 0; /* Default absolute wheel down event */
priv->striplup = 4; /* Default left strip up event */
priv->stripldn = 5; /* Default left strip down event */
priv->striprup = 4; /* Default right strip up event */
@@ -161,12 +160,14 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag)
priv->maxWidth = 0; /* max active screen width */
priv->maxHeight = 0; /* max active screen height */
+ priv->leftPadding = 0; /* left padding for virtual tablet */
+ priv->topPadding = 0; /* top padding for virtual tablet */
priv->twinview = TV_NONE; /* not using twinview gfx */
priv->tvoffsetX = 0; /* none X edge offset for TwinView setup */
priv->tvoffsetY = 0; /* none Y edge offset for TwinView setup */
for (i=0; i<4; i++)
priv->tvResolution[i] = 0; /* unconfigured twinview resolution */
- priv->wcmMMonitor = 1; /* enabled (=1) to support multi-monitor desktop. */
+ priv->wcmMMonitor = 1; /* enabled (=1) to support multi-monitor desktop. */
/* disabled (=0) when user doesn't want to move the */
/* cursor from one screen to another screen */
@@ -376,13 +377,10 @@ static void xf86WcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags)
if (priv->pPressCurve)
xfree(priv->pPressCurve);
-#ifndef WCM_XORG_XSERVER_1_6
- /* don't free priv for X server 1.6 or later here
- * otherwise X server crashes
+ /* free priv here otherwise X server 1.6 or later crashes
*/
xfree(priv);
local->private = NULL;
-#endif
xf86DeleteInput(local, 0);
}
@@ -570,8 +568,6 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
*/
if (IsPad(priv))
xf86WcmSetPadCoreMode(local);
-else
-xf86Msg(X_CONFIG, "%s (%s) is not a pad \n", local->name, dev->identifier);
/* Store original local Core flag so it can be changed later */
if (local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER))
@@ -835,10 +831,13 @@ xf86Msg(X_CONFIG, "%s (%s) is not a pad \n", local->name, dev->identifier);
}
/* Tablet PC button applied to the whole tablet. Not just one tool */
- common->wcmTPCButton = xf86SetBoolOption(local->options,
+ if ( priv->flags & STYLUS_ID )
+ {
+ common->wcmTPCButton = xf86SetBoolOption(local->options,
"TPCButton", common->wcmTPCButtonDefault);
- if ( common->wcmTPCButton )
- xf86Msg(X_CONFIG, "%s: Tablet PC buttons are on \n", common->wcmDevice);
+ if ( common->wcmTPCButton )
+ xf86Msg(X_CONFIG, "%s: Tablet PC buttons are on \n", common->wcmDevice);
+ }
/* Touch applies to the whole tablet */
common->wcmTouch = xf86SetBoolOption(local->options, "Touch", common->wcmTouchDefault);
@@ -916,13 +915,20 @@ xf86Msg(X_CONFIG, "%s (%s) is not a pad \n", local->name, dev->identifier);
if (s) xf86Msg(X_CONFIG, "%s: Twinview = %s\n", dev->identifier, s);
if (s && xf86NameCmp(s, "none") == 0)
priv->twinview = TV_NONE;
- else if (s && xf86NameCmp(s, "horizontal") == 0)
+ else if ((s && xf86NameCmp(s, "horizontal") == 0) ||
+ (s && xf86NameCmp(s, "rightof") == 0))
priv->twinview = TV_LEFT_RIGHT;
- else if (s && xf86NameCmp(s, "vertical") == 0)
+ else if ((s && xf86NameCmp(s, "vertical") == 0) ||
+ (s && xf86NameCmp(s, "belowof") == 0))
priv->twinview = TV_ABOVE_BELOW;
+ else if (s && xf86NameCmp(s, "leftof") == 0)
+ priv->twinview = TV_RIGHT_LEFT;
+ else if (s && xf86NameCmp(s, "aboveof") == 0)
+ priv->twinview = TV_BELOW_ABOVE;
else if (s)
{
- xf86Msg(X_ERROR, "%s: invalid Twinview (should be none, vertical or horizontal). Using none.\n",
+ xf86Msg(X_ERROR, "%s: invalid Twinview (should be none, vertical (belowof), "
+ "horizontal (rightof), aboveof, or leftof). Using none.\n",
dev->identifier);
priv->twinview = TV_NONE;
}
@@ -1003,7 +1009,11 @@ static XF86ModuleVersionInfo xf86WcmVersionRec =
{0, 0, 0, 0} /* signature, to be patched into the file by a tool */
};
-XF86ModuleData wacomModuleData =
+#ifdef WCM_XFREE86
+ XF86ModuleData wacomModuleData =
+#else
+ _X_EXPORT XF86ModuleData wacomModuleData =
+#endif
{
&xf86WcmVersionRec,
xf86WcmPlug,
diff --git a/src/xdrv/wcmUSB.c b/src/xdrv/wcmUSB.c
index e342c36..b75ce8a 100755
--- a/src/xdrv/wcmUSB.c
+++ b/src/xdrv/wcmUSB.c
@@ -1,6 +1,6 @@
/*
* Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org>
- * Copyright 2002-2008 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
+ * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -45,6 +45,10 @@
#define BTN_TASK 0x117
#endif
+#ifndef BTN_TOOL_DOUBLETAP
+#define BTN_TOOL_DOUBLETAP 0x14d
+#endif
+
static Bool usbDetect(LocalDevicePtr);
Bool usbWcmInit(LocalDevicePtr pDev, char* id, float *version);
@@ -290,6 +294,22 @@ static void usbParseChannel(LocalDevicePtr local, int channel, int serial);
usbDetectConfig, /* detect hardware buttons etc */
};
+ static WacomModel usbIntuos4 =
+ {
+ "USB Intuos4",
+ usbInitProtocol5,
+ NULL, /* resolution not queried */
+ usbWcmGetRanges,
+ NULL, /* reset not supported */
+ NULL, /* tilt automatically enabled */
+ NULL, /* suppress implemented in software */
+ NULL, /* link speed unsupported */
+ NULL, /* start not supported */
+ usbParse,
+ xf86WcmFilterIntuos, /* input filtering recommended */
+ usbDetectConfig, /* detect hardware buttons etc */
+ };
+
static WacomModel usbVolito =
{
"USB Volito",
@@ -476,6 +496,11 @@ static struct
{ 0xB5, 5080, 5080, &usbIntuos3 }, /* Intuos3 6x11 */
{ 0xB7, 5080, 5080, &usbIntuos3 }, /* Intuos3 4x6 */
+ { 0xB8, 5080, 5080, &usbIntuos4 }, /* Intuos4 4x6 */
+ { 0xB9, 5080, 5080, &usbIntuos4 }, /* Intuos4 6x9 */
+ { 0xBA, 5080, 5080, &usbIntuos4 }, /* Intuos4 8x13 */
+ { 0xBB, 5080, 5080, &usbIntuos4 }, /* Intuos4 12x19*/
+
{ 0x3F, 5080, 5080, &usbCintiqV5 }, /* Cintiq 21UX */
{ 0xC5, 5080, 5080, &usbCintiqV5 }, /* Cintiq 20WSX */
{ 0xC6, 5080, 5080, &usbCintiqV5 }, /* Cintiq 12WX */
@@ -524,23 +549,31 @@ Bool usbWcmInit(LocalDevicePtr local, char* id, float *version)
common->wcmCapacityDefault = -1;
}
- if (common->tablet_id == 0x9A || common->tablet_id == 0x93)
+ if (common->tablet_id == 0x9A || common->tablet_id == 0x93 || common->tablet_id == 0x90)
{
- /* TouchDefault was off for all devices */
- /* except when touch is supported */
- common->wcmTouchDefault = 1;
- common->wcmTPCButtonDefault = 1; /* Tablet PC buttons on by default */
-
- /* check if touch was turned off in xorg.conf */
- common->wcmTouch = xf86SetBoolOption(local->options, "Touch", common->wcmTouchDefault);
- if ( common->wcmTouch )
- xf86Msg(X_CONFIG, "%s: Touch is enabled \n", common->wcmDevice);
+ if (common->tablet_id != 0x90)
+ {
+ /* TouchDefault was off for all devices */
+ /* except when touch is supported */
+ common->wcmTouchDefault = 1;
+
+ /* check if touch was turned off in xorg.conf */
+ common->wcmTouch = xf86SetBoolOption(local->options,
+ "Touch", common->wcmTouchDefault);
+ if ( common->wcmTouch )
+ xf86Msg(X_CONFIG, "%s: Touch is enabled \n", common->wcmDevice);
+ }
/* Tablet PC button applied to the whole tablet. Not just one tool */
- common->wcmTPCButton = xf86SetBoolOption(local->options,
+ common->wcmTPCButtonDefault = 1; /* Tablet PC buttons on by default */
+ if ( priv->flags & STYLUS_ID )
+ {
+ common->wcmTPCButton = xf86SetBoolOption(local->options,
"TPCButton", common->wcmTPCButtonDefault);
- if ( common->wcmTPCButton )
- xf86Msg(X_CONFIG, "%s: Tablet PC buttons are on \n", common->wcmDevice);
+ if ( common->wcmTPCButton )
+ xf86Msg(X_CONFIG, "%s: Tablet PC buttons are on \n",
+ common->wcmDevice);
+ }
}
}
@@ -750,7 +783,7 @@ static int usbDetectConfig(LocalDevicePtr local)
priv->nbuttons = common->npadkeys;
/* This code will be used when we are ready to report valuators in tablet and tool
- * specific form, whcih will need to clean InitValuatorAxisStruct() in xf86Wacom.c
+ * specific form, which will need to clean InitValuatorAxisStruct() in xf86Wacom.c
* and all the calls to X that are related to valuators, such as xf86PostButtonEvent and
* xf86PostButtonEvent, etc. Code under util directory will need to be updated as well.
* This will take some time. We put it in the to-do list for now. Ping
@@ -1064,7 +1097,7 @@ static void usbParseChannel(LocalDevicePtr local, int channel, int serial)
for (nkeys = 0; nkeys < common->npadkeys; nkeys++)
if (event->code == common->padkey_code [nkeys])
{
- MOD_BUTTONS ((MAX_MOUSE_BUTTONS/2+nkeys), event->value);
+ MOD_BUTTONS (nkeys, event->value);
break;
}
}
diff --git a/src/xdrv/wcmXCommand.c b/src/xdrv/wcmXCommand.c
index 3b66bb7..ebfa72d 100644
--- a/src/xdrv/wcmXCommand.c
+++ b/src/xdrv/wcmXCommand.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2008 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
+ * Copyright 2007-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -20,8 +20,9 @@
* REVISION HISTORY
*
* 2007-05-25 0.1 - Initial release - span off from xf86Wacom.c
- * 2008-05-14 0.2 - Rotate through routine xf86WcmRotateScreen
+ * 2008-05-14 0.2 - Rotate through routine xf86WcmRotateTablet
* 2008-06-26 0.3 - Added Capacity
+ * 2009-03-16 0.4 - Added leftOF for TwinView
*/
@@ -31,8 +32,8 @@
#include "wcmFilter.h"
extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
+extern void xf86WcmRotateTablet(LocalDevicePtr local, int value);
extern void xf86WcmInitialScreens(LocalDevicePtr local);
-extern void xf86WcmRotateScreen(LocalDevicePtr local, int value);
/*****************************************************************************
* xf86WcmSetPadCoreMode
@@ -135,7 +136,6 @@ void xf86WcmChangeScreen(LocalDevicePtr local, int value)
if (priv->screen_no != -1)
priv->currentScreen = priv->screen_no;
xf86WcmInitialScreens(local);
- xf86WcmMappingFactor(local);
xf86WcmInitialCoordinates(local, 0);
xf86WcmInitialCoordinates(local, 1);
}
@@ -326,6 +326,11 @@ static int xf86WcmSetParam(LocalDevicePtr local, int param, int value)
xf86ReplaceIntOption(local->options, "Threshold",
common->wcmThreshold);
break;
+ case XWACOM_PARAM_THRESHOLD:
+ common->wcmThreshold = value;
+ xf86ReplaceIntOption(local->options, "Threshold",
+ common->wcmThreshold);
+ break;
case XWACOM_PARAM_XYDEFAULT:
xf86WcmSetParam (local, XWACOM_PARAM_TOPX, 0);
xf86WcmSetParam (local, XWACOM_PARAM_TOPY, 0);
@@ -400,7 +405,7 @@ static int xf86WcmSetParam(LocalDevicePtr local, int param, int value)
case XWACOM_PARAM_TWINVIEW:
if (priv->twinview != value)
{
- if ((value > 2) || (value < 0) || screenInfo.numScreens != 1)
+ if ((value > TV_MAX) || (value < TV_NONE) || screenInfo.numScreens != 1)
return BadValue;
priv->twinview = value;
@@ -471,25 +476,9 @@ static int xf86WcmSetParam(LocalDevicePtr local, int param, int value)
}
}
}
- /* initial screen info */
- priv->screenTopX[0] = 0;
- priv->screenTopY[0] = 0;
- priv->screenBottomX[0] = priv->tvResolution[0];
- priv->screenBottomY[0] = priv->tvResolution[1];
- if (priv->twinview == TV_ABOVE_BELOW)
- {
- priv->screenTopX[1] = 0;
- priv->screenTopY[1] = priv->tvResolution[1];
- priv->screenBottomX[1] = priv->tvResolution[2];
- priv->screenBottomY[1] = priv->tvResolution[1] + priv->tvResolution[3];
- }
- if (priv->twinview == TV_LEFT_RIGHT)
- {
- priv->screenTopX[1] = priv->tvResolution[0];
- priv->screenTopY[1] = 0;
- priv->screenBottomX[1] = priv->tvResolution[0] + priv->tvResolution[2];
- priv->screenBottomY[1] = priv->tvResolution[3];
- }
+
+ /* reset screen info */
+ xf86WcmChangeScreen(local, priv->screen_no);
break;
}
case XWACOM_PARAM_COREEVENT:
@@ -509,7 +498,7 @@ static int xf86WcmSetParam(LocalDevicePtr local, int param, int value)
case XWACOM_PARAM_ROTATE:
if ((value < 0) || (value > 3)) return BadValue;
if (common->wcmRotate != value)
- xf86WcmRotateScreen(local, value);
+ xf86WcmRotateTablet(local, value);
break;
default:
DBG(10, priv->debugLevel, ErrorF("xf86WcmSetParam invalid param %d\n",param));
@@ -814,6 +803,8 @@ static int xf86WcmGetParam(LocalDevicePtr local, int param)
case XWACOM_PARAM_CLICKFORCE:
return !common->wcmMaxZ ? 0 :
(int) (((common->wcmThreshold + 0.5) * 100) / common->wcmMaxZ);
+ case XWACOM_PARAM_THRESHOLD:
+ return !common->wcmMaxZ ? 0 : common->wcmThreshold;
case XWACOM_PARAM_XYDEFAULT:
return -1;
case XWACOM_PARAM_MMT:
@@ -844,7 +835,7 @@ static int xf86WcmGetParam(LocalDevicePtr local, int param)
else
{
int sNum = param - XWACOM_PARAM_TVRESOLUTION0;
- return priv->tvResolution[sNum++] | (priv->tvResolution[sNum] << 16);
+ return priv->tvResolution[sNum] | (priv->tvResolution[sNum + 1] << 16);
}
}
case XWACOM_PARAM_SCREEN_NO:
@@ -991,6 +982,11 @@ static int xf86WcmGetDefaultParam(LocalDevicePtr local, int param)
return 0;
case XWACOM_PARAM_CLICKFORCE:
return 6;
+ case XWACOM_PARAM_THRESHOLD:
+ if (strstr(common->wcmModel->name, "Intuos4"))
+ return (common->wcmMaxZ * 3 / 25);
+ else
+ return (common->wcmMaxZ * 3 / 50);
case XWACOM_PARAM_MMT:
return 1;
case XWACOM_PARAM_TPCBUTTON:
diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c
index 4bf51d9..05582f6 100755
--- a/src/xdrv/xf86Wacom.c
+++ b/src/xdrv/xf86Wacom.c
@@ -1,6 +1,6 @@
/*
* Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org>
- * Copyright 2002-2008 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
+ * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -75,9 +75,10 @@
* 2008-08-27 47-pc0.8.1-4 - Support Bamboo1 Meadium and Monarch
* 2008-11-11 47-pc0.8.2 - new release
* 2008-12-22 47-pc0.8.2-1 - fixed a few issues
+ * 2009-02-20 47-pc0.8.3 - new release
*/
-static const char identification[] = "$Identification: 47-0.8.2-1 $";
+static const char identification[] = "$Identification: 47-0.8.3 $";
/****************************************************************************/
@@ -97,8 +98,8 @@ extern Bool usbWcmInit(LocalDevicePtr pDev);
extern int usbWcmGetRanges(LocalDevicePtr local);
extern int xf86WcmDevChangeControl(LocalDevicePtr local, xDeviceCtl* control);
extern int xf86WcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode);
+extern void xf86WcmRotateTablet(LocalDevicePtr local, int value);
extern void xf86WcmInitialScreens(LocalDevicePtr local);
-extern void xf86WcmRotateScreen(LocalDevicePtr local, int value);
WacomModule gWacomModule =
{
@@ -129,6 +130,38 @@ static void xf86WcmKbdCtrlCallback(DeviceIntPtr di, KeybdCtrl* ctrl)
}
#endif /* WCM_KEY_SENDING_SUPPORT */
+/*****************************************************************************
+ * xf86WcmDesktopSize --
+ * calculate the whole desktop size
+ ****************************************************************************/
+static void xf86WcmDesktopSize(LocalDevicePtr local)
+{
+ WacomDevicePtr priv = (WacomDevicePtr) local->private;
+ int i = 0, minX = 0, minY = 0, maxX = 0, maxY = 0;
+
+ xf86WcmInitialScreens(local);
+ minX = priv->screenTopX[0];
+ minY = priv->screenTopY[0];
+ maxX = priv->screenBottomX[0];
+ maxY = priv->screenBottomY[0];
+ if (priv->numScreen != 1)
+ {
+ for (i = 1; i < priv->numScreen; i++)
+ {
+ if (priv->screenTopX[i] < minX)
+ minX = priv->screenTopX[i];
+ if (priv->screenTopY[i] < minY)
+ minY = priv->screenTopY[i];
+ if (priv->screenBottomX[i] > maxX)
+ maxX = priv->screenBottomX[i];
+ if (priv->screenBottomY[i] > maxY)
+ maxY = priv->screenBottomY[i];
+ }
+ }
+ priv->maxWidth = maxX - minX;
+ priv->maxHeight = maxY - minY;
+}
+
static int xf86WcmInitArea(LocalDevicePtr local)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
@@ -178,10 +211,11 @@ static int xf86WcmInitArea(LocalDevicePtr local)
}
/* need maxWidth and maxHeight for keepshape */
- xf86WcmInitialScreens(local);
- xf86WcmMappingFactor(local);
+ xf86WcmDesktopSize(local);
- /* Maintain aspect ratio */
+ /* Maintain aspect ratio to the whole desktop
+ * May need to consider a specific screen in multimonitor settings
+ */
if (priv->flags & KEEP_SHAPE_FLAG)
{
@@ -204,8 +238,6 @@ static int xf86WcmInitArea(LocalDevicePtr local)
screenRatio / tabletRatio + priv->topX;
area->bottomY = priv->bottomY = priv->wcmMaxY;
}
- /* active tablet size has been changed */
- xf86WcmMappingFactor(local);
}
/* end keep shape */
@@ -256,70 +288,139 @@ static int xf86WcmInitArea(LocalDevicePtr local)
}
/*****************************************************************************
+ * xf86WcmVirtaulTabletPadding(LocalDevicePtr local)
+ ****************************************************************************/
+
+void xf86WcmVirtaulTabletPadding(LocalDevicePtr local)
+{
+ WacomDevicePtr priv = (WacomDevicePtr)local->private;
+ int i;
+
+ priv->leftPadding = 0;
+ priv->topPadding = 0;
+
+ if (!(priv->flags & ABSOLUTE_FLAG)) return;
+
+ if ((priv->screen_no != -1) || (priv->twinview != TV_NONE))
+ {
+ i = priv->currentScreen;
+
+ priv->leftPadding = priv->bottomX - priv->topX -priv->tvoffsetX;
+ priv->topPadding = priv->bottomY - priv->topY - priv->tvoffsetY;
+
+ priv->leftPadding = (int)(((double)priv->screenTopX[i] * priv->leftPadding )
+ / ((double)(priv->screenBottomX[i] - priv->screenTopX[i])) + 0.5);
+
+ priv->topPadding = (int)((double)(priv->screenTopY[i] * priv->topPadding)
+ / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
+ }
+ DBG(10, priv->debugLevel, ErrorF("xf86WcmVirtaulTabletPadding for \"%s\" "
+ "x=%d y=%d \n", local->name, priv->leftPadding, priv->topPadding));
+ return;
+}
+
+/*****************************************************************************
+ * xf86WcmVirtaulTabletSize(LocalDevicePtr local)
+ ****************************************************************************/
+
+void xf86WcmVirtaulTabletSize(LocalDevicePtr local)
+{
+ WacomDevicePtr priv = (WacomDevicePtr)local->private;
+ int i, tabletSize;
+
+ if (!(priv->flags & ABSOLUTE_FLAG))
+ {
+ priv->sizeX = priv->bottomX - priv->topX;
+ priv->sizeY = priv->bottomY - priv->topY;
+ return;
+ }
+
+ priv->sizeX = priv->bottomX - priv->topX - priv->tvoffsetX;
+ priv->sizeY = priv->bottomY - priv->topY - priv->tvoffsetY;
+
+ if ((priv->screen_no != -1) || (priv->twinview != TV_NONE))
+ {
+ i = priv->currentScreen;
+
+ tabletSize = priv->sizeX;
+ priv->sizeX += (int)(((double)priv->screenTopX[i] * tabletSize)
+ / ((double)(priv->screenBottomX[i] - priv->screenTopX[i])) + 0.5);
+ priv->sizeX += (int)((double)((priv->maxWidth - priv->screenBottomX[i])
+ * tabletSize) / ((double)(priv->screenBottomX[i] - priv->screenTopX[i])) + 0.5);
+
+ tabletSize = priv->sizeY;
+ priv->sizeY += (int)((double)(priv->screenTopY[i] * tabletSize)
+ / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
+ priv->sizeY += (int)((double)((priv->maxHeight - priv->screenBottomY[i])
+ * tabletSize) / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
+ }
+ DBG(10, priv->debugLevel, ErrorF("xf86WcmVirtaulTabletSize for \"%s\" "
+ "x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY));
+ return;
+}
+
+/*****************************************************************************
* xf86WcmInitialCoordinates
****************************************************************************/
void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes)
{
WacomDevicePtr priv = (WacomDevicePtr)local->private;
- int tabletSize = 0, topx = 0, topy = 0;
- int resolution;
+ int topx = 0, topy = 0, resolution;
+ int bottomx = priv->wcmMaxX, bottomy = priv->wcmMaxY;
+
+ xf86WcmMappingFactor(local);
/* x ax */
if ( !axes )
{
- if (priv->twinview == TV_LEFT_RIGHT)
- tabletSize = 2*(priv->bottomX - priv->topX - 2*priv->tvoffsetX);
- else
+ if (priv->flags & ABSOLUTE_FLAG)
{
- if (priv->flags & ABSOLUTE_FLAG)
- tabletSize = priv->bottomX;
- else
- tabletSize = priv->bottomX - priv->topX;
+ topx = priv->topX;
+ bottomx = priv->sizeX + priv->topX;
+ if (priv->currentScreen == 1 && priv->twinview != TV_NONE)
+ topx += priv->tvoffsetX;
+ if (priv->currentScreen == 0 && priv->twinview != TV_NONE)
+ bottomx -= priv->tvoffsetX;
}
- if (priv->flags & ABSOLUTE_FLAG)
- topx = priv->topX - priv->tvoffsetX;
resolution = priv->wcmResolX;
#ifdef WCM_XORG_TABLET_SCALING
/* Ugly hack for Xorg 7.3, which doesn't call xf86WcmDevConvert
* for coordinate conversion at the moment */
- if (priv->flags & ABSOLUTE_FLAG) tabletSize -= topx;
topx = 0;
- tabletSize = (int)((double)tabletSize * priv->factorX + 0.5);
+ bottomx = (int)((double)priv->sizeX * priv->factorX + 0.5);
resolution = (int)((double)resolution * priv->factorX + 0.5);
#endif
- InitValuatorAxisStruct(local->dev, 0, topx, tabletSize,
+ InitValuatorAxisStruct(local->dev, 0, topx, bottomx,
resolution, 0, resolution);
}
else /* y ax */
{
- if (priv->twinview == TV_ABOVE_BELOW)
- tabletSize = 2*(priv->bottomY - priv->topY - 2*priv->tvoffsetY);
- else
+ if (priv->flags & ABSOLUTE_FLAG)
{
- if (priv->flags & ABSOLUTE_FLAG)
- tabletSize = priv->bottomY;
- else
- tabletSize = priv->bottomY - priv->topY;
+ topy = priv->topY;
+ bottomy = priv->sizeY + priv->topY;
+ if (priv->currentScreen == 1 && priv->twinview != TV_NONE)
+ topy += priv->tvoffsetY;
+ if (priv->currentScreen == 0 && priv->twinview != TV_NONE)
+ bottomy -= priv->tvoffsetY;
}
- if (priv->flags & ABSOLUTE_FLAG)
- topy = priv->topY - priv->tvoffsetY;
resolution = priv->wcmResolY;
#ifdef WCM_XORG_TABLET_SCALING
/* Ugly hack for Xorg 7.3, which doesn't call xf86WcmDevConvert
* for coordinate conversion at the moment */
- if (priv->flags & ABSOLUTE_FLAG) tabletSize -= topy;
topy = 0;
- tabletSize = (int)((double)tabletSize * priv->factorY + 0.5);
+ bottomy = (int)((double)priv->sizeY * priv->factorY + 0.5);
resolution = (int)((double)resolution * priv->factorY + 0.5);
#endif
- InitValuatorAxisStruct(local->dev, 1, topy, tabletSize,
+ InitValuatorAxisStruct(local->dev, 1, topy, bottomy,
resolution, 0, resolution);
}
+ return;
}
#ifdef WCM_KEY_SENDING_SUPPORT
@@ -669,7 +770,7 @@ static int xf86WcmRegisterX11Devices (LocalDevicePtr local)
}
/* Rotation rotates the Max X and Y */
- xf86WcmRotateScreen(local, common->wcmRotate);
+ xf86WcmRotateTablet(local, common->wcmRotate);
/* pressure */
InitValuatorAxisStruct(local->dev, 2, 0,
@@ -684,7 +785,8 @@ static int xf86WcmRegisterX11Devices (LocalDevicePtr local)
else if (IsPad(priv))
{
/* strip-x and strip-y */
- if (priv->naxes)
+ if (strstr(common->wcmModel->name, "Intuos3") ||
+ strstr(common->wcmModel->name, "CintiqV5"))
{
InitValuatorAxisStruct(local->dev, 3, 0, common->wcmMaxStripX, 1, 1, 1);
InitValuatorAxisStruct(local->dev, 4, 0, common->wcmMaxStripY, 1, 1, 1);
@@ -698,11 +800,15 @@ static int xf86WcmRegisterX11Devices (LocalDevicePtr local)
}
if ((strstr(common->wcmModel->name, "Intuos3") ||
- strstr(common->wcmModel->name, "CintiqV5"))
+ strstr(common->wcmModel->name, "CintiqV5") ||
+ strstr(common->wcmModel->name, "Intuos4"))
&& IsStylus(priv))
/* Art Marker Pen rotation */
InitValuatorAxisStruct(local->dev, 5, -900, 899, 1, 1, 1);
- else if (strstr(common->wcmModel->name, "Bamboo") && IsPad(priv))
+ else if ((strstr(common->wcmModel->name, "Bamboo") ||
+ strstr(common->wcmModel->name, "Intuos4"))
+ && IsPad(priv))
+ /* Touch ring */
InitValuatorAxisStruct(local->dev, 5, 0, 71, 1, 1, 1);
else
{
@@ -1082,7 +1188,6 @@ static Bool xf86WcmDevConvert(LocalDevicePtr local, int first, int num,
int v0, int v1, int v2, int v3, int v4, int v5, int* x, int* y)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
- double temp;
DBG(6, priv->debugLevel, ErrorF("xf86WcmDevConvert v0=%d v1=%d on screen %d \n",
v0, v1, priv->currentScreen));
@@ -1090,62 +1195,37 @@ static Bool xf86WcmDevConvert(LocalDevicePtr local, int first, int num,
if (first != 0 || num == 1)
return FALSE;
- *x = 0;
- *y = 0;
-
if (priv->flags & ABSOLUTE_FLAG)
{
- int leftPadding = 0;
- int topPadding = 0;
-
- v0 = v0 - priv->topX - priv->tvoffsetX;
- v1 = v1 - priv->topY - priv->tvoffsetY;
-
- if (priv->twinview == TV_NONE)
- {
- if (priv->screen_no == -1)
- {
- leftPadding = priv->screenTopX[priv->currentScreen];
- topPadding = priv->screenTopY[priv->currentScreen];
- }
- *x = - leftPadding;
- *y = - topPadding;
- }
- else
+ v0 -= priv->topX;
+ v1 -= priv->topY;
+ if (priv->currentScreen == 1 && priv->twinview != TV_NONE)
{
- *x = priv->screenTopX[priv->currentScreen];
- *y = priv->screenTopY[priv->currentScreen];
+ v0 -= priv->tvoffsetX;
+ v1 -= priv->tvoffsetY;
}
+ }
+
+ *x = (double)v0 * priv->factorX + 0.5;
+ *y = (double)v1 * priv->factorY + 0.5;
+
+ if ((priv->flags & ABSOLUTE_FLAG) && (priv->twinview == TV_NONE))
+ {
+ *x -= priv->screenTopX[priv->currentScreen];
+ *y -= priv->screenTopY[priv->currentScreen];
}
- temp = ((double)v0 * priv->factorX + 0.5);
- *x += temp;
- temp = ((double)v1 * priv->factorY + 0.5);
- *y += temp;
- DBG(6, priv->debugLevel, ErrorF("xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y));
- if ((priv->screen_no != -1 || !priv->wcmMMonitor) && (priv->flags & ABSOLUTE_FLAG))
+ if (priv->screen_no != -1)
{
- DBG(6, priv->debugLevel, ErrorF("xf86WcmDevConvert restricted (%d,%d)", *x, *y));
- if (priv->twinview == TV_NONE)
- {
- if (*x < 1) *x = 0;
- if (*y < 1) *y = 0;
- if (*x >= priv->screenBottomX[priv->currentScreen] - priv->screenTopX[priv->currentScreen])
- *x = priv->screenBottomX[priv->currentScreen] - priv->screenTopX[priv->currentScreen]-1;
- if (*y >= priv->screenBottomY[priv->currentScreen] - priv->screenTopY[priv->currentScreen])
- *y = priv->screenBottomY[priv->currentScreen] - priv->screenTopY[priv->currentScreen]-1;
- }
- else
- {
- if (*x < priv->screenTopX[priv->currentScreen]+1) *x = priv->screenTopX[priv->currentScreen];
- if (*y < priv->screenTopY[priv->currentScreen]+1) *y = priv->screenTopY[priv->currentScreen];
- if (*x >= priv->screenBottomX[priv->currentScreen])
- *x = priv->screenBottomX[priv->currentScreen]-1;
- if (*y >= priv->screenBottomY[priv->currentScreen])
- *y = priv->screenBottomY[priv->currentScreen]-1;
- }
- DBG(6, priv->debugLevel, ErrorF(" to x=%d y=%d\n", *x, *y));
+ if (*x > priv->screenBottomX[priv->currentScreen] - priv->screenTopX[priv->currentScreen])
+ *x = priv->screenBottomX[priv->currentScreen];
+ if (*x < 0) *x = 0;
+ if (*y > priv->screenBottomY[priv->currentScreen] - priv->screenTopY[priv->currentScreen])
+ *y = priv->screenBottomY[priv->currentScreen];
+ if (*y < 0) *y = 0;
+
}
+ DBG(6, priv->debugLevel, ErrorF("xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y));
return TRUE;
}
@@ -1182,6 +1262,7 @@ static Bool xf86WcmDevReverseConvert(LocalDevicePtr local, int x, int y,
else
priv->devReverseCount = 0;
}
+
DBG(6, priv->debugLevel, ErrorF("Wacom converted x=%d y=%d"
" to v0=%d v1=%d v2=%d v3=%d v4=%d v5=%d\n", x, y,
valuators[0], valuators[1], valuators[2],
diff --git a/src/xdrv/xf86WacomDefs.h b/src/xdrv/xf86WacomDefs.h
index 235704f..d9884f2 100755
--- a/src/xdrv/xf86WacomDefs.h
+++ b/src/xdrv/xf86WacomDefs.h
@@ -1,6 +1,6 @@
/*
* Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org>
- * Copyright 2002-2008 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
+ * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -161,6 +161,8 @@ struct _WacomDeviceRec
int screenBottomY[32]; /* bottom cordinate of the associated screen */
int maxWidth; /* max active screen width */
int maxHeight; /* max active screen height */
+ int leftPadding; /* left padding for virtual tablet */
+ int topPadding; /* top padding for virtual tablet */
int button[MAX_BUTTONS];/* buttons assignments */
unsigned keys[MAX_BUTTONS][256]; /* keystrokes assigned to buttons */
int relup;