Hello community,

here is the log from the commit of package xf86-input-wacom for 
openSUSE:Factory checked in at 2014-04-23 20:35:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xf86-input-wacom (Old)
 and      /work/SRC/openSUSE:Factory/.xf86-input-wacom.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xf86-input-wacom"

Changes:
--------
--- /work/SRC/openSUSE:Factory/xf86-input-wacom/xf86-input-wacom.changes        
2014-03-26 16:42:21.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.xf86-input-wacom.new/xf86-input-wacom.changes   
2014-04-23 20:35:41.000000000 +0200
@@ -1,0 +2,34 @@
+Thu Apr 10 10:17:55 UTC 2014 - e...@suse.com
+
+- remove 65-xorg-wacom.rules wacom-inputattach@.service:
+  package now ships udev rules and systemd files
+
+-------------------------------------------------------------------
+Wed Apr  9 21:23:08 UTC 2014 - e...@suse.com
+
+- Udate to xf86-input-wacom-0.24.0.tar.bz2
+- Remove old set of patches (partly upstreamed)
+  * 
u_01-Fix-message-if-the-detected-pressure-falls-below-the-initially-detected-pressure.patch
+  * u_02-Log-when-the-pen-device-appears-to-be-too-worn-out.patch
+  * 
u_03-Add-more-detailed-messaging-in-code-that-handles-abnormal-situations.patch
+  * u_04-Avoid-division-by-zero-in-xf86ScaleAxis.patch
+  * u_05-Improve-usbInitToolType-tool-type-detection.patch
+  * u_06-Add-an-option-to-disable-pressure-recalibration.patch
+  * u_07-Add-option-to-enable-logging.patch
+  * u_08-Log-PROXIMITY-events.patch
+  * u_09-Log-PRESSURE-events.patch
+  * u_10-Log-BUTTON-events.patch
+- Add upstream patches:
+  * U_01-Remove-unused-code.patch
+  * U_02-Zero-is-not-a-valid-device-ID-don-t-derive-a-type-from-it.patch
+  * U_03-Fix-initial-device-type-detection.patch
+  * U_04-Store-the-last-used-channel-rather-than-blindly-taking-channel-0.patch
+  * U_05-Remove-duplicate-tool-type-detection.patch
+  * U_06-Attempt-to-derive-the-tool-type-from-a-known-button-key-event.patch
+- Add logging patches:
+  * n_01-Add-option-to-enable-logging.patch
+  * n_02-Log-PROXIMITY-LOW-LEVEL-events.patch
+  * n_03-Log-PRESSURE-low-level-events.patch
+  * n_04-Log-BUTTON-HIGH-LEVEL-events.patch
+
+-------------------------------------------------------------------

Old:
----
  65-xorg-wacom.rules
  
u_01-Fix-message-if-the-detected-pressure-falls-below-the-initially-detected-pressure.patch
  u_02-Log-when-the-pen-device-appears-to-be-too-worn-out.patch
  
u_03-Add-more-detailed-messaging-in-code-that-handles-abnormal-situations.patch
  u_04-Avoid-division-by-zero-in-xf86ScaleAxis.patch
  u_05-Improve-usbInitToolType-tool-type-detection.patch
  u_06-Add-an-option-to-disable-pressure-recalibration.patch
  u_07-Add-option-to-enable-logging.patch
  u_08-Log-PROXIMITY-events.patch
  u_09-Log-PRESSURE-events.patch
  u_10-Log-BUTTON-events.patch
  wacom-inputattach@.service
  xf86-input-wacom-0.23.0.tar.bz2

New:
----
  U_01-Remove-unused-code.patch
  U_02-Zero-is-not-a-valid-device-ID-don-t-derive-a-type-from-it.patch
  U_03-Fix-initial-device-type-detection.patch
  U_04-Store-the-last-used-channel-rather-than-blindly-taking-channel-0.patch
  U_05-Remove-duplicate-tool-type-detection.patch
  U_06-Attempt-to-derive-the-tool-type-from-a-known-button-key-event.patch
  n_01-Add-option-to-enable-logging.patch
  n_02-Log-PROXIMITY-LOW-LEVEL-events.patch
  n_03-Log-PRESSURE-low-level-events.patch
  n_04-Log-BUTTON-HIGH-LEVEL-events.patch
  xf86-input-wacom-0.24.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xf86-input-wacom.spec ++++++
--- /var/tmp/diff_new_pack.tHZFeK/_old  2014-04-23 20:35:42.000000000 +0200
+++ /var/tmp/diff_new_pack.tHZFeK/_new  2014-04-23 20:35:42.000000000 +0200
@@ -21,27 +21,29 @@
 %else
 %define _udevrulesdir /lib/udev/rules.d
 %endif
+####  Only set for non-enterprise
+%if %{suse_version} != 1315
+%define install_serial 1
+%endif
 
 Name:           xf86-input-wacom
-Version:        0.23.0
+Version:        0.24.0
 Release:        0
 Summary:        Wacom input driver for the Xorg X server
 License:        GPL-2.0+
 Group:          System/X11/Servers/XF86_4
 Url:            
http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Xf86-input-wacom
 Source0:        
http://downloads.sourceforge.net/project/linuxwacom/xf86-input-wacom/%{name}-%{version}.tar.bz2
-Source1:        65-xorg-wacom.rules
-Source2:        wacom-inputattach@.service
-Patch1:         
u_01-Fix-message-if-the-detected-pressure-falls-below-the-initially-detected-pressure.patch
-Patch2:         u_02-Log-when-the-pen-device-appears-to-be-too-worn-out.patch
-Patch3:         
u_03-Add-more-detailed-messaging-in-code-that-handles-abnormal-situations.patch
-Patch4:         u_04-Avoid-division-by-zero-in-xf86ScaleAxis.patch
-Patch5:         u_05-Improve-usbInitToolType-tool-type-detection.patch
-Patch6:         u_06-Add-an-option-to-disable-pressure-recalibration.patch
-Patch7:         u_07-Add-option-to-enable-logging.patch
-Patch8:         u_08-Log-PROXIMITY-events.patch
-Patch9:         u_09-Log-PRESSURE-events.patch
-Patch10:        u_10-Log-BUTTON-events.patch
+Patch1:         U_01-Remove-unused-code.patch
+Patch2:         
U_02-Zero-is-not-a-valid-device-ID-don-t-derive-a-type-from-it.patch
+Patch3:         U_03-Fix-initial-device-type-detection.patch
+Patch4:         
U_04-Store-the-last-used-channel-rather-than-blindly-taking-channel-0.patch
+Patch5:         U_05-Remove-duplicate-tool-type-detection.patch
+Patch6:         
U_06-Attempt-to-derive-the-tool-type-from-a-known-button-key-event.patch
+Patch7:         n_01-Add-option-to-enable-logging.patch
+Patch8:         n_02-Log-PROXIMITY-LOW-LEVEL-events.patch
+Patch9:         n_03-Log-PRESSURE-low-level-events.patch
+Patch10:        n_04-Log-BUTTON-HIGH-LEVEL-events.patch
 BuildRequires:  pkg-config
 %if %{suse_version} > 1230
 BuildRequires:  systemd-rpm-macros
