Hello community, here is the log from the commit of package x11-input-wacom for openSUSE:Factory checked in at Thu Jan 7 13:04:52 CET 2010. -------- --- x11-input-wacom/x11-input-wacom.changes 2009-12-26 11:10:15.000000000 +0100 +++ /mounts/work_src_done/STABLE/x11-input-wacom/x11-input-wacom.changes 2010-01-04 01:39:35.000000000 +0100 @@ -1,0 +2,8 @@ +Mon Jan 4 01:33:53 CET 2010 - sndirsch@suse.de + +- update to development release 0.8.5-9 + * Incorporated Ayuthia's Bamboo P&T patch -34 + - submitted by Favux <favux.is@gmail.com> + * Fixed a protocol4 mouse button click issue + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- linuxwacom-0.8.5-8.tar.bz2 New: ---- linuxwacom-0.8.5-9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ x11-input-wacom.spec ++++++ --- /var/tmp/diff_new_pack.OSu4Vd/_old 2010-01-07 13:04:23.000000000 +0100 +++ /var/tmp/diff_new_pack.OSu4Vd/_new 2010-01-07 13:04:23.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package x11-input-wacom (Version 0.8.5) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ # norootforbuild -%define revision 8 +%define revision 9 %define udev_rules_custom 0 Name: x11-input-wacom @@ -32,7 +32,7 @@ Url: http://linuxwacom.sourceforge.net/ Group: System/X11/Utilities Version: 0.8.5 -Release: 2 +Release: 3 Summary: X11 input module for wacom tablet Provides: xorg-x11-server:/usr/X11R6/%{_lib}/modules/input/wacom_drv.o Supplements: xorg-x11-server ++++++ linuxwacom-0.8.5-8.tar.bz2 -> linuxwacom-0.8.5-9.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/ChangeLog new/linuxwacom-0.8.5-9/ChangeLog --- old/linuxwacom-0.8.5-8/ChangeLog 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/ChangeLog 2009-12-31 01:05:15.000000000 +0100 @@ -1,3 +1,10 @@ +2009-12-30 Ping Cheng <pingc@wacom.com> + * Incorporated Ayuthia's Bamboo P&T patch -34 + - submitted by Favux <favux.is@gmail.com> + * Fixed some kernel misplacement + * Fixed a protocol4 mouse button click issue + * Label 0.8.5-9 + 2009-12-22 Ping Cheng <pingc@wacom.com> * Added max and resolution for local tool * Use linuxwacom.fdi gathered from Ubuntu forum Files old/linuxwacom-0.8.5-8/prebuilt/32/.libs/libwacomcfg.a and new/linuxwacom-0.8.5-9/prebuilt/32/.libs/libwacomcfg.a differ Files old/linuxwacom-0.8.5-8/prebuilt/32/.libs/libwacomxi.a and new/linuxwacom-0.8.5-9/prebuilt/32/.libs/libwacomxi.a differ Files old/linuxwacom-0.8.5-8/prebuilt/32/wacom_drv.o and new/linuxwacom-0.8.5-9/prebuilt/32/wacom_drv.o differ Files old/linuxwacom-0.8.5-8/prebuilt/32/wacom_drv.so and new/linuxwacom-0.8.5-9/prebuilt/32/wacom_drv.so differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/prebuilt/32/wacomcpl-exec new/linuxwacom-0.8.5-9/prebuilt/32/wacomcpl-exec --- old/linuxwacom-0.8.5-8/prebuilt/32/wacomcpl-exec 2009-12-23 00:27:06.000000000 +0100 +++ new/linuxwacom-0.8.5-9/prebuilt/32/wacomcpl-exec 2009-12-31 01:06:11.000000000 +0100 @@ -1920,6 +1920,13 @@ set numPadButtons($i) 4 set numPadRings($i) 1 } + + # Bamboo Pen and Touch + for { set i 208 } { $i <= 212 } { incr i 1 } { + set hasPad($i) 1 + set numPadButtons($i) 4 + } + # I3 set numPadButtons(176) 4 set numPadStrips(176) 1 Files old/linuxwacom-0.8.5-8/prebuilt/64/.libs/libwacomcfg.a and new/linuxwacom-0.8.5-9/prebuilt/64/.libs/libwacomcfg.a differ Files old/linuxwacom-0.8.5-8/prebuilt/64/.libs/libwacomxi.a and new/linuxwacom-0.8.5-9/prebuilt/64/.libs/libwacomxi.a differ Files old/linuxwacom-0.8.5-8/prebuilt/64/wacom_drv.o and new/linuxwacom-0.8.5-9/prebuilt/64/wacom_drv.o differ Files old/linuxwacom-0.8.5-8/prebuilt/64/wacom_drv.so and new/linuxwacom-0.8.5-9/prebuilt/64/wacom_drv.so differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/prebuilt/64/wacomcpl-exec new/linuxwacom-0.8.5-9/prebuilt/64/wacomcpl-exec --- old/linuxwacom-0.8.5-8/prebuilt/64/wacomcpl-exec 2009-12-23 02:01:32.000000000 +0100 +++ new/linuxwacom-0.8.5-9/prebuilt/64/wacomcpl-exec 2009-12-31 02:38:56.000000000 +0100 @@ -1920,6 +1920,13 @@ set numPadButtons($i) 4 set numPadRings($i) 1 } + + # Bamboo Pen and Touch + for { set i 208 } { $i <= 212 } { incr i 1 } { + set hasPad($i) 1 + set numPadButtons($i) 4 + } + # I3 set numPadButtons(176) 4 set numPadStrips(176) 1 Files old/linuxwacom-0.8.5-8/prebuilt/wacom.4x.gz and new/linuxwacom-0.8.5-9/prebuilt/wacom.4x.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.24/wacom.h new/linuxwacom-0.8.5-9/src/2.6.24/wacom.h --- old/linuxwacom-0.8.5-8/src/2.6.24/wacom.h 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.24/wacom.h 2009-12-31 01:05:15.000000000 +0100 @@ -84,7 +84,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.46-pc0.8" +#define DRIVER_VERSION "v1.46-pc0.9" #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" #define DRIVER_DESC "USB Wacom tablet driver" #define DRIVER_LICENSE "GPL" @@ -133,6 +133,7 @@ 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); extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac); +extern void input_dev_bpt(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern void input_dev_tpc(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern void input_dev_tpc2fg(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern __u16 wacom_le16_to_cpu(unsigned char *data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.24/wacom_sys.c new/linuxwacom-0.8.5-9/src/2.6.24/wacom_sys.c --- old/linuxwacom-0.8.5-8/src/2.6.24/wacom_sys.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.24/wacom_sys.c 2009-12-31 01:05:15.000000000 +0100 @@ -76,9 +76,15 @@ static void wacom_sys_irq(struct urb *urb) { struct wacom *wacom = urb->context; - struct wacom_combo wcombo; + struct wacom_combo *wcombo; int retval; + wcombo = kzalloc(sizeof(struct wacom_combo), GFP_ATOMIC); + if (!wcombo) { + dbg("could not allocate memory in wacom_sys_irq"); + return; + } + switch (urb->status) { case 0: /* success */ @@ -88,23 +94,31 @@ case -ESHUTDOWN: /* this urb is terminated, clean up */ dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); + kfree(wcombo); return; + + case -EOVERFLOW: + dbg("%s - urb overflow detected with size: %d", __func__, urb->actual_length); + goto exit; + default: dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); goto exit; } - wcombo.wacom = wacom; - wcombo.urb = urb; + wcombo->wacom = wacom; + wcombo->urb = urb; - if (wacom_wac_irq(wacom->wacom_wac, (void *)&wcombo)) - input_sync(get_input_dev(&wcombo)); + if (wacom_wac_irq(wacom->wacom_wac, (void *)wcombo)) + input_sync(get_input_dev(wcombo)); exit: retval = usb_submit_urb (urb, GFP_ATOMIC); if (retval) err ("%s - usb_submit_urb failed with result %d", __FUNCTION__, retval); + + kfree(wcombo); } void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) @@ -169,6 +183,20 @@ usb_kill_urb(wacom->irq); } +void input_dev_bpt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) +{ + if (wacom_wac->features->device_type == BTN_TOOL_DOUBLETAP) { + input_set_abs_params(input_dev, ABS_RX, 0, wacom_wac->features->x_phy, 0, 0); + input_set_abs_params(input_dev, ABS_RY, 0, wacom_wac->features->y_phy, 0, 0); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_TRIPLETAP); + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_2) | + BIT_MASK(BTN_3) | + BIT_MASK(BTN_BACK) | + BIT_MASK(BTN_FORWARD); + } +} + void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) | @@ -335,17 +363,28 @@ features->pktlen = WACOM_PKGLEN_TPC2FG; features->device_type = BTN_TOOL_TRIPLETAP; } - features->x_max = - wacom_le16_to_cpu(&report[i + 3]); - features->x_phy = - wacom_le16_to_cpu(&report[i + 6]); - features->unit = report[i + 9]; - features->unitExpo = report[i + 11]; - i += 12; + if (features->type == BAMBOO_PT) { + /* need to reset back */ + features->pktlen = WACOM_PKGLEN_BBTOUCH; + features->x_max = + wacom_le16_to_cpu(&report[i + 5]); + features->x_phy = + wacom_le16_to_cpu(&report[i + 8]); + i += 15; + } else { + features->x_max = + wacom_le16_to_cpu(&report[i + 3]); + features->x_phy = + wacom_le16_to_cpu(&report[i + 6]); + features->unit = report[i + 9]; + features->unitExpo = report[i + 11]; + i += 12; + } } else if (pen) { /* penabled only accepts exact bytes of data */ - if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_PENABLED; + if ((features->type == TABLETPC2FG)|| + (features->type == BAMBOO_PT)) + features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->device_type = BTN_TOOL_PEN; features->x_max = (wacom_le16_to_cpu(&report[i+3])); @@ -373,6 +412,12 @@ features->y_phy = wacom_le16_to_cpu(&report[i + 6]); i += 7; + } else if (features->type == BAMBOO_PT) { + features->y_max = + wacom_le16_to_cpu(&report[i + 3]); + features->y_phy = + wacom_le16_to_cpu(&report[i + 6]); + i += 12; } else { features->y_max = features->x_max; @@ -383,7 +428,7 @@ } else if (pen) { /* penabled only accepts exact bytes of data */ if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_PENABLED; + features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->device_type = BTN_TOOL_PEN; features->y_max = (wacom_le16_to_cpu(&report[i+3])); i += 4; @@ -425,12 +470,14 @@ { char rep_data[4], limit = 0, report_id = 2; int error = -ENOMEM; + /* - * Ask to report tablet data if it is 2FGT or not a Tablet PC. + * Ask to report tablet data if it is a 2FGT Tablet PC + * OR not a Tablet PC. * Repeat 3 times since on some systems the first 2 may fail. */ - - if (features->device_type == BTN_TOOL_TRIPLETAP) { + if ((features->device_type == BTN_TOOL_TRIPLETAP) && + (features->type == TABLETPC2FG)) { do { rep_data[0] = 3; rep_data[1] = 4; @@ -465,10 +512,11 @@ struct hid_descriptor *hid_desc; /* default device to penabled */ - features->device_type = BTN_TOOL_PEN; + features->device_type = BTN_TOOL_PEN; - /* only Tablet PCs need to retrieve the info */ - if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) + /* only Tablet PCs and devices with touch need to retrieve the info */ + if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) + && (features->type != BAMBOO_PT)) goto out; if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.26/wacom.h new/linuxwacom-0.8.5-9/src/2.6.26/wacom.h --- old/linuxwacom-0.8.5-8/src/2.6.26/wacom.h 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.26/wacom.h 2009-12-31 01:05:15.000000000 +0100 @@ -87,7 +87,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.49-pc-4" +#define DRIVER_VERSION "v1.49-pc-5" #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" #define DRIVER_DESC "USB Wacom tablet driver" #define DRIVER_LICENSE "GPL" @@ -136,6 +136,7 @@ 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_bpt(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); extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern void input_dev_tpc(struct input_dev *input_dev, struct wacom_wac *wacom_wac); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.26/wacom_sys.c new/linuxwacom-0.8.5-9/src/2.6.26/wacom_sys.c --- old/linuxwacom-0.8.5-8/src/2.6.26/wacom_sys.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.26/wacom_sys.c 2009-12-31 01:05:15.000000000 +0100 @@ -73,9 +73,15 @@ static void wacom_sys_irq(struct urb *urb) { struct wacom *wacom = urb->context; - struct wacom_combo wcombo; + struct wacom_combo *wcombo; int retval; + wcombo = kzalloc(sizeof(struct wacom_combo), GFP_ATOMIC); + if (!wcombo) { + dbg("could not allocate memory in wacom_sys_irq"); + return; + } + switch (urb->status) { case 0: /* success */ @@ -85,17 +91,23 @@ case -ESHUTDOWN: /* this urb is terminated, clean up */ dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); + kfree(wcombo); return; + + case -EOVERFLOW: + dbg("%s - urb overflow detected with size: %d", __func__, urb->actual_length); + goto exit; + default: dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); goto exit; } - wcombo.wacom = wacom; - wcombo.urb = urb; + wcombo->wacom = wacom; + wcombo->urb = urb; - if (wacom_wac_irq(wacom->wacom_wac, (void *)&wcombo)) - input_sync(get_input_dev(&wcombo)); + if (wacom_wac_irq(wacom->wacom_wac, (void *)wcombo)) + input_sync(get_input_dev(wcombo)); exit: usb_mark_last_busy(wacom->usbdev); @@ -103,6 +115,8 @@ if (retval) err ("%s - usb_submit_urb failed with result %d", __FUNCTION__, retval); + + kfree(wcombo); } void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) @@ -186,6 +200,20 @@ mutex_unlock(&wacom->lock); } +void input_dev_bpt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) +{ + if (wacom_wac->features->device_type == BTN_TOOL_DOUBLETAP) { + input_set_abs_params(input_dev, ABS_RX, 0, wacom_wac->features->x_phy, 0, 0); + input_set_abs_params(input_dev, ABS_RY, 0, wacom_wac->features->y_phy, 0, 0); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_TRIPLETAP); + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_2) | + BIT_MASK(BTN_3) | + BIT_MASK(BTN_BACK) | + BIT_MASK(BTN_FORWARD); + } +} + void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) | @@ -352,17 +380,28 @@ features->pktlen = WACOM_PKGLEN_TPC2FG; features->device_type = BTN_TOOL_TRIPLETAP; } - features->x_max = - wacom_le16_to_cpu(&report[i + 3]); - features->x_phy = - wacom_le16_to_cpu(&report[i + 6]); - features->unit = report[i + 9]; - features->unitExpo = report[i + 11]; - i += 12; + if (features->type == BAMBOO_PT) { + /* need to reset back */ + features->pktlen = WACOM_PKGLEN_BBTOUCH; + features->x_max = + wacom_le16_to_cpu(&report[i + 5]); + features->x_phy = + wacom_le16_to_cpu(&report[i + 8]); + i += 15; + } else { + features->x_max = + wacom_le16_to_cpu(&report[i + 3]); + features->x_phy = + wacom_le16_to_cpu(&report[i + 6]); + features->unit = report[i + 9]; + features->unitExpo = report[i + 11]; + i += 12; + } } else if (pen) { /* penabled only accepts exact bytes of data */ - if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_PENABLED; + if ((features->type == TABLETPC2FG) || + (features->type == BAMBOO_PT)) + features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->device_type = BTN_TOOL_PEN; features->x_max = (wacom_le16_to_cpu(&report[i+3])); i += 4; @@ -440,12 +479,14 @@ { char rep_data[4], limit = 0, report_id = 2; int error = -ENOMEM; + /* - * Ask to report tablet data if it is 2FGT or not a Tablet PC. + * Ask to report tablet data if it is 2FGT Tablet PC + * OR not a Tablet PC. * Repeat 3 times since on some systems the first 2 may fail. */ - - if (features->device_type == BTN_TOOL_TRIPLETAP) { + if ((features->device_type == BTN_TOOL_TRIPLETAP) && + (features->type == TABLETPC2FG)) { do { rep_data[0] = 3; rep_data[1] = 4; @@ -482,8 +523,9 @@ /* default device to penabled */ features->device_type = BTN_TOOL_PEN; - /* only Tablet PCs need to retrieve the info */ - if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) + /* only Tablet PCs and devices with touch need to retrieve the info */ + if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) + && (features->type != BAMBOO_PT)) goto out; if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.27/wacom.h new/linuxwacom-0.8.5-9/src/2.6.27/wacom.h --- old/linuxwacom-0.8.5-8/src/2.6.27/wacom.h 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.27/wacom.h 2009-12-31 01:05:15.000000000 +0100 @@ -92,7 +92,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.52-pc-0.1" +#define DRIVER_VERSION "v1.52-pc-0.2" #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" #define DRIVER_DESC "USB Wacom tablet driver" #define DRIVER_LICENSE "GPL" @@ -141,6 +141,7 @@ 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_bpt(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern void input_dev_tpc(struct input_dev *input_dev, struct wacom_wac *wacom_wac); extern void input_dev_tpc2fg(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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.27/wacom_sys.c new/linuxwacom-0.8.5-9/src/2.6.27/wacom_sys.c --- old/linuxwacom-0.8.5-8/src/2.6.27/wacom_sys.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.27/wacom_sys.c 2009-12-31 01:05:15.000000000 +0100 @@ -73,9 +73,15 @@ static void wacom_sys_irq(struct urb *urb) { struct wacom *wacom = urb->context; - struct wacom_combo wcombo; + struct wacom_combo *wcombo; int retval; + wcombo = kzalloc(sizeof(struct wacom_combo), GFP_ATOMIC); + if (!wcombo) { + dbg("could not allocate memory in wacom_sys_irq"); + return; + } + switch (urb->status) { case 0: /* success */ @@ -85,17 +91,23 @@ case -ESHUTDOWN: /* this urb is terminated, clean up */ dbg("%s - urb shutting down with status: %d", __func__, urb->status); + kfree(wcombo); return; + + case -EOVERFLOW: + dbg("%s - urb overflow detected with size: %d", __func__, urb->actual_length); + goto exit; + default: dbg("%s - nonzero urb status received: %d", __func__, urb->status); goto exit; } - wcombo.wacom = wacom; - wcombo.urb = urb; + wcombo->wacom = wacom; + wcombo->urb = urb; - if (wacom_wac_irq(wacom->wacom_wac, (void *)&wcombo)) - input_sync(get_input_dev(&wcombo)); + if (wacom_wac_irq(wacom->wacom_wac, (void *)wcombo)) + input_sync(get_input_dev(wcombo)); exit: usb_mark_last_busy(wacom->usbdev); @@ -103,6 +115,8 @@ if (retval) err ("%s - usb_submit_urb failed with result %d", __func__, retval); + + kfree(wcombo); } void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) @@ -181,6 +195,20 @@ mutex_unlock(&wacom->lock); } +void input_dev_bpt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) +{ + if (wacom_wac->features->device_type == BTN_TOOL_DOUBLETAP) { + input_set_abs_params(input_dev, ABS_RX, 0, wacom_wac->features->x_phy, 0, 0); + input_set_abs_params(input_dev, ABS_RY, 0, wacom_wac->features->y_phy, 0, 0); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_TRIPLETAP); + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_2) | + BIT_MASK(BTN_3) | + BIT_MASK(BTN_BACK) | + BIT_MASK(BTN_FORWARD); + } +} + void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) | @@ -352,17 +380,28 @@ features->pktlen = WACOM_PKGLEN_TPC2FG; features->device_type = BTN_TOOL_TRIPLETAP; } - features->x_max = - wacom_le16_to_cpu(&report[i + 3]); - features->x_phy = - wacom_le16_to_cpu(&report[i + 6]); - features->unit = report[i + 9]; - features->unitExpo = report[i + 11]; - i += 12; + if (features->type == BAMBOO_PT) { + /* need to reset back */ + features->pktlen = WACOM_PKGLEN_BBTOUCH; + features->x_max = + wacom_le16_to_cpu(&report[i + 5]); + features->x_phy = + wacom_le16_to_cpu(&report[i + 8]); + i += 15; + } else { + features->x_max = + wacom_le16_to_cpu(&report[i + 3]); + features->x_phy = + wacom_le16_to_cpu(&report[i + 6]); + features->unit = report[i + 9]; + features->unitExpo = report[i + 11]; + i += 12; + } } else if (pen) { /* penabled only accepts exact bytes of data */ - if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_PENABLED; + if ((features->type == TABLETPC2FG) || + (features->type == BAMBOO_PT)) + features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->device_type = BTN_TOOL_PEN; features->x_max = wacom_le16_to_cpu(&report[i + 3]); @@ -391,6 +430,12 @@ features->y_phy = wacom_le16_to_cpu(&report[i + 6]); i += 7; + } else if (features->type == BAMBOO_PT) { + features->y_max = + wacom_le16_to_cpu(&report[i + 3]); + features->y_phy = + wacom_le16_to_cpu(&report[i + 6]); + i += 12; } else { features->y_max = features->x_max; @@ -401,7 +446,7 @@ } else if (pen) { /* penabled only accepts exact bytes of data */ if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_PENABLED; + features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->device_type = BTN_TOOL_PEN; features->y_max = wacom_le16_to_cpu(&report[i + 3]); @@ -452,8 +497,10 @@ if (!rep_data) return error; - /* ask to report tablet data if it is 2FGT or not a Tablet PC */ - if (features->device_type == BTN_TOOL_TRIPLETAP) { + /* ask to report tablet data if it is 2FGT and not a 2FGT Tablet PC + * OR not a regular Tablet PC */ + if ((features->device_type == BTN_TOOL_TRIPLETAP) && + (features->type == TABLETPC2FG)) { do { rep_data[0] = 3; rep_data[1] = 4; @@ -493,8 +540,9 @@ /* default device to penabled */ features->device_type = BTN_TOOL_PEN; - /* only Tablet PCs need to retrieve the info */ - if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) + /* only Tablet PCs and devices with touch need to retrieve the info */ + if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) + && (features->type != BAMBOO_PT)) goto out; if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.27/wacom_wac.c new/linuxwacom-0.8.5-9/src/2.6.27/wacom_wac.c --- old/linuxwacom-0.8.5-8/src/2.6.27/wacom_wac.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.27/wacom_wac.c 2009-12-31 01:05:15.000000000 +0100 @@ -28,7 +28,7 @@ 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_key(wcombo, BTN_TOUCH, ((signed char)data[6] -127)); + wacom_report_key(wcombo, BTN_TOUCH, ((signed char)data[6] > -127)); wacom_report_key(wcombo, BTN_STYLUS, (data[5] & 0x40)); } else { wacom_report_key(wcombo, wacom->tool[0], 0); @@ -43,7 +43,7 @@ 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_key(wcombo, BTN_TOUCH, ((signed char)data[6] -80) && !(data[5] & 0x20)); + wacom_report_key(wcombo, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); wacom_report_key(wcombo, BTN_STYLUS, (data[5] & 0x40)); break; default: @@ -67,9 +67,9 @@ if (prox) { wacom->id[0] = ERASER_DEVICE_ID; - pressure = (signed char)((data[7] << 1) | ((data[4] >2) & 1)); + pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); if (wacom->features->pressure_max > 255) - pressure = (pressure << 1) | ((data[4] >6) & 1); + pressure = (pressure << 1) | ((data[4] >> 6) & 1); pressure += (wacom->features->pressure_max + 1) / 2; /* @@ -150,80 +150,233 @@ return 1; } -static int wacom_bamboo_pt_irq(struct wacom_wac *wacom, void *wcombo) +static void wacom_bpt_finger_in(struct wacom_wac *wacom, void *wcombo, char *data, int idx) { - unsigned char *data = wacom->data; - int x, y, pressure = 0; + int x = 0, y = 0, pressure, i = idx; - if (data[0] != 2) { - dbg("wacom_bamboo_pt_irq: received unknown report #%d", data[0]); - return 0; + if (idx == 2) { + i = 0; } - if (data[1] & 0x80) { - /* in prox and not a pad data */ + pressure = (data[2 + (i * 9)] & 0xff); + x = wacom_be16_to_cpu ((unsigned char *)&data[3 + (i * 9)]) & 0x7ff; + y = wacom_be16_to_cpu ((unsigned char *)&data[5 + (i * 9)]) & 0x7ff; - if (data[1] & 0xf0) { - if (data[1] & 0x8) { /* rubber */ - wacom->tool[0] = BTN_TOOL_RUBBER; - wacom->id[0] = ERASER_DEVICE_ID; - } - else { /* pen */ - wacom->tool[0] = BTN_TOOL_PEN; - wacom->id[0] = STYLUS_DEVICE_ID; - } - } - x = wacom_le16_to_cpu(&data[2]); - y = wacom_le16_to_cpu(&data[4]); - wacom_report_abs(wcombo, ABS_X, x); - wacom_report_abs(wcombo, ABS_Y, y); - wacom_report_abs(wcombo, ABS_PRESSURE, pressure); - wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01); - wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); - wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04); - wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ - wacom_report_key(wcombo, wacom->tool[0], 1); - } else if (wacom->id[0]) { + wacom_report_abs(wcombo, ABS_X, x); + wacom_report_abs(wcombo, ABS_Y, y); + wacom_report_abs(wcombo, ABS_PRESSURE, pressure); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); + wacom_report_key(wcombo, wacom->tool[i], 1); + + if (idx) + wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); + else + wacom_report_key(wcombo, BTN_TOUCH, 1); +} + +static void wacom_bpt_touch_out(struct wacom_wac *wacom, void *wcombo, int idx) +{ + if (idx != 2) { wacom_report_abs(wcombo, ABS_X, 0); wacom_report_abs(wcombo, ABS_Y, 0); wacom_report_abs(wcombo, ABS_PRESSURE, 0); - wacom_report_key(wcombo, BTN_TOUCH, 0); - wacom_report_key(wcombo, BTN_STYLUS, 0); - wacom_report_key(wcombo, BTN_STYLUS2, 0); - wacom->id[0] = 0; - wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ - wacom_report_key(wcombo, wacom->tool[0], 0); + wacom_report_abs(wcombo, ABS_MISC, 0); + wacom_report_key(wcombo, wacom->tool[idx], 0); + if (idx) + wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); + else + wacom_report_key(wcombo, BTN_TOUCH, 0); } +} - /* send pad data */ - switch (wacom->features->type) { - case BAMBOO_PT: - if (data[8] & 0xff) { +static void wacom_bpt_touch_in(struct wacom_wac *wacom, void *wcombo) +{ + char *data = wacom->data; + static int firstFinger = 0; + static int secondFinger = 0; + static int thirdFinger = 0; + + wacom->tool[0] = BTN_TOOL_DOUBLETAP; + wacom->id[0] = TOUCH_DEVICE_ID; + wacom->tool[1] = BTN_TOOL_TRIPLETAP; + wacom->id[1] = (((data[3] & 0x80) >> 7) & 0x1) | + (((data[12] & 0x80) >> 6) & 0x2) | + ((((data[17] & 0x30) >> 4) == 3) ? 0x4 : 0x0); + + /* First finger down */ + if (data[3] & 0x80) { + wacom_bpt_finger_in(wacom, wcombo, data, 0); + firstFinger = 1; + } else if (firstFinger) { + wacom_bpt_touch_out(wacom, wcombo, 0); + firstFinger = 0; + } + + /* Second finger down */ + if (data[12] & 0x80) { + /* sync first finger data */ + if (firstFinger) + wacom_input_sync(wcombo); + + wacom_bpt_finger_in(wacom, wcombo, data, 1); + secondFinger = 1; + } else if (secondFinger) { + /* sync first finger data */ + if (firstFinger) + wacom_input_sync(wcombo); + + wacom_bpt_touch_out(wacom, wcombo, 1); + secondFinger = 0; + } + + if (((data[17] & 0x30) >> 4) == 3) { + /* sync ? */ + if (firstFinger && secondFinger) wacom_input_sync(wcombo); + wacom_bpt_finger_in(wacom, wcombo, data, 2); + thirdFinger = 1; + } else { + wacom_bpt_touch_out(wacom, wcombo, 2); + thirdFinger = 0; + } + + if (!(data[17] & 0x10)) { + firstFinger = 0; + secondFinger = 0; + thirdFinger = 0; + } +} + +static int wacom_bpt_irq(struct wacom_wac *wacom, void *wcombo) +{ + char *data = wacom->data; + int prox = 0, retval = 0; + static int stylusInProx = 0, touchInProx = 1, touchOut = 0; + struct urb *urb = ((struct wacom_combo *)wcombo)->urb; + + if (data[0] != WACOM_REPORT_PENABLED) { + dbg("wacom_bpt_irq: received unknown report #%d", data[0]); + goto exit; + } + + /* Touch packet */ + if (urb->actual_length == WACOM_PKGLEN_BBTOUCH) { + /* Check for pad data first or else it gets sent in with touch data */ + if (data[1]) { wacom->id[1] = PAD_DEVICE_ID; - wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); - wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); - wacom_report_key(wcombo, BTN_4, (data[7] & 0x10)); - wacom_report_key(wcombo, BTN_5, (data[7] & 0x40)); - wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f)); + wacom_report_key(wcombo, BTN_1, data[1] & 0x1); + wacom_report_key(wcombo, BTN_2, (data[1] & 0x2) >> 1); + wacom_report_key(wcombo, BTN_3, (data[1] & 0x4) >> 2); + wacom_report_key(wcombo, BTN_4, (data[1] & 0x8) >> 3); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); - } else if (wacom->id[1]) { - wacom_input_sync(wcombo); + } else if (wacom->id[1] == PAD_DEVICE_ID) { wacom->id[1] = 0; - wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); - wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); - wacom_report_key(wcombo, BTN_4, (data[7] & 0x10)); - wacom_report_key(wcombo, BTN_5, (data[7] & 0x40)); - wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f)); + wacom_report_key(wcombo, BTN_1, 0); + wacom_report_key(wcombo, BTN_2, 0); + wacom_report_key(wcombo, BTN_3, 0); + wacom_report_key(wcombo, BTN_4, 0); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0); wacom_report_abs(wcombo, ABS_MISC, 0); wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); } - break; + + prox = (data[17] & 0x30 >> 4); + if (!stylusInProx) { + if (prox) { + if (touchInProx) { + wacom_bpt_touch_in(wacom, wcombo); + touchOut = 1; + retval = 1; + goto exit; + } + } else { + if (wacom->id[1] & 0x1) { + wacom_bpt_touch_out(wacom, wcombo, 0); + /* sync first finger event */ + if ((wacom->id[1] & 0x2) || (wacom->id[1] & 0x4)) { + wacom_input_sync(wcombo); + } + } + if (wacom->id[1] & 0x2) { + wacom_bpt_touch_out(wacom, wcombo, 1); + } + if (wacom->id[1] & 0x4) { + wacom_bpt_touch_out(wacom, wcombo, 2); + } + touchOut = 0; + touchInProx = 1; + retval = 1; + goto exit; + } + } else if (touchOut || !prox) { /* force touch out-prox */ + wacom_bpt_touch_out(wacom, wcombo, 0); + + touchOut = 0; + touchInProx = 1; + retval = 1; + goto exit; + } + } else if (urb->actual_length == WACOM_PKGLEN_GRAPHIRE) { /* Penabled */ + int x, y, pressure, distance; + int tip, button_1, button_2; + int in_box, has_data, moving; + int eraser; + + tip = data[1] & 0x01; + button_1 = (data[1] & 0x02) >> 1; + button_2 = (data[1] & 0x04) >> 2; + eraser = (data[1] & 0x08) >> 3; + in_box = (data[1] & 0x10) >> 4; + has_data = (data[1] & 0x20) >> 5; + moving = (data[1] & 0x40) >> 6; + prox = (data[1] & 0x80) >> 7; + touchInProx = ~prox; + stylusInProx = prox; + + x = wacom_le16_to_cpu(&data[2]); + y = wacom_le16_to_cpu(&data[4]); + pressure = wacom_le16_to_cpu(&data[6]); + distance = data[8]; + + if (has_data && in_box) { + if (eraser) { + wacom->tool[0] = BTN_TOOL_RUBBER; + wacom->id[0] = ERASER_DEVICE_ID; + } else { + wacom->tool[0] = BTN_TOOL_PEN; + wacom->id[0] = STYLUS_DEVICE_ID; + } + wacom_report_abs(wcombo, ABS_X, x); + wacom_report_abs(wcombo, ABS_Y, y); + wacom_report_abs(wcombo, ABS_PRESSURE, pressure); + wacom_report_abs(wcombo, ABS_DISTANCE, distance); + wacom_report_key(wcombo, BTN_TOUCH, tip); + wacom_report_key(wcombo, BTN_STYLUS, button_1); + wacom_report_key(wcombo, BTN_STYLUS2, button_2); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ + wacom_report_key(wcombo, wacom->tool[0], 1); + } else { + wacom_report_abs(wcombo, ABS_X, 0); + wacom_report_abs(wcombo, ABS_Y, 0); + wacom_report_abs(wcombo, ABS_PRESSURE, 0); + wacom_report_key(wcombo, BTN_TOUCH, 0); + wacom_report_key(wcombo, BTN_STYLUS, 0); + wacom_report_key(wcombo, BTN_STYLUS2, 0); + wacom->id[0] = 0; + wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ + wacom_report_key(wcombo, wacom->tool[0], 0); + + touchInProx = 1; + } + wacom_report_key(wcombo, wacom->tool[0], in_box); + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); + + retval = 1; } - return 1; +exit: + return retval; } static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) @@ -241,7 +394,7 @@ /* in prox and not a pad data */ penData = 1; - switch ((data[1] >5) & 3) { + switch ((data[1] >> 5) & 3) { case 0: /* Pen */ wacom->tool[0] = BTN_TOOL_PEN; @@ -317,7 +470,7 @@ wacom->id[1] = PAD_DEVICE_ID; wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); - rw = ((data[7] & 0x18) >3) - ((data[7] & 0x20) >3); + rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); wacom_report_rel(wcombo, REL_WHEEL, rw); wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); @@ -388,9 +541,9 @@ /* serial number of the tool */ wacom->serial[idx] = ((data[3] & 0x0f) << 28) + (data[4] << 20) + (data[5] << 12) + - (data[6] << 4) + (data[7] >4); + (data[6] << 4) + (data[7] >> 4); - wacom->id[idx] = (data[2] << 4) | (data[3] >4); + wacom->id[idx] = (data[2] << 4) | (data[3] >> 4); switch (wacom->id[idx]) { case 0x812: /* Inking pen */ case 0x801: /* Intuos3 Inking pen */ @@ -497,12 +650,12 @@ /* general pen packet */ if ((data[1] & 0xb8) == 0xa0) { - t = (data[6] << 2) | ((data[7] >6) & 3); + 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_abs(wcombo, ABS_TILT_X, - ((data[7] << 1) & 0x7e) | (data[8] >7)); + ((data[7] << 1) & 0x7e) | (data[8] >> 7)); wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f); wacom_report_key(wcombo, BTN_STYLUS, data[1] & 2); wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 4); @@ -512,9 +665,9 @@ /* airbrush second packet */ if ((data[1] & 0xbc) == 0xb4) { wacom_report_abs(wcombo, ABS_WHEEL, - (data[6] << 2) | ((data[7] >6) & 3)); + (data[6] << 2) | ((data[7] >> 6) & 3)); wacom_report_abs(wcombo, ABS_TILT_X, - ((data[7] << 1) & 0x7e) | (data[8] >7)); + ((data[7] << 1) & 0x7e) | (data[8] >> 7)); wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f); } return; @@ -616,13 +769,13 @@ return 0; if (wacom->features->type >= INTUOS3S) { - wacom_report_abs(wcombo, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >1) & 1)); + wacom_report_abs(wcombo, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); wacom_report_abs(wcombo, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1)); - wacom_report_abs(wcombo, ABS_DISTANCE, ((data[9] >2) & 0x3f)); + wacom_report_abs(wcombo, ABS_DISTANCE, ((data[9] >> 2) & 0x3f)); } else { wacom_report_abs(wcombo, ABS_X, wacom_be16_to_cpu(&data[2])); wacom_report_abs(wcombo, ABS_Y, wacom_be16_to_cpu(&data[4])); - wacom_report_abs(wcombo, ABS_DISTANCE, ((data[9] >3) & 0x1f)); + wacom_report_abs(wcombo, ABS_DISTANCE, ((data[9] >> 3) & 0x1f)); } /* process general packets */ @@ -635,13 +788,13 @@ /* Rotation packet */ if (wacom->features->type >= INTUOS3S) { /* I3 marker pen rotation */ - t = (data[6] << 3) | ((data[7] >5) & 7); + t = (data[6] << 3) | ((data[7] >> 5) & 7); t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : ((t-1) / 2 + 450)) : (450 - t / 2) ; wacom_report_abs(wcombo, ABS_Z, t); } else { /* 4D mouse rotation packet */ - t = (data[6] << 3) | ((data[7] >5) & 7); + t = (data[6] << 3) | ((data[7] >> 5) & 7); wacom_report_abs(wcombo, ABS_RZ, (data[7] & 0x20) ? ((t - 1) / 2) : -t / 2); } @@ -654,7 +807,7 @@ wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x20); wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x10); - t = (data[6] << 2) | ((data[7] >6) & 3); + t = (data[6] << 2) | ((data[7] >> 6) & 3); wacom_report_abs(wcombo, ABS_THROTTLE, (data[8] & 0x08) ? -t : t); } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { @@ -663,13 +816,13 @@ 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_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)); + ((data[7] << 1) & 0x7e) | (data[8] >> 7)); wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f); } else { /* 2D mouse packet */ @@ -677,7 +830,7 @@ 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)); + - ((data[8] & 0x02) >> 1)); /* I3 2D mouse side buttons */ if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) { @@ -903,7 +1056,7 @@ return wacom_graphire_irq(wacom_wac, wcombo); case BAMBOO_PT: - return wacom_bamboo_pt_irq(wacom_wac, wcombo); + return wacom_bpt_irq(wacom_wac, wcombo); case PTU: return wacom_ptu_irq(wacom_wac, wcombo); @@ -932,8 +1085,9 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { switch (wacom_wac->features->type) { - case WACOM_MO: case BAMBOO_PT: + input_dev_bpt(input_dev, wacom_wac); + case WACOM_MO: input_dev_mo(input_dev, wacom_wac); case WACOM_G4: input_dev_g4(input_dev, wacom_wac); @@ -1042,13 +1196,14 @@ { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }, { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }, { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }, - { "Wacom ISDv4 9F", WACOM_PKGLEN_PENABLED, 26202, 16325, 255, 0, TABLETPC }, + { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }, { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }, { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }, - { "Wacom Bamboo P&T 4x5", WACOM_PKGLEN_GRAPHIRE, 14760, 9225, 1023, 63, BAMBOO_PT }, - { "Wacom Bamboo Pen 4x5", WACOM_PKGLEN_GRAPHIRE, 14732, 9144, 1023, 63, BAMBOO_PT }, - { "Wacom Bamboo Craft", WACOM_PKGLEN_GRAPHIRE, 14732, 9144, 1023, 63, BAMBOO_PT }, + { "Wacom Bamboo P&T 4x5", WACOM_PKGLEN_GRAPHIRE, 14720, 9200, 1023, 63, BAMBOO_PT }, + { "Wacom Bamboo Pen 4x5", WACOM_PKGLEN_GRAPHIRE, 14720, 9200, 1023, 63, BAMBOO_PT }, + { "Wacom Bamboo Craft", WACOM_PKGLEN_GRAPHIRE, 14720, 9200, 1023, 63, BAMBOO_PT }, { "Wacom Bamboo P&T 6x8", WACOM_PKGLEN_GRAPHIRE, 21648, 13530, 1023, 63, BAMBOO_PT }, + { "Wacom Bamboo Touch", WACOM_PKGLEN_GRAPHIRE, 14720, 9200, 1023, 63, BAMBOO_PT }, { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }, { } }; @@ -1120,6 +1275,7 @@ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xD4) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xD2) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xD3) }, + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xD0) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, { } }; @@ -1186,8 +1342,7 @@ return ret; } -/* TODO: Call this when recognizing a button 0 button press to change the ring - * LED +/* Call this when recognizing a button 0 button press to change the ring LED */ int set_scroll_wheel_led(struct usb_interface *intf, int num) { @@ -1221,7 +1376,7 @@ } while ((ret == -ETIMEDOUT || ret == -EPIPE) && c < WAC_LED_RETRIES); if (ret < 0) { - /* TODO: starting and stopping the transfer mode doesn't + /* starting and stopping the transfer mode doesn't * seem to have an effect on the successfull transfer * of icon data. If it did, we would want to try to stop * the transfer here after failure. @@ -1281,11 +1436,11 @@ /* also flip the first 4 bits with the last 4 bits */ temp = buf[j*cols + i] & 0xf0; buf[j*cols + i] <<= 4; - buf[j*cols + i] |= (temp >4) & 0x0f; + buf[j*cols + i] |= (temp >> 4) & 0x0f; temp = buf[(rows-j-1)*cols + i] & 0xf0; buf[(rows-j-1)*cols + i] <<= 4; - buf[(rows-j-1)*cols + i] |= (temp >4) & 0x0f; + buf[(rows-j-1)*cols + i] |= (temp >> 4) & 0x0f; } } @@ -1312,7 +1467,7 @@ switch (wacom->wacom_wac->features->type) { case INTUOS4S: printk(KERN_DEBUG "INTUOS4S: set_led not supported!\n"); - /* TODO: to support this, I need to know the dimensions */ + /* to support this, I need to know the dimensions */ r = -1; goto out; case INTUOS4: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/2.6.27/wacom_wac.h new/linuxwacom-0.8.5-9/src/2.6.27/wacom_wac.h --- old/linuxwacom-0.8.5-8/src/2.6.27/wacom_wac.h 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/2.6.27/wacom_wac.h 2009-12-31 01:05:15.000000000 +0100 @@ -17,9 +17,9 @@ #define WACOM_PKGLEN_GRAPHIRE 8 #define WACOM_PKGLEN_BBFUN 9 #define WACOM_PKGLEN_INTUOS 10 -#define WACOM_PKGLEN_PENABLED 8 #define WACOM_PKGLEN_TPC1FG 5 #define WACOM_PKGLEN_TPC2FG 14 +#define WACOM_PKGLEN_BBTOUCH 20 /* device IDs */ #define STYLUS_DEVICE_ID 0x02 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/wacomxi/wacomcpl-exec new/linuxwacom-0.8.5-9/src/wacomxi/wacomcpl-exec --- old/linuxwacom-0.8.5-8/src/wacomxi/wacomcpl-exec 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/wacomxi/wacomcpl-exec 2009-12-31 01:05:15.000000000 +0100 @@ -1920,6 +1920,13 @@ set numPadButtons($i) 4 set numPadRings($i) 1 } + + # Bamboo Pen and Touch + for { set i 208 } { $i <= 212 } { incr i 1 } { + set hasPad($i) 1 + set numPadButtons($i) 4 + } + # I3 set numPadButtons(176) 4 set numPadStrips(176) 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/xdrv/wcmCommon.c new/linuxwacom-0.8.5-9/src/xdrv/wcmCommon.c --- old/linuxwacom-0.8.5-8/src/xdrv/wcmCommon.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/xdrv/wcmCommon.c 2009-12-31 01:05:15.000000000 +0100 @@ -1170,6 +1170,69 @@ } } } + + /* process single finger events */ + if (ds.device_type == TOUCH_ID && common->wcmTouch && !common->wcmGesture) + { + WacomDeviceState* pds = &common->wcmTouchpadState; + WacomDevicePtr priv = common->wcmDevices; + + if (ds.proximity) + switch (common->wcmTouchpadMode) + { + case 0: + common->wcmTouchpadMode = 1; + common->wcmTouchpadState = ds; + common->wcmTouchpadState.sample = (int)GetTimeInMillis(); + break; + case 1: + if (GetTimeInMillis() - pds->sample <= 200) { + int xd = ds.x - pds->x; + int yd = ds.y - pds->y; + + if (xd*xd + yd*yd > 10*10) + common->wcmTouchpadMode = 2; + } else { + /* left button down */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + 1,1,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); + common->wcmTouchpadMode = 3; + } + break; + } + else { + switch (common->wcmTouchpadMode) + { + case 1: + if (GetTimeInMillis() - pds->sample <= 200) + { + /* left button down */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + 1,1,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); + /* left button up */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + 1,0,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); + } + break; + case 3: + /* left button up */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + 1,0,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); + } + common->wcmTouchpadMode = 0; + } + if (common->wcmTouchpadMode == 1 || common->wcmTouchpadMode == 2) + ds.buttons &= ~1; + } + /* everything else falls here */ commonDispatchDevice(common,channel,pChannel, suppress); ret: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/xdrv/wcmUSB.c new/linuxwacom-0.8.5-9/src/xdrv/wcmUSB.c --- old/linuxwacom-0.8.5-8/src/xdrv/wcmUSB.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/xdrv/wcmUSB.c 2009-12-31 01:05:15.000000000 +0100 @@ -826,7 +826,7 @@ static void usbParseEvent(LocalDevicePtr local, const struct input_event* event) { - int channel; + int channel = -1; WacomDevicePtr priv = (WacomDevicePtr)local->private; WacomCommonPtr common = priv->common; @@ -886,7 +886,7 @@ } /* ignore events without information */ - if (common->wcmEventCnt <= 2) + if (common->wcmEventCnt <= 2 && common->wcmLastToolSerial) { DBG(3, common->debugLevel, ErrorF("%s - usbParse: dropping empty event for serial %d\n", local->name, common->wcmLastToolSerial)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/xdrv/xf86Wacom.c new/linuxwacom-0.8.5-9/src/xdrv/xf86Wacom.c --- old/linuxwacom-0.8.5-8/src/xdrv/xf86Wacom.c 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/xdrv/xf86Wacom.c 2009-12-31 01:05:15.000000000 +0100 @@ -91,9 +91,10 @@ * 2009-12-08 47-pc0.8.5-6 - Add new serial ISDV4 devices * 2009-12-14 47-pc0.8.5-7 - Updated serial ISDV4 support * 2009-12-21 47-pc0.8.5-8 - Added local max and resolution for tool + * 2009-12-29 47-pc0.8.5-9 - Merged support for Bamboo P&T from Ayuthia */ -static const char identification[] = "$Identification: 47-0.8.5-8 $"; +static const char identification[] = "$Identification: 47-0.8.5-9 $"; /****************************************************************************/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxwacom-0.8.5-8/src/xdrv/xf86WacomDefs.h new/linuxwacom-0.8.5-9/src/xdrv/xf86WacomDefs.h --- old/linuxwacom-0.8.5-8/src/xdrv/xf86WacomDefs.h 2009-12-23 00:26:09.000000000 +0100 +++ new/linuxwacom-0.8.5-9/src/xdrv/xf86WacomDefs.h 2009-12-31 01:05:15.000000000 +0100 @@ -415,6 +415,8 @@ int wcmTPCButtonDefault; /* Tablet PC button default */ int wcmTouchDefault; /* default touch to disable when not supported */ int wcmGestureMode; /* data is in Gesture Mode? */ + int wcmTouchpadMode; /* in touchpad mode? */ + WacomDeviceState wcmTouchpadState; /* inital state when in touchpad mode */ WacomDeviceState wcmGestureState[MAX_FINGERS]; /* inital state when in gesture mode */ int wcmGesture; /* disable/enable touch gesture */ int wcmGestureDefault; /* default touch gesture to disable when not supported */ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org