Resolution is added to input_absinfo in kernel 2.6.30. Let's
Retrieve it directly from there if available.

Signed-off-by: Ping Cheng <pingli...@gmail.com>
---
 src/wcmUSB.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index d8e8312..c76e24d 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -27,6 +27,9 @@
 #include <asm/types.h>
 #include <linux/input.h>
 #include <sys/utsname.h>
+# ifndef LINUX_VERSION_CODE
+# include <linux/version.h>
+# endif
 
 #define MAX_USB_EVENTS 32
 
@@ -465,6 +468,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
        else
                common->wcmMaxTouchX = absinfo.maximum;
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)
+       if (is_touch && absinfo.resolution)
+               common->wcmTouchResolX = absinfo.resolution * 1000;
+#endif
+
        /* max y */
        if (ioctl(pInfo->fd, EVIOCGABS(ABS_Y), &absinfo) < 0)
        {
@@ -482,6 +490,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
        else
                common->wcmMaxTouchY = absinfo.maximum;
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)
+       if (is_touch && absinfo.resolution)
+               common->wcmTouchResolY = absinfo.resolution * 1000;
+#endif
+
        /* max finger strip X for tablets with Expresskeys
         * or physical X for touch device in thousandth cm */
        if (ioctl(pInfo->fd, EVIOCGABS(ABS_RX), &absinfo) == 0)
-- 
1.7.3.4


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to