@@ -78,7 +80,7 @@
 %x11_abi_xinput_req
 
 %description
-wacom is an X input driver for Wacom devices.
+wacom is an X input driver and utilities for Wacom devices.
 
 %package devel
 Summary:        Wacom input driver for the Xorg X server -- Development Files
@@ -88,7 +90,7 @@
 Obsoletes:      x11-input-wacom-devel < %{version}
 
 %description devel
-wacom is an X input driver for Wacom devices.
+wacom is an X input driver and utilities for Wacom devices.
 
 %prep
 %setup -q
@@ -105,15 +107,15 @@
 
 %build
 autoreconf -fi
-%configure --with-xorg-conf-dir=/etc/X11/xorg.conf.d
+%configure --with-xorg-conf-dir=/etc/X11/xorg.conf.d --enable-logging 
--with-systemd-unit-dir=%{_unitdir} --with-udev-rules-dir=%{_udevrulesdir}
 make %{?_smp_mflags}
 
 %install
 %make_install
 find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
-install -D -m 644 %{SOURCE1} 
$RPM_BUILD_ROOT%{_udevrulesdir}/65-xorg-wacom.rules
-mkdir -p $RPM_BUILD_ROOT%_unitdir
-install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%_unitdir
+mv %{buildroot}%{_udevrulesdir}/wacom.rules  
%{buildroot}%{_udevrulesdir}/65-wacom.rules
+# if we don't package these remove them so no debuginfo files will be generated
+%{!?install_serial: rm %{buildroot}%{_bindir}/isdv4-serial-inputattach 
%{buildroot}%{_bindir}/isdv4-serial-debugger}
 
 %post
 test -n "$FIRST_ARG" || FIRST_ARG=$1
@@ -146,7 +148,7 @@
 %files
 %defattr(-,root,root)
 %doc AUTHORS ChangeLog GPL README
-%{_udevrulesdir}/65-xorg-wacom.rules
+%{_udevrulesdir}/65-wacom.rules
 %{_unitdir}/wacom-inputattach@.service
 %config %{_sysconfdir}/X11/xorg.conf.d/50-wacom.conf
 %dir %{_libdir}/xorg/modules/input
@@ -154,6 +156,7 @@
 %{_bindir}/xsetwacom
 %{_datadir}/man/man1/xsetwacom.1%{?ext_man}
 %{_datadir}/man/man4/wacom.4%{?ext_man}
+%{?install_serial:%{_bindir}/isdv4-serial-inputattach}
 
 %files devel
 %defattr(-,root,root)
@@ -162,7 +165,7 @@
 %{_includedir}/xorg/wacom-properties.h
 %{_includedir}/xorg/wacom-util.h
 # not useful for most people
-%{_bindir}/isdv4-serial-debugger
+%{?install_serial:%{_bindir}/isdv4-serial-debugger}
 %{_libdir}/pkgconfig/xorg-wacom.pc
 
 %changelog

++++++ U_01-Remove-unused-code.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Wed Apr 9 21:27:00 2014 +0200
Subject: [PATCH 1/6]Remove unused code
Patch-Mainline: Upstream
Git-commit: 840e6585ab273828d6bcf1f0d0f4293f4ddb631a
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

usbFindDeviceType() is only called once. From where it
is called, it is only called if event->value != 0 and
with ds->device_id = event->value.
Thus the test !ds->device_id will always fail.

Signed-off-by: Egbert Eich <e...@suse.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 7375711..3e5c31d 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1100,33 +1100,20 @@ static int usbIdToType(int id)
 }
 
 /**
- * Find the tool type (STYLUS_ID, etc.) based on the device_id or the
- *  current tool serial number if the device_id is unknown (0).
+ * Find the tool type (STYLUS_ID, etc.) based on the device_id.
  *
  * Protocol 5 devices report different IDs for different styli and pucks,
  * Protocol 4 devices simply report STYLUS_DEVICE_ID, etc.
  *
  * @param ds The current device state received from the kernel.
- * @return The tool type associated with the tool id or the current
- * tool serial number.
+ * @return The tool type associated with the tool id.
  */
 static int usbFindDeviceType(const WacomCommonPtr common,
                          const WacomDeviceState *ds)
 {
-       WacomToolPtr tool = NULL;
        int device_type = 0;
 
-       if (!ds->device_id && ds->serial_num)
-       {
-               for (tool = common->wcmTool; tool; tool = tool->next)
-                       if (ds->serial_num == tool->serial)
-                       {
-                               device_type = tool->typeid;
-                               break;
-                       }
-       }
-
-       if (device_type || !ds->device_id) return device_type;
+       if (!ds->device_id) return 0;
 
        switch (ds->device_id)
        {
++++++ U_02-Zero-is-not-a-valid-device-ID-don-t-derive-a-type-from-it.patch 
++++++
From: Egbert Eich <e...@suse.com>
Date: Wed Apr 9 21:27:01 2014 +0200
Subject: [PATCH 2/6]Zero is not a valid device ID, don't derive a type from it
Patch-Mainline: Upstream
Git-commit: 533220d3f2369b80afc404df1e5bb6a024309616
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

A protocol 5 tool will send an ABS event code=ABS_MISC with
value 0. 0 is however not a valid device ID. Don't try to
derive a type from it.

Signed-off-by: Egbert Eich <e...@suse.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 3e5c31d..83d9eed 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1087,6 +1087,9 @@ static int usbIdToType(int id)
 {
        int type = STYLUS_ID;
 
+       if (!id)
+               return 0;
+
        /* The existing tool ids have the following patten: all pucks, except
         * one, have the third byte set to zero; all erasers have the fourth
         * bit set. The rest are styli.
++++++ U_03-Fix-initial-device-type-detection.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Wed Apr 9 21:27:02 2014 +0200
Subject: [PATCH 3/6]Fix initial device type detection
Patch-Mainline: Upstream
Git-commit: e08c45f3caf371a8e4123119aeb0b0d7fc227cca
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

usbInitToolType() tries to find the device type of a tool.
Unlike usbFindDeviceType() it doesn't take into account the device_id
which may exist in the event stream.
As a result the device type may be taken from the last known type.
This is generally a bad idea if the type has changed.
This will happen for example when pressing a key on the Cintiq 21UX menu
strips after removing a pen from the tablet.

Signed-off-by: Egbert Eich <e...@suse.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 62 ++++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 37 insertions(+), 25 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 83d9eed..b79f0e3 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1108,37 +1108,46 @@ static int usbIdToType(int id)
  * Protocol 5 devices report different IDs for different styli and pucks,
  * Protocol 4 devices simply report STYLUS_DEVICE_ID, etc.
  *
- * @param ds The current device state received from the kernel.
- * @return The tool type associated with the tool id.
+ * @device_id id of the device
+ * @return device type
  */
-static int usbFindDeviceType(const WacomCommonPtr common,
-                         const WacomDeviceState *ds)
+static int usbFindDeviceTypeById(int device_id)
 {
-       int device_type = 0;
-
-       if (!ds->device_id) return 0;
-
-       switch (ds->device_id)
+       switch (device_id)
        {
                case STYLUS_DEVICE_ID:
-                       device_type = STYLUS_ID;
-                       break;
+                       return STYLUS_ID;
                case ERASER_DEVICE_ID:
-                       device_type = ERASER_ID;
-                       break;
+                       return ERASER_ID;
                case CURSOR_DEVICE_ID:
-                       device_type = CURSOR_ID;
-                       break;
+                       return CURSOR_ID;
                case TOUCH_DEVICE_ID:
-                       device_type = TOUCH_ID;
-                       break;
+                       return TOUCH_ID;
                case PAD_DEVICE_ID:
-                       device_type = PAD_ID;
-                       break;
+                       return PAD_ID;
                default: /* protocol 5 */
-                       device_type = usbIdToType(ds->device_id);
+                       return usbIdToType(device_id);
        }
+       return 0;
+}
+
+/**
+ * Find the tool type (STYLUS_ID, etc.) based on the device_id.
+ *
+ * Protocol 5 devices report different IDs for different styli and pucks,
+ * Protocol 4 devices simply report STYLUS_DEVICE_ID, etc.
+ *
+ * @param ds The current device state received from the kernel.
+ * @return The tool type associated with the tool id.
+ */
+static int usbFindDeviceType(const WacomCommonPtr common,
+                         const WacomDeviceState *ds)
+{
+       int device_type = 0;
+
+       if (!ds->device_id) return 0;
 
+       device_type = usbFindDeviceTypeById(ds->device_id);
        return device_type;
 }
 
@@ -1488,15 +1497,16 @@ static void usbParseBTNEvent(WacomCommonPtr common,
 }
 
 /**
- * Translates a tool code from the kernel (e.g. BTN_TOOL_PEN) into the
- * corresponding device type for the driver (e.g. STYLUS_ID).
+ * Translates an event code from the kernel (e.g. type: EV_ABS code: ABS_MISC 
value: STYLUS_DEVICE_ID)
+ * into the corresponding device type for the driver (e.g. STYLUS_ID).
  *
  * @param[in] common
  * @param[in] type      Linux input tool type (e.g. EV_KEY)
  * @param[in] code      Linux input tool code (e.g. BTN_STYLUS_PEN)
+ * @param[in] value     Linux input tool value (e.g. STYLUS_DEVICE_ID)
  * @return              Wacom device ID (e.g. STYLUS_ID) or 0 if no match.
  */
-static int toolTypeToDeviceType(WacomCommonPtr common, int type, int code)
+static int deviceTypeFromEvent(WacomCommonPtr common, int type, int code, int 
value)
 {
        wcmUSBData* private = common->private;
 
@@ -1528,6 +1538,8 @@ static int toolTypeToDeviceType(WacomCommonPtr common, 
int type, int code)
                        case ABS_MT_SLOT:
                        case ABS_MT_TRACKING_ID:
                                return TOUCH_ID;
+                       case ABS_MISC:
+                               return usbFindDeviceTypeById(value);
                }
        }
 
@@ -1557,7 +1569,7 @@ static int refreshDeviceType(WacomCommonPtr common, int 
fd)
        for (i = 0; i < KEY_MAX; i++)
        {
                if (ISBITSET(keys, i))
-                       device_type = toolTypeToDeviceType(common, EV_KEY, i);
+                       device_type = deviceTypeFromEvent(common, EV_KEY, i, 0);
                if (device_type)
                        return device_type;
        }
@@ -1588,7 +1600,7 @@ static int usbInitToolType(WacomCommonPtr common, int fd,
 
        for (i = 0; (i < nevents) && !device_type; ++i, event_ptr++)
        {
-               device_type = toolTypeToDeviceType(common, event_ptr->type, 
event_ptr->code);
+               device_type = deviceTypeFromEvent(common, event_ptr->type, 
event_ptr->code, event_ptr->value);
        }
 
        if (!device_type)
++++++ 
U_04-Store-the-last-used-channel-rather-than-blindly-taking-channel-0.patch 
++++++
From: Egbert Eich <e...@suse.com>
Date: Wed Apr 9 21:27:03 2014 +0200
Subject: [PATCH 4/6]Store the last used channel rather than blindly taking 
channel 0
Patch-Mainline: Upstream
Git-commit: 8f44f3568c46ab9cca543b830fb2e84dd56a2af9
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

When an event stream from a device doesn't contain information
on the device type we look at the last used channel and copy
over the device type.
This is acceptable as such a situation only occurs while in
proximity i.e. when the previous command package came from
the same device.
So far the device type form the state in channel 0 was taken.
This was wrong however for PAD devices for instance.

Signed-off-by: Egbert Eich <e...@suse.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index b79f0e3..c060ec5 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -41,6 +41,7 @@ typedef struct {
        int nbuttons;                /* total number of buttons */
        int npadkeys;                /* number of pad keys in the above array */
        int padkey_code[WCM_MAX_BUTTONS];/* hardware codes for buttons */
+       int lastChannel;
 } wcmUSBData;
 
 static Bool usbDetect(InputInfoPtr);
@@ -1636,8 +1637,8 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
        WacomCommonPtr common = priv->common;
        int channel;
-       WacomDeviceState dslast = common->wcmChannel[0].valid.state;
        wcmUSBData* private = common->private;
+       WacomDeviceState dslast = 
common->wcmChannel[private->lastChannel].valid.state;
 
        DBG(6, common, "%d events received\n", private->wcmEventCnt);
 
@@ -1767,6 +1768,8 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        if (!ds->proximity)
                private->wcmLastToolSerial = 0;
 
+       private->lastChannel = channel;
+
        for (c = 0; c < MAX_CHANNELS; c++) {
                ds = &common->wcmChannel[c].work;
 
++++++ U_05-Remove-duplicate-tool-type-detection.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Wed Apr 9 21:27:04 2014 +0200
Subject: [PATCH 5/6]Remove duplicate tool type detection
Patch-Mainline: Upstream
Git-commit: 261ca70cfdc17c1e927b80190d127226798172c0
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

Tool type detection is done in two places: early in usbDispatchEvents()
by calling usbInitToolType() and later on in the same function when the
events are parsed.
usbInitToolType() is used to set (wcmUSBData*)->wcmDeviceType, the
detection that happens later when the events are parsed sets
(WacomDeviceState).device_type. These variables are matched against each
to find the right channel for a device.
If the algorithms used for both set of tool type detection diverge
undesirable effects may happen. Therefore it is advisable to determine the
tool type only once ie. in usbInitToolType() and copy the result to
(WacomDeviceState).device_type if this value is unset.

* Bring the algorithm in usbInitToolType() in sync with the reset:

  Add missing key codes to deviceTypeFromEvent()

  - Add BTN_TOOL_DOUBLETAP and BTN_TOOL_TRIPLETAP, return
    TOUCH_ID for them.

  - Return TOUCH_ID on BTN_TOUCH when protocol level is
    WCM_PROTOCOL_GENERIC and tool is a 1 finger USB touch.

* Delete any duplicate tool type setting

* Add a test for debugging if the device type has changed while in proximity.

Signed-off-by: Egbert Eich <e...@suse.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index c060ec5..6932b9f 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1272,6 +1272,7 @@ static void usbParseAbsMTEvent(WacomCommonPtr common, 
struct input_event *event)
 
                case ABS_MT_TRACKING_ID:
                        ds->proximity = (event->value != -1);
+                       /* set this here as type for this channel doesn't get 
set in usbDispatchEvent() */
                        ds->device_type = TOUCH_ID;
                        ds->device_id = TOUCH_DEVICE_ID;
                        ds->sample = (int)GetTimeInMillis();
@@ -1315,7 +1316,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                case BTN_TOOL_PENCIL:
                case BTN_TOOL_BRUSH:
                case BTN_TOOL_AIRBRUSH:
-                       ds->device_type = STYLUS_ID;
                        /* V5 tools use ABS_MISC to report device_id */
                        if (common->wcmProtocolLevel == WCM_PROTOCOL_4)
                                ds->device_id = STYLUS_DEVICE_ID;
@@ -1326,7 +1326,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                        break;
 
                case BTN_TOOL_RUBBER:
-                       ds->device_type = ERASER_ID;
                        /* V5 tools use ABS_MISC to report device_id */
                        if (common->wcmProtocolLevel == WCM_PROTOCOL_4)
                                ds->device_id = ERASER_DEVICE_ID;
@@ -1343,7 +1342,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                        DBG(6, common,
                            "USB mouse detected %x (value=%d)\n",
                            event->code, event->value);
-                       ds->device_type = CURSOR_ID;
                        /* V5 tools use ABS_MISC to report device_id */
                        if (common->wcmProtocolLevel == WCM_PROTOCOL_4)
                                ds->device_id = CURSOR_DEVICE_ID;
@@ -1361,7 +1359,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                                        DBG(6, common,
                                            "USB 1FG Touch detected %x 
(value=%d)\n",
                                            event->code, event->value);
-                                       ds->device_type = TOUCH_ID;
                                        ds->device_id = TOUCH_DEVICE_ID;
                                        ds->proximity = event->value;
                                }
@@ -1375,7 +1372,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                                DBG(6, common,
                                    "USB Pad detected %x (value=%d)\n",
                                event->code, event->value);
-                               ds->device_type = PAD_ID;
                                ds->device_id = PAD_DEVICE_ID;
                                ds->proximity = (event->value != 0);
                                break;
@@ -1386,7 +1382,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                        DBG(6, common,
                            "USB Touch detected %x (value=%d)\n",
                            event->code, event->value);
-                       ds->device_type = TOUCH_ID;
                        ds->device_id = TOUCH_DEVICE_ID;
                        ds->proximity = event->value;
                        /* time stamp for 2FGT gesture events */
@@ -1399,7 +1394,6 @@ static void usbParseKeyEvent(WacomCommonPtr common,
                        DBG(6, common,
                            "USB Touch second finger detected %x (value=%d)\n",
                            event->code, event->value);
-                       ds->device_type = TOUCH_ID;
                        ds->device_id = TOUCH_DEVICE_ID;
                        ds->proximity = event->value;
                        /* time stamp for 2GT gesture events */
@@ -1525,13 +1519,27 @@ static int deviceTypeFromEvent(WacomCommonPtr common, 
int type, int code, int va
 
                        case BTN_TOOL_FINGER:
                                if ((common->wcmProtocolLevel != 
WCM_PROTOCOL_GENERIC)
-                                   && !private->wcmUseMT)
+                                   && !private->wcmUseMT)  /* this isn't in 
usbParseKeyEvent() */
                                        return PAD_ID;
                                else
                                        return TOUCH_ID;
 
                        case BTN_TOOL_RUBBER:
                                return ERASER_ID;
+
+                       case BTN_TOOL_DOUBLETAP:
+                       case BTN_TOOL_TRIPLETAP:
+                               return TOUCH_ID;
+
+                       case BTN_TOUCH:
+                               if (common->wcmProtocolLevel == 
WCM_PROTOCOL_GENERIC &&
+                                   /* 1FG USB touchscreen */
+                                   !TabletHasFeature(common, WCM_PEN) &&
+                                   TabletHasFeature(common, WCM_1FGT) &&
+                                   TabletHasFeature(common, WCM_LCD))
+                                       return TOUCH_ID;
+                               else
+                                       break;
                }
        }
        else if (type == EV_ABS) {
@@ -1687,9 +1695,12 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        ds = &common->wcmChannel[channel].work;
        dslast = common->wcmChannel[channel].valid.state;
 
+       if (ds->device_type && ds->device_type != private->wcmDeviceType)
+               LogMessageVerbSigSafe(X_ERROR, 0,
+                                     "usbDispatchEvents: Device Type mismatch 
- %d -> %d. This is a BUG.\n",
+                                     ds->device_type, private->wcmDeviceType);
        /* no device type? */
        if (!ds->device_type && private->wcmDeviceType) {
-               /* tool was on tablet at startup, force type and proximity */
                ds->device_type = private->wcmDeviceType;
                ds->proximity = 1;
        }
++++++ U_06-Attempt-to-derive-the-tool-type-from-a-known-button-key-event.patch 
++++++
From: Egbert Eich <e...@suse.com>
Date: Wed Apr 9 21:27:05 2014 +0200
Subject: [PATCH 6/6]Attempt to derive the tool type from a known button/key 
event
Patch-Mainline: Upstream
Git-commit: 3eacea1058ef255e01ba83d0297bf0e5c533879b
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

This is the last bit of clean up and consolidation in tool type detection:
usbParseAbsEvent() sets the tool type if it recognized a button or key
event and the tool type has not been set before.
Before we get to usbParseAbsEvent() channel mapping must have failed most
certainly so we must have gotten a new channel for each button or key
sequence.
Since this seems to be a last resort attempt to determine the tool type
we only do this when all other methods have failed before. The newly
introduced function deriveDeviceTypeFromButtonEvent() mimics the behavior
of usbParseAbsEvent().

Signed-off-by: Egbert Eich <e...@suse.com>
Reviewed-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmUSB.c | 60 +++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 6932b9f..dca0751 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1132,26 +1132,6 @@ static int usbFindDeviceTypeById(int device_id)
        return 0;
 }
 
-/**
- * Find the tool type (STYLUS_ID, etc.) based on the device_id.
- *
- * Protocol 5 devices report different IDs for different styli and pucks,
- * Protocol 4 devices simply report STYLUS_DEVICE_ID, etc.
- *
- * @param ds The current device state received from the kernel.
- * @return The tool type associated with the tool id.
- */
-static int usbFindDeviceType(const WacomCommonPtr common,
-                         const WacomDeviceState *ds)
-{
-       int device_type = 0;
-
-       if (!ds->device_id) return 0;
-
-       device_type = usbFindDeviceTypeById(ds->device_id);
-       return device_type;
-}
-
 static void usbParseAbsEvent(WacomCommonPtr common,
                            struct input_event *event, int channel_number)
 {
@@ -1207,10 +1187,7 @@ static void usbParseAbsEvent(WacomCommonPtr common,
                case ABS_MISC:
                        ds->proximity = (event->value != 0);
                        if (event->value)
-                       {
                                ds->device_id = event->value;
-                               ds->device_type = usbFindDeviceType(common, ds);
-                       }
                        break;
                default:
                        change = 0;
@@ -1485,10 +1462,6 @@ static void usbParseBTNEvent(WacomCommonPtr common,
        }
 
        channel->dirty |= change;
-
-       /* expresskey pressed at startup or missing type */
-       if (!ds->device_type && channel->dirty)
-               ds->device_type = PAD_ID;
 }
 
 /**
@@ -1586,6 +1559,35 @@ static int refreshDeviceType(WacomCommonPtr common, int 
fd)
        return 0;
 }
 
+static int deriveDeviceTypeFromButtonEvent(WacomCommonPtr common,
+                                          const struct input_event *event_ptr)
+{
+       wcmUSBData *usbdata = common->private;
+       int nkeys;
+
+       if (event_ptr->type == EV_KEY) {
+
+               switch (event_ptr->code) {
+               case BTN_LEFT:
+               case BTN_MIDDLE:
+               case BTN_RIGHT:
+               case BTN_SIDE:
+               case BTN_BACK:
+               case BTN_EXTRA:
+               case BTN_FORWARD:
+                       return PAD_ID;
+               default:
+                       for (nkeys = 0; nkeys < usbdata->npadkeys; nkeys++)
+                       {
+                               if (event_ptr->code == 
usbdata->padkey_code[nkeys]) {
+                                       return PAD_ID;
+                               }
+                       }
+               }
+       }
+       return 0;
+}
+
 /***
  * Retrieve the tool type from an USB data packet by looking at the event
  * codes. Refer to linux/input.h for event codes that define tool types.
@@ -1618,6 +1620,10 @@ static int usbInitToolType(WacomCommonPtr common, int fd,
        if (!device_type)
                device_type = refreshDeviceType(common, fd);
 
+       if (!device_type) /* expresskey pressed at startup or missing type */
+               for (i = 0; (i < nevents) && !device_type; ++i, event_ptr++)
+                       device_type = deriveDeviceTypeFromButtonEvent(common, 
event_ptr);
+
        return device_type;
 }
 
++++++ n_01-Add-option-to-enable-logging.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Fri Feb 7 23:06:26 2014 +0100
Subject: [PATCH 1/4]Add option to enable logging
Patch-Mainline: never
Git-commit: 9717547311abfe18b7edad9e0b45f16b902e2f2d
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

This patch adds an option to set a bitmask marking events to be logged
to the Xserver log file.
Currently the list contains the following bits:
 PROXIMITY low level event  1
 PRESSURE low level event   2
 BUTTON high level event    7

Signed-off-by: Egbert Eich <e...@suse.com>
---
 configure.ac               | 11 +++++++++++
 include/wacom-properties.h |  9 +++++++++
 man/wacom.man              | 19 +++++++++++++++++++
 man/xsetwacom.man          | 19 ++++++++++++++++++-
 src/wcmCommon.c            | 35 +++++++++++++++++++++++++++++++++++
 src/wcmConfig.c            |  4 ++++
 src/wcmUSB.c               | 25 +++++++++++++++++++++++++
 src/wcmXCommand.c          | 22 +++++++++++++++++++++-
 src/xf86Wacom.h            | 22 ++++++++++++++++++++++
 src/xf86WacomDefs.h        |  4 +++-
 tools/xsetwacom.c          | 10 ++++++++++
 11 files changed, 177 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5eae74d..008a804 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,17 @@ if test "x$DEBUGGING" = xyes; then
        AC_DEFINE(DEBUG, 1, [Enable debugging code])
 fi
 
+# Define a configure option for event logging
+AC_ARG_ENABLE(logging,
+              AS_HELP_STRING([--enable-logging],
+                             [Enable logging (default: disabled)]),
+                             [LOGGING=$enableval], [LOGGING=yes])
+
+# Define the C preprocessor macro LOGGING in config.h
+if test "x$LOGGING" = xyes; then
+       AC_DEFINE(LOGGING, 1, [Enable logging code])
+fi
+
 # Define a configure option for an alternate input module directory
 AC_ARG_WITH(xorg-module-dir,
             AS_HELP_STRING([--with-xorg-module-dir=DIR],
diff --git a/include/wacom-properties.h b/include/wacom-properties.h
index b845083..f566d14 100644
--- a/include/wacom-properties.h
+++ b/include/wacom-properties.h
@@ -111,6 +111,15 @@
 */
 #define WACOM_PROP_PRESSURE_RECAL "Wacom Pressure Recalibration"
 
+/* 8 bit, values:
+  Type                       bit
+  PROXIMITY_LOW_LEVEL event  1
+  PRESSURE_LOW_LEVEL event   2
+  BUTTON_HIGH_LEVEL event    7
+  Log event of the types specified in the type mask.
+*/
+#define WACOM_PROP_LOGMASK "Wacom Log Mask"
+
 /* The following are tool types used by the driver in WACOM_PROP_TOOL_TYPE
  * or in the 'type' field for XI1 clients. Clients may check for one of
  * these types to identify tool types.
diff --git a/man/wacom.man b/man/wacom.man
index ae042f6..f699842 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -267,6 +267,25 @@ initial pressure reading may be unequal to zero even for a 
perfectly
 good pen. If the consecutive pressure readings are not higher than
 the initial pressure by a threshold no button event will be generated.
 This option allows to disable the recalibration.
+.TP 4
+.B Option \fI"LogMask" \fI"number"\fP
+bitmask that enables logging of a group of events.
+.RS
+.PD 0
+.TP
+Bit
+Event
+.TP
+0
+proximity low level
+.TP
+1
+pressure low level
+.TP
+7
+button high level
+.PD
+
 .RE
 .SH "TOUCH GESTURES"
 .SS Single finger (1FG)
diff --git a/man/xsetwacom.man b/man/xsetwacom.man
index 35ee9fe..5e42e3f 100644
--- a/man/xsetwacom.man
+++ b/man/xsetwacom.man
@@ -242,7 +242,24 @@ initial pressure reading may be unequal to zero even for a 
perfectly
 good pen. If the consecutive pressure readings are not higher than
 the initial pressure by a threshold no button event will be generated.
 This option allows to disable the recalibration.  Default:  on
-
+.TP
+\fBLogMask\fR mask
+bitmask that enables logging of a group of events.
+.RS
+.PD 0
+.TP
+Bit
+Event
+.TP
+0
+proximity low level
+.TP
+1
+pressure low level
+.TP
+7
+button high level
+.PD
 
 .SH "AUTHORS"
 Peter Hutterer <peter.hutte...@redhat.com>
diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 6abb23b..238cf78 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -27,6 +27,9 @@
 #include "wcmTouchFilter.h"
 #include <xkbsrv.h>
 #include <xf86_OSproc.h>
+#ifdef LOGGING
+#include <time.h>
+#endif
 
 /* X servers pre 1.9 didn't copy data passed into xf86Post*Event.
  * Data passed in would be modified, requiring the driver to copy the
@@ -85,6 +88,35 @@ void set_absolute(InputInfoPtr pInfo, Bool absolute)
                priv->flags &= ~ABSOLUTE_FLAG;
 }
 
+#ifdef LOGGING
+void wcm_timestr(char *str, int str_n)
+{
+       struct timespec tp;
+       struct tm tm;
+       static char wday_name[7][3] = {
+                       "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+       };
+       static char mon_name[12][3] = {
+                       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+                       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+       };
+
+       str[0] = '\0';
+       if (clock_gettime(CLOCK_REALTIME, &tp) < 0)
+               return;
+       localtime_r(&tp.tv_sec, &tm);
+
+       snprintf(str, str_n, " %.3s %.3s%3d %.2d:%.2d:%.2d.%.6d - ",
+                wday_name[tm.tm_wday],
+                mon_name[tm.tm_mon],
+                tm.tm_mday, tm.tm_hour,
+                tm.tm_min, tm.tm_sec, (int)tp.tv_nsec);
+
+       return;
+
+}
+#endif
+
 /*****************************************************************************
  * wcmMappingFactor --
  *   calculate the proper tablet to screen mapping factor according to the 
@@ -1523,6 +1555,9 @@ WacomCommonPtr wcmNewCommon(void)
        common->wcmRawSample = DEFAULT_SAMPLES;
                        /* number of raw data to be used to for filtering */
        common->wcmPressureRecalibration = 1;
+#ifdef LOGGING
+       common->LogMask = 0;
+#endif
        return common;
 }
 
diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index a8077f9..7965e13 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -637,6 +637,10 @@ static int wcmPreInit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
 
        common->debugLevel = xf86SetIntOption(pInfo->options,
                                              "CommonDBG", common->debugLevel);
+#ifdef LOGGING
+       common->LogMask = xf86SetIntOption(pInfo->options,
+                                          "LogMask", common->LogMask);
+#endif
        oldname = strdup(pInfo->name);
 
        if (wcmIsHotpluggedDevice(pInfo))
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index dca0751..e99960f 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1103,6 +1103,31 @@ static int usbIdToType(int id)
        return type;
 }
 
+#ifdef LOGGING
+/**
+ * Return type name string.
+ * @param type
+ * @return string
+ */
+static const char *usbTypeName(unsigned long type)
+{
+       switch (type) {
+       case STYLUS_ID:
+               return "PEN";
+       case ERASER_ID:
+               return "RUBBER";
+       case CURSOR_ID:
+               return "MOUSE";
+       case TOUCH_ID:
+               return "TOUCH";
+       case PAD_ID:
+               return "PAD";
+       default:
+               return "UNKNOWN";
+       }
+}
+#endif
+
 /**
  * Find the tool type (STYLUS_ID, etc.) based on the device_id.
  *
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 0ec8737..504a03a 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -100,6 +100,9 @@ Atom prop_tooltype;
 Atom prop_btnactions;
 Atom prop_product_id;
 Atom prop_pressure_recal;
+#ifdef LOGGING
+Atom prop_logmask;
+#endif
 #ifdef DEBUG
 Atom prop_debuglevels;
 #endif
@@ -317,7 +320,10 @@ void InitWcmDeviceProperties(InputInfoPtr pInfo)
        values[0] = common->vendor_id;
        values[1] = common->tablet_id;
        prop_product_id = InitWcmAtom(pInfo->dev, XI_PROP_PRODUCT_ID, 
XA_INTEGER, 32, 2, values);
-
+#ifdef LOGGING
+       values[0] = common->LogMask;
+       prop_logmask = InitWcmAtom(pInfo->dev, WACOM_PROP_LOGMASK, XA_INTEGER, 
8, 1, values);
+#endif
 #ifdef DEBUG
        values[0] = priv->debugLevel;
        values[1] = common->debugLevel;
@@ -921,6 +927,20 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
                        common->debugLevel = values[1];
                }
 #endif
+#ifdef LOGGING
+       } else if (property == prop_logmask) {
+               CARD8 *values;
+
+               if (prop->size != 1 || prop->format != 8)
+                       return BadMatch;
+
+               values = (CARD8*)prop->data;
+
+               if (!checkonly)
+               {
+                       common->LogMask = values[0];
+               }
+#endif
        } else if (property == prop_btnactions)
        {
                int nbuttons = priv->nbuttons < 4 ? priv->nbuttons : 
priv->nbuttons + 4;
diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
index 6872108..9bbee03 100644
--- a/src/xf86Wacom.h
+++ b/src/xf86Wacom.h
@@ -68,6 +68,28 @@
 #define DBG(lvl, priv, ...)
 #endif
 
+#ifdef LOG
+#undef LOG
+#endif
+#ifdef LOGGING
+void wcm_timestr(char *str, int str_n);
+#define DO_LOG(m, v) (m->LogMask & v)
+#define LOG(m, v, f, ...) do {                 \
+       if (DO_LOG(m, v)) { \
+               char tstr[30]; \
+               wcm_timestr(tstr, sizeof(tstr));        \
+               LogMessageVerbSigSafe(X_NONE, -1, "[LOG]%s " f, tstr, 
__VA_ARGS__); \
+       } \
+} while (0)
+#define LOG_PROXIMITY_LOW 1 << 0
+#define LOG_PRESSURE_LOW  1 << 1
+#define LOG_BUTTON_HIGH   1 << 7
+#else
+#define DO_LOG(m, v) (0)
+#define LOG(m, v, f, ...) do {                 \
+       } while (0)
+#endif
+
 /******************************************************************************
  * WacomModule - all globals are packed in a single structure to keep the
  *               global namespaces as clean as possible.
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 476d94d..0dc1d42 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -493,7 +493,9 @@ struct _WacomCommonRec
        int wcmRawSample;            /* Number of raw data used to filter an 
event */
        int wcmPressureRecalibration; /* Determine if pressure recalibration of
                                         worn pens should be performed */
-
+#ifdef LOGGING
+       int LogMask;                 /* Mask to determine which event types to 
log. */
+#endif
        int bufpos;                        /* position with buffer */
        unsigned char buffer[BUFFER_SIZE]; /* data read from device */
 
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 508326e..aace755 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -152,6 +152,16 @@ static param_t parameters[] =
                .arg_count = 1,
        },
        {
+               .name = "LogMask",
+               .desc = "Mask whose bits determine which events to log: "
+               "0  PROXIMITY event, 1  BUTTON event, 2  MOTION event, "
+               "3  PRESSURE event",
+               .prop_name = WACOM_PROP_LOGMASK,
+               .prop_format = 8,
+               .prop_offset = 0,
+               .arg_count = 1,
+       },
+       {
                .name = "Suppress",
                .desc = "Number of points trimmed (default is 2). ",
                .prop_name = WACOM_PROP_SAMPLE,
++++++ n_02-Log-PROXIMITY-LOW-LEVEL-events.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Sun Feb 16 09:30:42 2014 +0100
Subject: [PATCH 2/4]Log PROXIMITY LOW LEVEL events
Patch-Mainline: never
Git-commit: df73852a08ab8b8ab3c2b04b7dea8386cceb64eb
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

Signed-off-by: Egbert Eich <e...@suse.com>
---
 src/wcmUSB.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index e99960f..f0f8011 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -512,6 +512,8 @@ static void usbWcmInitPadState(InputInfoPtr pInfo)
        ds->device_type = PAD_ID;
        ds->device_id = PAD_DEVICE_ID;
        ds->serial_num = channel;
+       LOG(common, LOG_PROXIMITY_LOW, "Proximity in for %s PAD serial -1\n",
+           pInfo->name);
 }
 
 int usbWcmGetRanges(InputInfoPtr pInfo)
@@ -1678,6 +1680,7 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        int channel;
        wcmUSBData* private = common->private;
        WacomDeviceState dslast = 
common->wcmChannel[private->lastChannel].valid.state;
+       int log_proximity;
 
        DBG(6, common, "%d events received\n", private->wcmEventCnt);
 
@@ -1725,6 +1728,7 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
 
        ds = &common->wcmChannel[channel].work;
        dslast = common->wcmChannel[channel].valid.state;
+       log_proximity = ds->proximity;
 
        if (ds->device_type && ds->device_type != private->wcmDeviceType)
                LogMessageVerbSigSafe(X_ERROR, 0,
@@ -1739,10 +1743,16 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
        /* all USB data operates from previous context except relative values*/
        ds->relwheel = 0;
        ds->serial_num = private->wcmLastToolSerial;
+       if (log_proximity != ds->proximity)
+               LOG(common, LOG_PROXIMITY_LOW, "Proximity in for %s %s serial 
%d\n",
+                   pInfo->name,
+                   usbTypeName(ds->device_type),
+                   private->wcmLastToolSerial);
 
        /* loop through all events in group */
        for (i=0; i<private->wcmEventCnt; ++i)
        {
+               log_proximity = ds->proximity;
                event = private->wcmEvents + i;
                DBG(11, common,
                        "event[%d]->type=%d code=%d value=%d\n",
@@ -1795,6 +1805,12 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
                        usbParseKeyEvent(common, event, channel);
                        usbParseBTNEvent(common, event, btn_channel);
                }
+               if (log_proximity != ds->proximity)
+                       LOG(common, LOG_PROXIMITY_LOW, "Proximity %s for %s %s 
serial %d\n",
+                           ds->proximity ? "in" : "out",
+                           pInfo->name,
+                           usbTypeName(ds->device_type),
+                           private->wcmLastToolSerial);
        } /* next event */
 
        /* DTF720 and DTF720a don't support eraser */
++++++ n_03-Log-PRESSURE-low-level-events.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Sun Feb 16 09:31:05 2014 +0100
Subject: [PATCH 3/4]Log PRESSURE low level events
Patch-Mainline: never
Git-commit: 9e575b396f7cbbe5cecd455d1f54a8a0d6c658d1
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

Signed-off-by: Egbert Eich <e...@suse.com>
---
 src/wcmCommon.c | 8 ++++++--
 src/wcmUSB.c    | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 238cf78..6df2133 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -1188,9 +1188,13 @@ static void detectPressureIssue(WacomDevicePtr priv,
                                "\tThis indicates a worn out pen, it is time to 
change your tool. Also see:\n"
                                
"\thttp://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Pen_Wear.\n";,
                                priv->pInfo->name, priv->serial, 
priv->minPressure, LIMIT_LOW_PRESSURE, common->wcmMaxZ);
-       } else if (!priv->oldProximity)
+       } else if (!priv->oldProximity) {
+               if (priv->minPressure)
+                       LOG(common, LOG_PRESSURE_LOW,
+                           "WARN: %s(%u) initial pressure %d > 0\n",
+                           priv->pInfo->name, priv->serial, ds->pressure);
                priv->eventCnt = 0;
-
+       }
        priv->oldMinPressure = priv->minPressure;
        priv->eventCnt++;
 }
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index f0f8011..24477b2 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1193,6 +1193,8 @@ static void usbParseAbsEvent(WacomCommonPtr common,
                        break;
                case ABS_PRESSURE:
                        ds->pressure = event->value;
+                       LOG(common, LOG_PRESSURE_LOW, "Device %d got pressure 
%d\n",
+                           ((wcmUSBData 
*)(common->private))->wcmLastToolSerial, ds->pressure);
                        break;
                case ABS_DISTANCE:
                        ds->distance = event->value;
@@ -1292,6 +1294,8 @@ static void usbParseAbsMTEvent(WacomCommonPtr common, 
struct input_event *event)
 
                case ABS_MT_PRESSURE:
                        ds->pressure = event->value;
+                       LOG(common, LOG_PRESSURE_LOW, "Device %d got pressure 
%d\n",
+                           ((wcmUSBData 
*)(common->private))->wcmLastToolSerial, ds->pressure);
                        break;
 
                default:
++++++ n_04-Log-BUTTON-HIGH-LEVEL-events.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Tue Feb 11 12:51:32 2014 +0100
Subject: [PATCH 4/4]Log BUTTON HIGH LEVEL events
Patch-Mainline: never
Git-commit: 128d0302b04fb71b9d652a99fd0ad9b780374f44
Git-repo: 
git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom
References: FATE#
Signed-off-by: Egbert Eich <e...@suse.com>

Signed-off-by: Egbert Eich <e...@suse.com>
---
 src/wcmCommon.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index 6df2133..68ee6e2 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -316,9 +316,17 @@ static void sendAButton(InputInfoPtr pInfo, int button, 
int mask,
 #ifdef DEBUG
        WacomCommonPtr common = priv->common;
 #endif
-
-       DBG(4, priv, "TPCButton(%s) button=%d state=%d\n",
-           common->wcmTPCButton ? "on" : "off", button, mask);
+       if (DO_LOG(common, LOG_BUTTON_HIGH)) {
+               int x = (first_val == 0 && num_val >= 1) ?
+                       (int)((double)valuators[0] * priv->factorX) : -1;
+               int y = (first_val <= 1 && first_val + num_val > 1) ?
+                       (int)((double)(valuators[1 - first_val]) * 
priv->factorY) : -1;
+               LOG(common, LOG_BUTTON_HIGH,
+                   "TPCButton(%s) button=%d state=%d x=%d y=%d\n",
+                   common->wcmTPCButton ? "on" : "off", button, mask, x, y);
+       } else
+               DBG(4, priv, "TPCButton(%s) button=%d state=%d\n",
+                   common->wcmTPCButton ? "on" : "off", button, mask);
 
        if (!priv->keys[button][0])
                return;
++++++ xf86-input-wacom-0.23.0.tar.bz2 -> xf86-input-wacom-0.24.0.tar.bz2 ++++++
++++ 7273 lines of diff (skipped)

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to