Re: [Linuxwacom-devel] [PATCH 5/6] Search for more potential key and cert locations

2019-04-09 Thread Ping Cheng
On Tue, Apr 9, 2019 at 3:17 PM Gerecke, Jason  wrote:

> From: Jason Gerecke 
>
> Previously we would only automatically discover Ubuntu's shim MOK if one
> had been created. We now also try to use the kernel's autogenerated key
> if present, and the key generated by rEFInd (though this may be inside
> a directory that only root can read from).


Does this mean we should prompt users to compile input-wacom under root?

It’s quite a lot of work. Thank you for your effort, Jason!

Acked-by: Ping Cheng  for the whole set.

Cheers,
Ping


>
> Signed-off-by: Jason Gerecke 
> ---
>  configure.ac | 52 
>  1 file changed, 32 insertions(+), 20 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index fa88ade..5353705 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -248,6 +248,25 @@ dnl
> ===
>  dnl Module signing
>  AC_DEFUN([WACOM_LINUX_READ_CONFIG], [grep -sh '^$1='
> $WCM_KERNEL_DIR/.config /boot/config-$MODUTS | head -n1 | cut -d= -f2- |
> sed -e 's/^"\(.*\)"$/\1/'])
>
> +AC_DEFUN([WACOM_LINUX_FILE_IF_EXISTS], [test -f "$1" && readlink -e "$1"])
> +
> +AC_DEFUN([WACOM_LINUX_CHECK_KEYCERT],
> +if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then
> +   AC_MSG_CHECKING(for $1 key at $2)
> +   KEYFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$2]))
> +   RESULT=$(test -z "$KEYFILE" && echo "no" || echo "yes")
> +   AC_MSG_RESULT([$RESULT])
> +   AC_MSG_CHECKING(for $1 cert at $3)
> +   CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$3]))
> +   RESULT=$(test -z "$CERTFILE" && echo "no" || echo "yes")
> +   AC_MSG_RESULT([$RESULT])
> +   if test -n "$KEYFILE" -a -n "$CERTFILE"; then
> +   MODSIGN_PRIVFILE="$KEYFILE"
> +   MODSIGN_CERTFILE="$CERTFILE";
> +   fi
> +fi)
> +
> +
>  MODSIGN_ENABLE=default
>  MODSIGN_HASHALGO=
>  MODSIGN_PRIVFILE=
> @@ -290,20 +309,6 @@ if test "$MODSIGN_ENABLE" = "yes" -o
> "$MODSIGN_ENABLE" = "default"; then
>
>
>
> -   # There is no standard location for storing kernel signing keys
> -   # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY
> -   # (which contains a key and cert) which likely points to a file
> -   # that doesn't exist unless you built the kernel yourself. Most
> -   # distributions use the "shim" bootloader which allows "machine
> -   # owner keys" (MOK) to be enrolled by the end-user, but only
> -   # Ubuntu provides a tool to automatically generate these keys
> -   # (`update-secureboot-policy --new-key`); other distros rely on
> -   # the user generating the key/cert themselves and keeping it in a
> -   # suitably-safe location.
> -   #
> -   # The kernel should automatically try to sign modules as part of
> -   # the `make modules_install` step, so that covers the first case.
> -   # In the second case the best we can do is try Ubuntu's location.
> AC_ARG_WITH(signing-key,
> AS_HELP_STRING([--with-signing-key=],
> [Specify module signing key location]),
> [MODSIGN_PRIVFILE="$withval"])
> @@ -311,12 +316,19 @@ if test "$MODSIGN_ENABLE" = "yes" -o
> "$MODSIGN_ENABLE" = "default"; then
> AS_HELP_STRING([--with-signing-cert=],
> [Specify module signing cert location]),
> [MODSIGN_CERTFILE="$withval"])
>
> -   if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then
> -   MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv
> 2>/dev/null || echo "$MODSIGN_PRIVFILE")
> -   fi
> -   if test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE"; then
> -   MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der
> 2>/dev/null || echo "$MODSIGN_CERTFILE")
> -   fi
> +   HASPRIVFILE=$(test "$MODSIGN_PRIVFILE" = "yes" -o -z
> "$MODSIGN_PRIVFILE" && echo 0 || echo 1)
> +   HASCERTFILE=$(test "$MODSIGN_CERTFILE" = "yes" -o -z
> "$MODSIGN_CERTFILE" && echo 0 || echo 1)
> +   if test "$HASPRIVFILE" -ne "$HASCERTFILE"; then
> +   AC_MSG_ERROR([Options '--with-signing-key' and
> '--with-signing-cert' must either both be set or both be unset.])
> + 

[Linuxwacom-devel] [PATCH] 2.6.32 RHEL: Add out of tree support for RHEL 6.10

2018-12-12 Thread Ping Cheng
Make those devices not supported by RHEL 6.10 into wacom-ot.ko so
both drivers can live happily together ;).

Signed-off-by: Ping Cheng 
---
 2.6.32/Makefile.in | 17 -
 2.6.32/wacom_sys.c |  7 ++-
 2.6.32/wacom_wac.c | 18 ++
 configure.ac   | 12 
 4 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in
index 6290771..4a331d6 100644
--- a/2.6.32/Makefile.in
+++ b/2.6.32/Makefile.in
@@ -4,11 +4,19 @@ ifneq ($(KERNELRELEASE),)
 # Do NOT indent stuff in this part! It has to be like this to make the
 # $(error ... ) stuff work
 
+RHEL6_RELEASE := @RHEL6_RELEASE@
+WCM_OT_NAME := ""
+
 ifneq ($(CONFIG_USB_WACOM),y)
 WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen)
-ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra 
-Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS)
-wacom-objs := wacom_wac.o wacom_sys.o
-obj-m += wacom.o
+   ifeq ($(RHEL6_RELEASE),10)
+   WCM_OT_NAME := -ot
+   ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra 
-Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) 
-DRHEL6_RELEASE
+   else
+   ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra 
-Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS)
+   endif # RHEL6_RELEASE
+wacom$(WCM_OT_NAME)-objs := wacom_wac.o wacom_sys.o
+obj-m += wacom$(WCM_OT_NAME).o
 obj-m += wacom_w8001.o
 else
 $(error You requested to build wacom with configure, but wacom is configured 
as built-in in your kernel config)
@@ -48,8 +56,7 @@ uninstall:
@# which causes trouble for tools like 'rm' which don't
@# see the path how you might think. As a workaround,
@# first cd into the directory and then remove.
-   cd $(WCM_KERNEL_DIR)/../extra; rm wacom.ko*
-   cd $(WCM_KERNEL_DIR)/../extra; rm wacom_w8001.ko*
+   cd $(WCM_KERNEL_DIR)/../extra; rm wacom*.ko*
rm -f /etc/depmod.d/input-wacom.conf
PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS)
 
diff --git a/2.6.32/wacom_sys.c b/2.6.32/wacom_sys.c
index 5ca4c61..4a1fb70 100644
--- a/2.6.32/wacom_sys.c
+++ b/2.6.32/wacom_sys.c
@@ -39,6 +39,11 @@
 #define HID_COLLECTION_END 0xc0
 #define HID_LONGITEM   0xfc
 
+#ifdef RHEL6_RELEASE
+#define wacom_driver_name "wacom-ot"
+#else
+#define wacom_driver_name "wacom"
+#endif
 
 enum {
WCM_UNDEFINED = 0,
@@ -1088,7 +1093,7 @@ static int wacom_reset_resume(struct usb_interface *intf)
 }
 
 static struct usb_driver wacom_driver = {
-   .name = "wacom",
+   .name = wacom_driver_name,
.id_table = wacom_ids,
.probe =wacom_probe,
.disconnect =   wacom_disconnect,
diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c
index c4705f8..9a5fe39 100644
--- a/2.6.32/wacom_wac.c
+++ b/2.6.32/wacom_wac.c
@@ -2484,6 +2484,7 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
wacom_setup_numbered_buttons(input_dev, numbered_buttons);
 }
 
+#ifndef RHEL6_RELEASE
 static const struct wacom_features wacom_features_0x00 =
{ "Wacom Penpartner", WACOM_PKGLEN_PENPRTN,5040, 3780, 255, 0,
  PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
@@ -2950,10 +2951,10 @@ static const struct wacom_features wacom_features_0x343 
=
  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
 static const struct wacom_features wacom_features_0x34A =
{ "Wacom MobileStudio Pro 13 Touch", WACOM_PKGLEN_MSPROT, .type = 
WACOM_MSPROT, /* Touch */
- .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D };
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D, .touch_max = 10 };
 static const struct wacom_features wacom_features_0x34B =
{ "Wacom MobileStudio Pro 16 Touch", WACOM_PKGLEN_MSPROT, .type = 
WACOM_MSPROT, /* Touch */
- .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E };
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E, .touch_max = 10 };
 static const struct wacom_features wacom_features_0x34D =
{ "Wacom MobileStudio Pro 13", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 
63,
  WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11,
@@ -2966,6 +2967,7 @@ static const struct wacom_features wacom_features_0x34E =
  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34B };
+#endif /* Wacom Out-of-tree check */
 static const struct wacom_features wacom_features_0x34F =
{ "Wacom Cintiq Pro 13 FHD", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63,
  WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
@@ -2992,10 +2994,10 @@ static const struct wacom_features wacom_features_0x352 
=
  .oVid 

Re: [Linuxwacom-devel] [PATCH input-wacom] Add support for kernel module signing and enforcement

2018-11-30 Thread Ping Cheng
Looks like a good workaround!

Acked-by: Ping Cheng 

I assume you had someone tested the patch for you. Can you get a test-by
from them?

Thank you for your effor.
Ping

On Fri, Nov 30, 2018 at 10:38 AM Jason Gerecke  wrote:

> It is becoming more common for systems to only allow signed kernel modules
> to be loaded (e.g. because the kernel is in "lockdown mode" due to secure
> boot policies). Users who follow the standard configure / make / install
> process find that the driver does not work after rebooting and often don't
> know what is wrong.
>
> This commit teaches the configure script and Makefiles a few new tricks:
>
>   * Detection of when module signing is required by the system
>   * Detection of existing key and cert used for module signing (Ubuntu
> only)
>   * Ability to manually specify key, cert, and hash algorithm to be
> used for module signing
>   * Abort configure if signing is required but not possible
>   * New makefile target to add the signature prior to installing
>
> Module signing is opportunistic by default. If a key and cert can be
> found (or are provided to the configure script), the modules will be
> signed -- even if not otherwise required. If a key and cert aren't
> available then we will try to build an unsigned driver instead. If
> the system is set up to require signed modules, we will cowardly
> error out of the configure script unless the user explicitly requests
> the driver to be left unsigned.
>
> A phony "signature" Makefile target is provided which is called by
> `make install` and which is available for developers who want/need
> to sign the module without actually installing it. Users can use
> `make && sudo make install` while developers can use `make && sudo
> make signature`. If module signing is disabled the "signature"
> target does nothing.
> ---
>  2.6.32/Makefile.in | 12 +-
>  2.6.38/Makefile.in | 12 +-
>  3.17/Makefile.in   | 12 +-
>  3.7/Makefile.in| 12 +-
>  4.5/Makefile.in| 12 +-
>  configure.ac   | 96 ++
>  6 files changed, 151 insertions(+), 5 deletions(-)
>
> diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in
> index 38876be..6290771 100644
> --- a/2.6.32/Makefile.in
> +++ b/2.6.32/Makefile.in
> @@ -20,6 +20,9 @@ PWD  := $(shell pwd)
>  WCM_KERNEL_DIR := @WCM_KERNEL_DIR@
>  MODUTS := @MODUTS@
>  WCM_KERNEL_VER := @WCM_KERNEL_VER@
> +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@
> +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@
> +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@
>
>  all:
> @echo 'Building input-wacom drivers for $(WCM_KERNEL_VER)
> kernel.'
> @@ -28,7 +31,13 @@ all:
>  clean:
> $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean
>
> -install modules_install:
> +signature: all
> +   if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n
> "$(MODSIGN_CERTFILE)"; then \
> +   $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)"
> "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \
> +   $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)"
> "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \
> +   fi
> +
> +install modules_install: signature
> $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install
> mkdir -p /etc/depmod.d
> echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf
> @@ -59,5 +68,6 @@ distdir:
>
>  EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info
>  EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags
> ctags mostlyclean maintainer-clean
> +EMPTY_AUTOMAKE_TARGETS += signature
>  .PHONY: $(EMPTY_AUTOMAKE_TARGETS)
> $(EMPTY_AUTOMAKE_TARGETS):
> diff --git a/2.6.38/Makefile.in b/2.6.38/Makefile.in
> index da131dc..4779420 100644
> --- a/2.6.38/Makefile.in
> +++ b/2.6.38/Makefile.in
> @@ -20,6 +20,9 @@ PWD  := $(shell pwd)
>  WCM_KERNEL_DIR := @WCM_KERNEL_DIR@
>  MODUTS := @MODUTS@
>  WCM_KERNEL_VER := @WCM_KERNEL_VER@
> +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@
> +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@
> +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@
>
>  all:
> @echo 'Building input-wacom drivers for $(WCM_KERNEL_VER)
> kernel.'
> @@ -28,7 +31,13 @@ all:
>  clean:
> $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean
>
> -install modules_install:
> +signature: all
> +   if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n
> "$(MODSIGN_CERTFILE)"; then \
> +   $(WCM_KERNEL_DIR)/scripts/sign-file "

Re: [Linuxwacom-devel] [PATCH 1/4] Correct two comments

2018-10-24 Thread Ping Cheng
On Tue, Oct 23, 2018 at 7:48 PM Peter Hutterer 
wrote:

> Signed-off-by: Peter Hutterer 


Patchset looks good. The whole set is:

Reviewed-by: Ping Cheng 

Thank you Peter!

Ping

>
> ---
>  src/wcmUSB.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 8ded958..8a07368 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -980,9 +980,7 @@ static void usbParseEvent(InputInfoPtr pInfo,
>
> DBG(10, common, "\n");
>
> -   /* store events until we receive the MSC_SERIAL containing
> -* the serial number or a SYN_REPORT.
> -*/
> +   /* store events until we receive a SYN_REPORT */
>
> /* space left? bail if not. */
> if (private->wcmEventCnt >= ARRAY_SIZE(private->wcmEvents))
> @@ -1036,7 +1034,7 @@ static void usbParseSynEvent(InputInfoPtr pInfo,
> }
> else
> {
> -   /* not an SYN_REPORT and not an SYN_REPORT, bail out */
> +   /* not a MSC_SERIAL and not a SYN_REPORT, bail out */
> return;
> }
>
> --
> 2.19.1
>
>
>
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Support DTU-1141B on older kernels

2018-09-28 Thread Ping Cheng
Signed-off-by: Ping Cheng 
---
 src/wcmValidateDevice.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 95c8a2c..cf4edf9 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -332,6 +332,7 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
case 0x354:/* Cintiq Pro 13 UHD Touch */
case 0x355:/* Cintiq Pro 24 Touch */
case 0x356:/* Cintiq Pro 32 Touch */
+   case 0x359:/* DTU-1141B */
case 0x35A:/* DTH-1152*/
case 0x368:/* DTH-1152 Touch */
case 0x382:/* DTK-2451 */
-- 
2.7.4



___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Support DTU-1141B in the 3.7, 2.6.38, and 2.6.30 branches

2018-09-28 Thread Ping Cheng
Signed-off-by: Ping Cheng 
---
 2.6.32/wacom_wac.c | 31 ++-
 2.6.32/wacom_wac.h |  1 +
 2.6.38/wacom_wac.c | 31 ++-
 2.6.38/wacom_wac.h |  1 +
 3.7/wacom_wac.c| 31 ++-
 3.7/wacom_wac.h|  1 +
 6 files changed, 81 insertions(+), 15 deletions(-)

diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c
index c29c75c..c4705f8 100644
--- a/2.6.32/wacom_wac.c
+++ b/2.6.32/wacom_wac.c
@@ -303,6 +303,20 @@ static int wacom_dth1152_irq(struct wacom_wac *wacom)
unsigned short prox, pressure = 0;
 
if (data[0] != WACOM_REPORT_DTUS) {
+   if (data[0] == WACOM_REPORT_DTUSPAD) {
+   input_report_key(input, BTN_0, (data[1] & 0x01));
+   input_report_key(input, BTN_1, (data[1] & 0x02));
+   input_report_key(input, BTN_2, (data[1] & 0x04));
+   input_report_key(input, BTN_3, (data[1] & 0x08));
+   input_report_abs(input, ABS_MISC,
+data[1] & 0x0f ? PAD_DEVICE_ID : 0);
+   /*
+* Serial number is required when expresskeys are
+* reported through pen interface.
+*/
+   input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
+   return 1;
+   }
dev_dbg(input->dev.parent,
"%s: received unknown report #%d", __func__, data[0]);
return 0;
@@ -1896,6 +1910,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
sync = wacom_dtus_irq(wacom_wac);
break;
 
+   case DTUS2:
case DTH1152:
sync = wacom_dth1152_irq(wacom_wac);
break;
@@ -2382,14 +2397,16 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
/* fall through */
 
case DTUS:
-   case DTUSX:
+   case DTUS2:
case DTK2451:
+   input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
+
+   case DTUSX:
case PL:
case DTU:
-   __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
-   __set_bit(BTN_STYLUS2, input_dev->keybit);
-   if (features->type == DTUS || features->type == DTK2451) {
-   input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
+   if (features->type != DTUS2) {
+   __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
+   __set_bit(BTN_STYLUS2, input_dev->keybit);
}
/* fall through */
 
@@ -2991,6 +3008,9 @@ static const struct wacom_features wacom_features_0x357 =
 static const struct wacom_features wacom_features_0x358 =
{ "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191, 63,
  INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
+static const struct wacom_features wacom_features_0x359 =
+   { "Wacom DTU-1141B", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
+ DTUS2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
 static const struct wacom_features wacom_features_0x35A =
{ "Wacom DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
  DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
@@ -3205,6 +3225,7 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x356) },
{ USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
+   { USB_DEVICE_WACOM(0x359) },
{ USB_DEVICE_WACOM(0x35A) },
{ USB_DEVICE_WACOM(0x368) },
{ USB_DEVICE_WACOM(0x374) },
diff --git a/2.6.32/wacom_wac.h b/2.6.32/wacom_wac.h
index bdefbc1..56dcea3 100755
--- a/2.6.32/wacom_wac.h
+++ b/2.6.32/wacom_wac.h
@@ -92,6 +92,7 @@ enum {
PL,
DTU,
DTUS,
+   DTUS2,
DTUSX,
DTH1152,
DTK2451,
diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index ebff932..2e090cf 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -339,6 +339,20 @@ static int wacom_dth1152_irq(struct wacom_wac *wacom)
unsigned short prox, pressure = 0;
 
if (data[0] != WACOM_REPORT_DTUS) {
+   if (data[0] == WACOM_REPORT_DTUSPAD) {
+   input_report_key(input, BTN_0, (data[1] & 0x01));
+   input_report_key(input, BTN_1, (data[1] & 0x02));
+   input_report_key(input, BTN_2, (data[1] & 0x04));
+   input_report_key(input, BTN_3, (data[1] & 0x08));
+   input_report_abs(input, ABS_MISC,
+data[1] & 0x0f ? PAD_DEVICE_ID : 0);
+   /*
+* 

Re: [Linuxwacom-devel] [PATCH 3/3] Overhaul calculation of default scroll, zoom, and spread distances

2018-08-27 Thread Ping Cheng
On Tue, Aug 21, 2018 at 10:34 AM Jason Gerecke  wrote:

> The default values for zoom, scroll, and spread distances were originally
> fine-tuned for use with a 3rd-gen Bamboo small tablet (e.g. CTH-470). The
> code tries to scale these values to work with other sensors, but there are
> a couple of problems with the actual logic:
>
> 1. The scaling is done based on the logical size of the tablet. This is
> problematic for some generations of tablet (including the 3rd-gen Bamboos)
> which use sensors with an identical logical size despite different physical
> size. This means that larger tablets in these generations require larger
> gestures to accomplish the same task.
>
> 2. The scale factor for the scroll distance is calculated with respect to
> the X axis, even though it is far more common to scroll vertically than
> horizontally. For devices with a different resolution in the X and Y axes,
> this means that calculated default won't be consistent with devices that
> have the same resolution in both the X and Y axes.
>
> This patch makes several modifications to simultaneously address all
> of the issues. We replace the logical Bamboo-referenced numbers with
> equivalent millimeters, calculate the logical distances based on the
> kernel-reported resolution (using the resolution of the Bamboo if not
> not available), and specifically scale scroll distances with respect
> to the Y axis.
>
> The end result is a scroll and zoom feel that is consistent across many
> more devices. No longer do you have to make physically-larger gestures
> on physically-larger tablets, or physically-smaller gestures on tablets
> with higher logical resolution.
>

Patchset looks good to me. Thank you for making some of our loyal users
happy :). With libinput coming to the foreground, hope we don't need to
worry about gestures in the driver anymore! The whole set is:

Ref: https://github.com/linuxwacom/input-wacom/issues/33
> Signed-off-by: Jason Gerecke 
>

Reviewed-by: Ping Cheng 

Cheers,
Ping

---
>  src/wcmValidateDevice.c | 23 ---
>  1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 95c8a2c..7b7bff2 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -1044,11 +1044,12 @@ error:
> return FALSE;
>  }
>
> -/* The values were based on trail and error. */
> -#define WCM_BAMBOO3_MAXX 4096.0
> -#define WCM_BAMBOO3_ZOOM_DISTANCE 180.0
> -#define WCM_BAMBOO3_SCROLL_DISTANCE 80.0
> -#define WCM_BAMBOO3_SCROLL_SPREAD_DISTANCE 350.0
> +/* The values were based on trial and error with a 3rd-gen Bamboo */
> +#define WCM_DEFAULT_MM_XRES   (27.8 * 1000)
> +#define WCM_DEFAULT_MM_YRES   (44.5 * 1000)
> +#define WCM_ZOOM_DISTANCE_MM  6.5
> +#define WCM_SCROLL_DISTANCE_MM1.8
> +#define WCM_SCROLL_SPREAD_DISTANCE_MM 12.6
>
>  /**
>   * Parse post-init options for this device. Useful for overriding HW
> @@ -1075,10 +1076,11 @@ Bool wcmPostInitParseOptions(InputInfoPtr pInfo,
> Bool is_primary,
> /* 2FG touch device */
> if (TabletHasFeature(common, WCM_2FGT) && IsTouch(priv))
> {
> -   int zoom_distance = common->wcmMaxTouchX *
> -   (WCM_BAMBOO3_ZOOM_DISTANCE / WCM_BAMBOO3_MAXX);
> -   int scroll_distance = common->wcmMaxTouchX *
> -   (WCM_BAMBOO3_SCROLL_DISTANCE / WCM_BAMBOO3_MAXX);
> +   int x_res = common->wcmTouchResolX ?
> common->wcmTouchResolX : WCM_DEFAULT_MM_XRES;
> +   int y_res = common->wcmTouchResolY ?
> common->wcmTouchResolY : WCM_DEFAULT_MM_YRES;
> +   int zoom_distance = WCM_ZOOM_DISTANCE_MM * x_res / 1000;
> +   int scroll_distance = WCM_SCROLL_DISTANCE_MM * y_res /
> 1000;
> +   int spread_distance = WCM_SCROLL_SPREAD_DISTANCE_MM *
> x_res / 1000;
>
> common->wcmGestureParameters.wcmZoomDistance =
> xf86SetIntOption(pInfo->options, "ZoomDistance",
> @@ -1089,8 +1091,7 @@ Bool wcmPostInitParseOptions(InputInfoPtr pInfo,
> Bool is_primary,
>  scroll_distance);
>
> common->wcmGestureParameters.wcmMaxScrollFingerSpread =
> -   common->wcmMaxTouchX *
> -   (WCM_BAMBOO3_SCROLL_SPREAD_DISTANCE /
> WCM_BAMBOO3_MAXX);
> +   spread_distance;
> }
>
>
> --
> 2.18.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom] backport: restore touch functionality to SW_MUTE_DEVICE devices

2018-04-24 Thread Ping Cheng
On Mon, Apr 23, 2018 at 4:37 PM Peter Hutterer 
wrote:

> On Mon, Apr 23, 2018 at 12:44:51PM -0700, Aaron Armstrong Skomra wrote:
> > Setting the bit for SW_MUTE_DEVICE on kernels which do not have
> > SW_MUTE_DEVICE declared in input.h (prior to 3.13), causes these
> > devices' touch interfaces not to work.
>
> Why is that? is that switch always enabled or something? because if it's
> always on 0, no-one in userspace should care. This seems like a separate
> issue somewhere.


The switch can be enabled/disabled by some devices. So, if it is set, its
value could be 1.

> Fixes: 7d13c26dd972 ("Backport support for the touch on/off switch").
> > Signed-off-by: Aaron Armstrong Skomra
> > ---
> > 1. Does INTUOSHT have a touch switch?


Yes, INTUOSHT has a hard touch switch.

Maybe the check for
> > BTN_TOOL_DOUBLETAP excludes INTUOSHT right after we catch its case.


Have to look into the details...

>
> > 2. Does TABLETPC somehow need this commit to disable touch? I don't think
> > it could be using this non-existant constant, but I don't know which
> > devices TABLETPC applies to etc.


No TPC devices have touch switch.

On the Intuos Pro 2 and Intuos (CTH-680)
> > this switch is purely the reporting of the switch (the hardware disables
> > the touch) so removing our attempt at reporting the switch is of minor
> > consequence.
>
> with my "i don't follow input-wacom that closely" hat on:
> TABLETPC are the devices built into laptops. Google Bill Gates presenting a
> tablet pc, that's how far they go back. They have styli that only activate
> on press, with no proximity, etc. But they don't have the MUTE switch, that
> one was added for the 24QHD (or so?) to represent the physical hw switch.


Touch switch was first added to INTUOSHT.


> 3. Why was SW_MUTE_DEVICE orignally backported? My guess was that it was
> > to remove differences between each of our kernel directories. But it
> could


I feel it is just to sync with upstream code. Is that right Jason?

> be for some other reason that I don't know of, in that case I will be
> > missing something here.
> >
> > 4. My guess is that SW_MUTE_DEVICE is supported in RHEL 7 (this bug was
> > found on RHEL 6) and that this code was tested against it, which is why
> we
> > didn't catch this. ie RHEL probably added SW_MUTE_DEVICE to their kernel.
>
> yep, looks like it was backported to the RHEL7.x kernel at some point but I


SW_MUTE_DEVICE is in RHEL 7 doesn’t mean other kernels older than 3.13
backported it. We have to support those vanilla kernels. Looks like we may
have to test more kernels and probably treat RHEL7 differently.
.

> don't have the exact version on-hand. We tend to backport the professional
> tablets so it was likely part of the 24QHD or whichever device needed that
> one.


Intuos Pro 2 is the first professional tablet that has a hardware touch
switch.

Cheers,
Ping

> It could also be that later input subsystems fail more gracefully when
> > they recieve a "__set_bit" that they are unfamiliar with, I'm not sure if
> > we want to find supported vanilla versions of these older kernels to test
> > against.  Also, I have no idea how to check RHEL 7 source or if that's
> > possible. If necessary we can either revise this commit to check for RHEL
> > 7 or come back and do that at a later date for this event which again is
> > of minor importance.
>
> The official way if you don't have a RHEL install
> is https://git.centos.org/project/rpms
> yes, that's a CentOS link, for more backstory see:
> https://lwn.net/Articles/603865/
>
> The kernel is here:
> https://git.centos.org/summary/?r=rpms/kernel.git
>
> And to 'unzip' the RPM file, I have a script that wraps this:
>   rpm2cpio $rpmfile | cpio -idmv --no-absolute-filenames
>
>
> Alternatively, there's also the Red Hat Developers program which gives you
> free access to RHEL.
> https://developers.redhat.com/
>
> Cheers,
>Peter
>
>
> >
> >  2.6.32/wacom_wac.c | 3 ---
> >  2.6.38/wacom_wac.c | 3 ---
> >  3.7/wacom_wac.c| 3 ---
> >  3 files changed, 9 deletions(-)
> >
> > diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c
> > index 9f9899917a41..98589bea8f17 100644
> > --- a/2.6.32/wacom_wac.c
> > +++ b/2.6.32/wacom_wac.c
> > @@ -2276,7 +2276,6 @@ void wacom_setup_input_capabilities(struct
> input_dev *input_dev,
> >   __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
> >
> >   input_dev->evbit[0] |= BIT_MASK(EV_SW);
> > - __set_bit(SW_MUTE_DEVICE, input_dev->swbit);
> >   wacom_wac->shared->has_mute_touch_switch = true;
> >   } else {
> >   __set_bit(BTN_STYLUS3, input_dev->keybit);
> > @@ -2351,7 +2350,6 @@ void wacom_setup_input_capabilities(struct
> input_dev *input_dev,
> >
> >   if ((input_dev->id.product >= 0x353 &&
> input_dev->id.product <= 0x356)) {
> >   input_dev->evbit[0] |= 

Re: [Linuxwacom-devel] [PATCH input-wacom 2/2] 2.6.32: Fix abs get/set accessors for 2.6.36/2.6.37

2018-04-20 Thread Ping Cheng
On Fri, Apr 20, 2018 at 2:33 PM, Jason Gerecke <killert...@gmail.com> wrote:

> The 2.6.36 kernel removes several members from `struct input_dev` (e.g.
> abs, absres) and replaces them with a structs and accessor functions.
> To allow the input-wacom code to compile under both old and new kernels,
> commits ca9786f and the mailinglist version of ab2ea683fb conditionally
> defined their own implementation of the accessor function for older
> kernels.
>
> It was noticed, however, that this did not compile correctly on RHEL 6
> systems. It seems that the accessor API introduced in 2.6.36 is provided
> in their customized "2.6.32" kernel. This results in a redefinition error
> that halts compilation. To work around this, commit 58d8320541 removed
> the condtional and renamed our implementation of the accessor. Commit
> ab2ea683fb was also similarly modified from its mailinglist version prior
> to being committed. This change prevented the redefinition on RHEL 6 and
> also worked fine for pre-2.6.36 kernels. The change ended up breaking
> compilation under stock 2.6.36 kernels since the members used by the
> renamed function were removed.
>

 That's quite an explanation.

To ensure the code compiles in all cases, we need to be a little more
> clever. We make use of the recently-added "WACOM_LINUX_TRY_COMPILE"
> configure macro to see if the kernel provides the accessor API or not.
> If it does, we make use of it; of not, we access the members directly.
>

 Yeah, we get to be clever the third time :D.


> Fixes: 58d8320541 ("2.6.30: define wacom_input_abs_get_val")
> Fixes: ab2ea683fb ("2.6.32: Backport resolution support to 2.6.32")
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Thank you,
Ping


> ---
>  2.6.32/wacom_wac.c |  8 
>  configure.ac   | 15 +++
>  2 files changed, 23 insertions(+)
>
> diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c
> index 3ad7aae..11c7513 100644
> --- a/2.6.32/wacom_wac.c
> +++ b/2.6.32/wacom_wac.c
> @@ -924,7 +924,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
>
>  static int wacom_input_abs_get_val(struct input_dev *input, unsigned int
> axis)
>  {
> +#ifndef WACOM_ABSACCESSOR_36
> return input->abs[axis];
> +#else
> +   return input_abs_get_val(input, axis);
> +#endif
>  }
>
>  static void wacom_multitouch_generic_finger(struct wacom_wac *wacom,
> @@ -2080,7 +2084,11 @@ void wacom_setup_device_quirks(struct wacom *wacom)
>
>  static inline void wacom_input_abs_set_res(struct input_dev *dev,
> unsigned int axis, int val)
>  {
> +#ifndef WACOM_ABSACCESSOR_36
> dev->absres[axis] = val;
> +#else
> +   input_abs_set_res(dev, axis, val);
> +#endif
>  }
>
>  static void wacom_abs_set_axis(struct input_dev *input_dev,
> diff --git a/configure.ac b/configure.ac
> index 1cb4394..a14a569 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -194,6 +194,21 @@ struct power_supply_desc test;
> AC_MSG_RESULT([pre-v4.1])
>  ])
>
> +dnl RedHat entreprise Linux 6.x backports abs accessor functions from
> 2.6.36
> +AC_MSG_CHECKING(abs accessor version)
> +WACOM_LINUX_TRY_COMPILE([
> +#include 
> +],[
> +struct input_dev test;
> +input_abs_get_res(, 0);
> +],[
> +   HAVE_ABSACCESSOR_36=yes
> +   AC_MSG_RESULT([v2.6.36+])
> +   AC_DEFINE([WACOM_ABSACCESSOR_36], [], [kernel uses abs accessor
> macros from v2.6.36+])
> +],[
> +   HAVE_ABSACCESSOR_36=no
> +   AC_MSG_RESULT([pre-v2.6.36])
> +])
>
>  dnl Check which version of the driver we should compile
>  AC_DEFUN([WCM_EXPLODE], [$(echo "$1" | awk '{split($[0],x,"[[^0-9]]");
> printf("%03d%03d%03d\n",x[[1]],x[[2]],x[[3]]);}')])
> --
> 2.17.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/6] 2.6.30: Check WACOM_QUIRK_BBTOUCH_LOWRES before modifying Bamboo coords

2018-04-12 Thread Ping Cheng
On Fri, Apr 6, 2018 at 11:19 AM, Jason Gerecke <killert...@gmail.com> wrote:

> Only tablets with the WACOM_QUIRK_BBTOUCH_LOWRES flag set should have
> their coordinates expanded. This fix was never backported from upstream
> to the 2.6.30 kernel; only the 2.6.38+ kernels.
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>

The whole set looks find to me. The set is

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Cheers,
Ping

> ---
>  2.6.30/wacom_wac.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 3b65a8d..e2696ef 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -1375,6 +1375,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom,
> size_t len)
>
>  static int wacom_bpt_touch(struct wacom_wac *wacom)
>  {
> +   struct wacom_features *features = >features;
> struct input_dev *input = wacom->input;
> unsigned char *data = wacom->data;
> int i, touch_count = 0;
> @@ -1404,8 +1405,10 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
> if (touch) {
> int x = get_unaligned_be16([offset + 3]) &
> 0x7ff;
> int y = get_unaligned_be16([offset + 5]) &
> 0x7ff;
> -   x <<= 5;
> -   y <<= 5;
> +   if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES)
> {
> +   x <<= 5;
> +   y <<= 5;
> +   }
> input_report_abs(input, ABS_X, x);
> input_report_abs(input, ABS_Y, y);
> }
> --
> 2.17.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 00/10] 2.6.30: Synchronize wacom_features structures

2018-03-14 Thread Ping Cheng
On Tue, Mar 13, 2018 at 3:02 PM, Jason Gerecke <killert...@gmail.com> wrote:

> We eventually want to move away from having to store a duplicate copy of
> tablet resolution in the xf86-input-wacom driver. We can't do this *quite*
> yet since we'd have to change the minimum kernel requirement to 2.6.32,
> but we can prepare for the change by porting the resolution data from
> later kernels into the wacom_features structures and leaving it unused.
> While we're there, fix several bugs and backport support for a few tablets
> that are simple enough to add.
>
> Jason Gerecke (10):
>   2.6.30: Add missing oVid/oPid data to pen side of split devices
>   2.6.30: Correct number of buttons for DTU-1141
>   2.6.30: Correct resolution of ISDv4 0x5000 tablet
>   2.6.30: Fix maximum distance for Bamboo tablets
>   2.6.30: Clean up wacom_features structures
>   2.6.30: Backport resolution data (but not implementation)
>   2.6.30: Backport touch_max data
>   2.6.30: Backport missing TABLETPC ISDv4 devices
>   2.6.30: Backport TABLETPCE ISDv4 devices
>   2.6.30: Backport MTSCREEN ISDv4 devices
>

Reviewed-by: Ping Cheng <ping.ch...@wacom.com> for the whole set.

Thank you Jason!

Cheers,
Ping


>  2.6.30/wacom_sys.c |   8 +-
>  2.6.30/wacom_wac.c | 402 ++
> ---
>  2.6.30/wacom_wac.h |   8 +-
>  3 files changed, 237 insertions(+), 181 deletions(-)
>
> --
> 2.16.2
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom] Fix -EINVAL error preventing probe of One by Wacom on pre-3.17 kernels

2018-03-08 Thread Ping Cheng
On Wed, Mar 7, 2018 at 10:13 AM, Jason Gerecke <killert...@gmail.com> wrote:

> The commit which backported support for the One by Wacom to pre-3.17
> kernels forgot to populate the packet length field which is present
> on these older kernels, but not on the newer ones. The santy checks
> present at the beginning of "wacom_probe" fail when they come across
> the clearly-incorrect data, bailing out of the function with -EINVAL.
>
> Ref: https://sourceforge.net/p/linuxwacom/support-requests/54/
> Fixes: c6fc15ada5 ("backport: HID: wacom: Add support for One by Wacom
> (CTL-472 / CTL-672)")
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>

No one complained. I guess "One by Wacom" users don't run old kernels ;).
Anyway,

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Cheers,
Ping

---
>  2.6.30/wacom_wac.c | 4 ++--
>  2.6.38/wacom_wac.c | 4 ++--
>  3.7/wacom_wac.c| 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 2cf0f07..5b1fc90 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -2920,10 +2920,10 @@ static const struct wacom_features
> wacom_features_0x368 =
>   .type = DTH1152T, .touch_max = 10, .oVid = USB_VENDOR_ID_WACOM,
>   .oPid = 0x35A }; /* Touch */
>  static const struct wacom_features wacom_features_0x37A =
> -   { "Wacom One by Wacom S", 15200, 9500, 2047, 63,
> +   { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047,
> 63,
>   BAMBOO_PT };
>  static const struct wacom_features wacom_features_0x37B =
> -   { "Wacom One by Wacom M", 21600, 13500, 2047, 63,
> +   { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047,
> 63,
>   BAMBOO_PT };
>  static const struct wacom_features wacom_features_0x37C =
> { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191,
> 63, /* Pen-only */
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index 7e08dde..07fb987 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -3319,10 +3319,10 @@ static const struct wacom_features
> wacom_features_0x368 =
>   .type = DTH1152T, .touch_max = 10, .oVid = USB_VENDOR_ID_WACOM,
>   .oPid = 0x35A }; /* Touch */
>  static const struct wacom_features wacom_features_0x37A =
> -   { "Wacom One by Wacom S", 15200, 9500, 2047, 63,
> +   { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047,
> 63,
>   BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
>  static const struct wacom_features wacom_features_0x37B =
> -   { "Wacom One by Wacom M", 21600, 13500, 2047, 63,
> +   { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047,
> 63,
>   BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
>  static const struct wacom_features wacom_features_0x37C =
> { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191,
> 63, /* Pen-only */
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index a02d191..08da9de 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -3249,10 +3249,10 @@ static const struct wacom_features
> wacom_features_0x368 =
>   .type = DTH1152T, .touch_max = 10, .oVid = USB_VENDOR_ID_WACOM,
>   .oPid = 0x35A }; /* Touch */
>  static const struct wacom_features wacom_features_0x37A =
> -   { "Wacom One by Wacom S", 15200, 9500, 2047, 63,
> +   { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047,
> 63,
>   BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
>  static const struct wacom_features wacom_features_0x37B =
> -   { "Wacom One by Wacom M", 21600, 13500, 2047, 63,
> +   { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047,
> 63,
>   BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
>  static const struct wacom_features wacom_features_0x37C =
> { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191,
> 63, /* Pen-only */
> --
> 2.16.2
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH xf86-input-wacom] Support DTK-2451 and DTH-2452 on older kernels

2018-01-31 Thread Ping Cheng
Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
---
 src/wcmUSB.c| 3 +++
 src/wcmValidateDevice.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 1e4dc51..ca63e6d 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -234,6 +234,9 @@ static struct WacomModelDesc
{ WACOM_VENDOR_ID, 0xF0, 10, 10, , "DTU1631"  
},
{ WACOM_VENDOR_ID, 0x35a, 10, 10, ,"DTH1152"  
},
{ WACOM_VENDOR_ID, 0x368, 10, 10, ,"DTH1152"  
}, /* Touch */
+   { WACOM_VENDOR_ID, 0x382, 10, 10, ,"DTK2451"  
},
+   { WACOM_VENDOR_ID, 0x37D, 10, 10, ,"DTH2452"  
},
+   { WACOM_VENDOR_ID, 0x37E, 10, 10, ,"DTH2452"  
}, /* Touch */
 
{ WACOM_VENDOR_ID, 0x41, 10, 10, ,"Intuos2 4x5"  
},
{ WACOM_VENDOR_ID, 0x42, 10, 10, ,"Intuos2 6x8"  
},
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 921b564..95c8a2c 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -334,6 +334,9 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
case 0x356:/* Cintiq Pro 32 Touch */
case 0x35A:/* DTH-1152*/
case 0x368:/* DTH-1152 Touch */
+   case 0x382:/* DTK-2451 */
+   case 0x37D:/* DTH-2452 */
+   case 0x37E:/* DTH-2452 Touch */
TabletSetFeature(priv->common, WCM_LCD);
break;
}
-- 
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Support DTK-2451 and DTH-2452 on older kernels

2018-01-31 Thread Ping Cheng
On Wed, Jan 31, 2018 at 5:32 PM, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> On Wed, Jan 31, 2018 at 03:04:34PM -0800, Ping Cheng wrote:
> > From: Ping Cheng <ping.ch...@wacom.com>
> >
> > Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
>
> Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>
>

Thank you.


>
> but alas, it doesn't seem to apply to current master?
>

Oops! I forgot to pull before making this patch. Should I submit a new one?

Ping

>
> Cheers,
>Peter
>
> > ---
> >  src/wcmUSB.c| 3 +++
> >  src/wcmValidateDevice.c | 3 +++
> >  2 files changed, 6 insertions(+)
> >
> > diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> > index 2f96a8a..42f108e 100644
> > --- a/src/wcmUSB.c
> > +++ b/src/wcmUSB.c
> > @@ -234,6 +234,9 @@ static struct WacomModelDesc
> >   { WACOM_VENDOR_ID, 0xF0, 10, 10, ,
>  "DTU1631"  },
> >   { WACOM_VENDOR_ID, 0x35a, 10, 10, ,
> "DTH1152"  },
> >   { WACOM_VENDOR_ID, 0x368, 10, 10, ,
> "DTH1152"  }, /* Touch */
> > + { WACOM_VENDOR_ID, 0x382, 10, 10, ,
> "DTK2451"  },
> > + { WACOM_VENDOR_ID, 0x37D, 10, 10, ,
> "DTH2452"  },
> > + { WACOM_VENDOR_ID, 0x37E, 10, 10, ,
> "DTH2452"  }, /* Touch */
> >
> >   { WACOM_VENDOR_ID, 0x41, 10, 10, ,"Intuos2
> 4x5"  },
> >   { WACOM_VENDOR_ID, 0x42, 10, 10, ,"Intuos2
> 6x8"  },
> > diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> > index 21ccd5f..8c5f2d2 100644
> > --- a/src/wcmValidateDevice.c
> > +++ b/src/wcmValidateDevice.c
> > @@ -327,6 +327,9 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
> >   case 0x354:/* Cintiq Pro 13 UHD Touch */
> >   case 0x35A:/* DTH-1152*/
> >   case 0x368:/* DTH-1152 Touch */
> > + case 0x382:/* DTK-2451 */
> > + case 0x37D:/* DTH-2452 */
> > + case 0x37E:/* DTH-2452 Touch */
> >   TabletSetFeature(priv->common, WCM_LCD);
> >   break;
> >   }
> > --
> > 2.7.4
> >
> >
> > 
> --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Linuxwacom-devel mailing list
> > Linuxwacom-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> >
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Support DTK-2451 and DTH-2452 on older kernels

2018-01-31 Thread Ping Cheng
From: Ping Cheng <ping.ch...@wacom.com>

Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
---
 src/wcmUSB.c| 3 +++
 src/wcmValidateDevice.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 2f96a8a..42f108e 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -234,6 +234,9 @@ static struct WacomModelDesc
{ WACOM_VENDOR_ID, 0xF0, 10, 10, , "DTU1631"  
},
{ WACOM_VENDOR_ID, 0x35a, 10, 10, ,"DTH1152"  
},
{ WACOM_VENDOR_ID, 0x368, 10, 10, ,"DTH1152"  
}, /* Touch */
+   { WACOM_VENDOR_ID, 0x382, 10, 10, ,"DTK2451"  
},
+   { WACOM_VENDOR_ID, 0x37D, 10, 10, ,"DTH2452"  
},
+   { WACOM_VENDOR_ID, 0x37E, 10, 10, ,"DTH2452"  
}, /* Touch */
 
{ WACOM_VENDOR_ID, 0x41, 10, 10, ,"Intuos2 4x5"  
},
{ WACOM_VENDOR_ID, 0x42, 10, 10, ,"Intuos2 6x8"  
},
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 21ccd5f..8c5f2d2 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -327,6 +327,9 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
case 0x354:/* Cintiq Pro 13 UHD Touch */
case 0x35A:/* DTH-1152*/
case 0x368:/* DTH-1152 Touch */
+   case 0x382:/* DTK-2451 */
+   case 0x37D:/* DTH-2452 */
+   case 0x37E:/* DTH-2452 Touch */
TabletSetFeature(priv->common, WCM_LCD);
break;
}
-- 
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Add support for DTK-2451 and DTH-2452

2018-01-26 Thread Ping Cheng
Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
---
 2.6.30/wacom_sys.c |  8 ++--
 2.6.30/wacom_wac.c | 45 +++--
 2.6.30/wacom_wac.h |  3 +++
 2.6.38/wacom_sys.c |  3 +++
 2.6.38/wacom_wac.c | 45 +++--
 2.6.38/wacom_wac.h |  3 +++
 3.7/wacom_sys.c|  3 +++
 3.7/wacom_wac.c| 45 +++--
 3.7/wacom_wac.h|  3 +++
 9 files changed, 138 insertions(+), 20 deletions(-)

diff --git a/2.6.30/wacom_sys.c b/2.6.30/wacom_sys.c
index ba17b1b..bdb1eb8 100644
--- a/2.6.30/wacom_sys.c
+++ b/2.6.30/wacom_sys.c
@@ -266,7 +266,8 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
 features->type == 
WACOM_24HDT ||
 features->type == 
WACOM_MSPROT ||
 features->type == 
DTH1152T ||
-features->type == 
WACOM_27QHDT) {
+features->type == 
WACOM_27QHDT ||
+features->type == 
DTH2452T) {
/* need to reset back */
features->pktlen = 
WACOM_PKGLEN_TPC2FG;
if (features->type == MTTPC ||
@@ -275,7 +276,8 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
features->pktlen = 
WACOM_PKGLEN_MTTPC;
else if (features->type == 
WACOM_24HDT)
features->pktlen = 
WACOM_PKGLEN_MTOUCH;
-   else if (features->type == 
WACOM_MSPROT)
+   else if (features->type == 
WACOM_MSPROT ||
+features->type == 
DTH2452T)
features->pktlen = 
WACOM_PKGLEN_MSPROT;
else if (features->type == 
DTH1152T ||
 features->type == 
WACOM_27QHDT)
@@ -317,6 +319,7 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
 
case WACOM_MSPROT:
case MTTPC_B:
+   case DTH2452T:
features->x_max =

get_unaligned_le16([i + 3]);
features->x_phy =
@@ -394,6 +397,7 @@ static int wacom_parse_hid(struct usb_interface *intf, 
struct hid_descriptor *hi
 
case WACOM_MSPROT:
case MTTPC_B:
+   case DTH2452T:
features->y_max =

get_unaligned_le16([i + 3]);
features->y_phy =
diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
index 90c5c2b..4d4f924 100644
--- a/2.6.30/wacom_wac.c
+++ b/2.6.30/wacom_wac.c
@@ -227,13 +227,16 @@ static int wacom_dtus_irq(struct wacom_wac *wacom)
 {
unsigned char *data = wacom->data;
struct input_dev *input = wacom->input;
+   struct wacom_features *features = >features;
unsigned short prox, pressure = 0;
 
-   if (data[0] != WACOM_REPORT_DTUS && data[0] != WACOM_REPORT_DTUSPAD) {
+   if (data[0] != WACOM_REPORT_DTUS && data[0] != WACOM_REPORT_DTUSPAD
+   && data[0] != WACOM_REPORT_DTK2451PAD) {
dev_dbg(input->dev.parent,
"%s: received unknown report #%d", __func__, data[0]);
return 0;
-   } else if (data[0] == WACOM_REPORT_DTUSPAD) {
+   } else if (data[0] == WACOM_REPORT_DTUSPAD
+   || data[0] == WACOM_REPORT_DTK2451PAD) {
input_report_key(input, BTN_0, (data[1] & 0x01));
input_report_key(input, BTN_1, (data[1] & 0x02));
input_report_key(input, BTN_2, (data[1] & 0x04));
@@ -264,9 +267,15 @@ static int wacom_dtus_irq(struct wacom_wac *wacom)
 
input_report_key(input, BTN_STYLUS, data[1] & 0x20);
input_report_key(input, BTN_STYLUS2, data[1] & 0x40);
-   input_report_abs(input, ABS_X, get_unaligned_be16([3]));
- 

Re: [Linuxwacom-devel] [PATCH input-wacom 2/2] Implement support for multitouch value conflict resolution on 2.6.35+

2018-01-25 Thread Ping Cheng
On Thu, Jan 25, 2018 at 11:49 AM, Jason Gerecke <killert...@gmail.com>
wrote:

> Devices using the 2.6.30 wacom-specific multitouch protocol have to be
> careful to ensure that two contacts don't use the same axis value. This
> is because the second contact's value will be swallowed by the kernel.
> The 2.6.36 kernel replaced direct-access to the value with an accessor
> function (named "input_abs_get_val"), but our 2.6.30-compatible branch
> kept using direct access, though only for pre-2.6.35 kernels (off-by-one
> error on the version number).
>
> This commit introduces an "input_abs_get_val" function for pre-2.6.36
> kernels. This allows us to use the native API where available and
> fallback to direct access when not. It also means that the fixups are
> now applied to 2.6.35+ kernels.
>

Nice cleanup! Thank you.


>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>

Reviewed-by: Ping Cheng <ping.ch...@wacom.com> for the set.

Cheers,
Ping

---
>  2.6.30/wacom_wac.c | 26 ++
>  1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 72c5f65..90c5c2b 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -909,6 +909,14 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
> return 0;
>  }
>
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
> +static int input_abs_get_val(struct input_dev *input, unsigned int axis)
> +{
> +   return input->abs[axis];
> +}
> +#endif
> +
>  static void wacom_multitouch_generic_finger(struct wacom_wac *wacom,
> int contact_id, bool prox,
> int x, int y)
> @@ -928,14 +936,12 @@ static void wacom_multitouch_generic_finger(struct
> wacom_wac *wacom,
>
> wacom->slots[slot] = prox ? contact_id : -1;
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
> if (wacom->last_finger != slot) {
> -   if (x == input->abs[ABS_X])
> +   if (x == input_abs_get_val(input, ABS_X))
> x++;
> -   if (y == input->abs[ABS_Y])
> +   if (y == input_abs_get_val(input, ABS_Y))
> y++;
> }
> -#endif
>
> if (wacom->shared)
> prox = prox && !wacom->shared->stylus_in_proximity;
> @@ -1063,15 +1069,13 @@ static void wacom_tpc_finger_in(struct wacom_wac
> *wacom, unsigned char *data, in
> int x = le16_to_cpup((__le16 *)[finger * 2]) & 0x7fff;
> int y = le16_to_cpup((__le16 *)[4 + finger * 2]) & 0x7fff;
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
> if (wacom->last_finger != finger) {
> -   if (x == input->abs[ABS_X])
> +   if (x == input_abs_get_val(input, ABS_X))
> x++;
>
> -   if (y == input->abs[ABS_Y])
> +   if (y == input_abs_get_val(input, ABS_Y))
> y++;
> }
> -#endif
>
> input_report_abs(input, ABS_X, x);
> input_report_abs(input, ABS_Y, y);
> @@ -1217,15 +1221,13 @@ static void wacom_tpc_mt(struct wacom_wac *wacom)
> int x = get_unaligned_le16([offset +
> x_offset + 7]);
> int y = get_unaligned_le16([offset +
> x_offset + 9]);
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
> if (wacom->last_finger == id) {
> -   if (x == input->abs[ABS_X])
> +   if (x == input_abs_get_val(input,
> ABS_X))
> x++;
>
> -   if (y == input->abs[ABS_Y])
> +   if (y == input_abs_get_val(input,
> ABS_Y))
> y++;
> }
> -#endif
>
> wacom->id[slot+1] = touch;
> if (!wacom->id[1] && !wacom->id[2])
> --
> 2.16.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [v2ish xf86-input-wacom 2/2] add Github to release.sh script

2018-01-17 Thread Ping Cheng
On Mon, Jan 15, 2018 at 11:12 AM, Aaron Armstrong Skomra <sko...@gmail.com>
wrote:

> Require at least 1 of Github/Sourceforge.
>
> Signed-off-by: Aaron Armstrong Skomra <sko...@gmail.com>
>

Reviewed-by: Ping Cheng <ping.ch...@wacom.com> for the set.

Let's get one step closer to github.

Ping


> ---
> Similar patches were applied to input-wacom in October. This
> revised patch addresses Peter's comments. I will revise input-wacom's
> release.sh when this series is accepted here.
>
>  release.sh | 279 ++
> +--
>  1 file changed, 197 insertions(+), 82 deletions(-)
>
> diff --git a/release.sh b/release.sh
> index a5dff324cc9d..f6102206469c 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -89,11 +89,160 @@ fi
>  }
>
>  #---
> ---
> +#  Function: release_to_sourceforge
> +#--
> 
> +#
> +release_to_sourceforge () {
> +
> +# Some hostnames are also used as /srv subdirs
> +host_linuxwacom="shell.sourceforge.net"
> +
> +section_path=archive/individual/$section
> +srv_path="/srv/$host_current/$section_path"
> +
> +if [ x"$section" = xxf86-input-wacom ] ||
> +   [ x"$section" = xinput-wacom ] ||
> +   [ x"$section" = xlibwacom ]; then
> +# input-wacom files are in a subdirectory for whatever reason
> +if [ x"$section" = xinput-wacom ]; then
> +section="xf86-input-wacom/input-wacom"
> +fi
> +
> +hostname=$host_linuxwacom
> +host_current="sourceforge.net"
> +section_path="projects/linuxwacom/files/$section"
> +srv_path="/home/frs/project/linuxwacom/$section"
> +
> +echo "creating shell on sourceforge for $SF_USERNAME"
> +ssh ${SF_USERNAME%@},linuxwacom@$hostname create
> +#echo "Simply log out once you get to the prompt"
> +#ssh -t ${SF_USERNAME%@},linuxwacom@$hostname create
> +#echo "Sleeping for 30 seconds, because this sometimes helps
> against sourceforge's random authentication denials"
> +#sleep 30
> +fi
> +
> +# Use personal web space on the host for unit testing (leave
> commented out)
> +# srv_path="~/public_html$srv_path"
> +
> +# Check that the server path actually does exist
> +ssh $SF_USERNAME$hostname ls $srv_path >/dev/null 2>&1 ||
> +if [ $? -ne 0 ]; then
> +   echo "Error: the path \"$srv_path\" on the web server does not
> exist."
> +   cd $top_src
> +   return 1
> +fi
> +
> +# Check for already existing tarballs
> +for tarball in $targz $tarbz2 $tarxz; do
> +   ssh $SF_USERNAME$hostname ls $srv_path/$tarball  >/dev/null 2>&1
> +   if [ $? -eq 0 ]; then
> +   if [ "x$FORCE" = "xyes" ]; then
> +   echo "Warning: overwriting released tarballs due to
> --force option."
> +   else
> +   echo "Error: tarball $tar_name already exists. Use --force
> to overwrite."
> +   cd $top_src
> +   return 1
> +   fi
> +   fi
> +done
> +
> +# Upload to host using the 'scp' remote file copy program
> +if [ x"$DRY_RUN" = x ]; then
> +   echo "Info: uploading tarballs to web server:"
> +   scp $targz $tarbz2 $tarxz $siggz $sigbz2 $sigxz
> $SF_USERNAME$hostname:$srv_path
> +   if [ $? -ne 0 ]; then
> +   echo "Error: the tarballs uploading failed."
> +   cd $top_src
> +   return 1
> +   fi
> +else
> +   echo "Info: skipping tarballs uploading in dry-run mode."
> +   echo "  \"$srv_path\"."
> +fi
> +
> +host_current="sourceforge.net"
> +section_path="projects/linuxwacom/files/$section"
> +# DL_URL & PGP_URL will be overwritten by the Github download url if
> github was
> +# enabled on the command line
> +DL_URL="http://$host_current/$section_path/$tarbz2;
> +PGP_URL="http://$host_current/$section_path/$tarbz2.sig;
> +}
> +
> +#--
> 
> +#  Function: check_json_message
> +#--
> 
> +#
>

Re: [Linuxwacom-devel] [PATCH] Allocate 4 buttons for stylus devices (Pro Pen 3D)

2017-12-26 Thread Ping Cheng
On Tuesday, December 26, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> The Pro Pen 3D includes a third stylus button, reported from the kernel
> as BTN_STYLUS3. Support for this event was added earlier, but the number
> of buttons allocated was not updated. This meant that although the X
> driver would properly set the button flag bit to indicate that a button
> should be sent, a userspace event wouldn't actually be sent. This commit
> increases the number of buttons allocated, causing the third button to
> emit X11 button number 8 when pressed. This button can also be configured
> through xsetwacom now that the driver allocates the correct number.
>
> Fixes: 4a96a58f26 ("Add support for kernel's new BTN_STYLUS3 event")
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>


Nice catch, Jason! I have a minor suggestion for the comments in code
below. Except that, the patch is

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Ping

---
>  src/wcmUSB.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 9190fbe..6349d69 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -167,7 +167,7 @@ static unsigned short padkey_codes [] = {
>  /* Fixed mapped stylus and mouse buttons */
>
>  #define WCM_USB_MAX_MOUSE_BUTTONS 5
> -#define WCM_USB_MAX_STYLUS_BUTTONS 3
> +#define WCM_USB_MAX_STYLUS_BUTTONS 4
>
>  static unsigned short mouse_codes [] = {
> BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_BACK, BTN_FORWARD,
> @@ -480,7 +480,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id,
> size_t id_len, float *versi
> /* nbuttons tracks maximum buttons on all tools (stylus/mouse).
>  *
>  * Mouse support left, middle, right, side, and extra side button.


Should we say “Mouse may support left, middle, right, side, and extra side
button.”?

-* Stylus support tip and 2 stlyus buttons.
> +* Stylus support tip and 3 stlyus buttons.


“Stylus may support tip and up to 3 stylus buttons.”

 */
> if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE))
> usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS;
> --
> 2.15.1
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 3/3] Reset filter when buttons are pressed

2017-12-12 Thread Ping Cheng
Thank you for your cleanup work, Jason. The first two patches look fine.
This one definitely needs some testing to make sure it achieves what you
planned for.

Assuming your testing of this patch was successfully, the whole set is;

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

With one question below.

On Fri, Dec 8, 2017 at 1:55 PM, Jason Gerecke <killert...@gmail.com> wrote:

> Coordinate averaging is useful for producing smooth strokes, but this
> averaging can cause button events to be sent at the wrong location.
> In particular, when making a series of quick strokes with an AES pen,
> the actual location the pen contacts the display can be some distance
> away from the first (low-quality) position report. This can result in
> "hook" artifacts if it is still influencing the averaged pointer
> position when the pen goes down.
>
> To prevent these artifacts from appearing, we reset the averaging filter
> whenever a button is pressed. This ensures that button events are sent
> at the pen's actual location, plus or minus some (much smaller) noise.
> Resetting the filter should not significantly impact stroke quality since
> buttons are rarely pressed mid-stroke.
>
> https://sourceforge.net/p/linuxwacom/bugs/338/
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> ---
>  src/wcmCommon.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index 900544b..e515078 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -1241,6 +1241,15 @@ static void commonDispatchDevice(InputInfoPtr
> pInfo,
> if (!priv->oldState.proximity)
> wcmResetSampleCounter(pChannel);
>
> +   /* Reset filter whenever a button is pressed to
>

Shouldn't we do it for button release too? Some actions may be trigged by
button release instead.

+* ensure the clicks are sent at the pen's actual
> +* position. This prevents "hooks" from appearing
> +* at the beginning of series of rapidly-drawn or
> +* highly-averaged strokes.
> +*/
> +   if ((priv->oldState.buttons ^ filtered.buttons) &
> filtered.buttons)
>

So, is the second filtered.buttons necessary above?

Cheers,
Ping

+   wcmResetSampleCounter(pChannel);
> +
> wcmFilterCoord(common,pChannel,);
> }
>
> --
> 2.15.1
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Intuos Pro 2nd Generation doesn't support the puck.

2017-12-06 Thread Ping Cheng
On Wed, Dec 6, 2017 at 9:00 AM, Aaron Armstrong Skomra <sko...@gmail.com>
wrote:

>
>
> On Wed, Dec 6, 2017 at 7:38 AM, Jason Gerecke <killert...@gmail.com>
> wrote:
>
>> On Tue, Dec 5, 2017 at 2:15 PM, Ping Cheng <pingli...@gmail.com> wrote:
>> > Yeah, puck’s feature is pretty much replaced by MT’s...
>> >
>> > On Tuesday, December 5, 2017, Aaron Armstrong Skomra <sko...@gmail.com>
>> > wrote:
>> >>
>> >> Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
>> >
>> >
>> > Reviewed-by: Ping Cheng <ping.ch...@wacom.com>
>> >
>> > Ping
>> >
>>
>> I notice that although the buttons don't work (making the puck
>> useless), the pointer itself still moves. Should this patch also
>> update the "don't report events for invalid data" block of
>> wacom_intuos_general() to completely ignore the puck for INTUOSP2?
>> Something similar for the generic codepath/upstream would be good as
>> well, but that's a different patch.
>>
>> Hmm, I was thinking of this as a "don't report the capability" patch, in
> the case where software looks
> at what the device supports. I hadn't thought of stopping bad data. If we
> want to stop people from using
> the wrong tool on a device I see there is a lot more work to be done... I
> know the 8k pen will report
>

Ok, let's defer this patch for now. I'd like that we update upstream first
before getting into input-wacom fixes...

Cheers,
Ping


> garbage data on Cobra Refresh.
>
> Jason
>> ---
>> Now instead of four in the eights place /
>> you’ve got three, ‘Cause you added one  /
>> (That is to say, eight) to the two, /
>> But you can’t take seven from three,/
>> So you look at the sixty-fours
>>
>> >>
>> >> ---
>> >>  2.6.30/wacom_wac.c | 17 ++---
>> >>  2.6.36/wacom_wac.c | 17 ++---
>> >>  2.6.38/wacom_wac.c | 17 ++---
>> >>  3.7/wacom_wac.c| 17 ++---
>> >>  4 files changed, 40 insertions(+), 28 deletions(-)
>> >>
>> >> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
>> >> index 3020ade403a7..aa6c6d279343 100644
>> >> --- a/2.6.30/wacom_wac.c
>> >> +++ b/2.6.30/wacom_wac.c
>> >> @@ -1875,18 +1875,21 @@ static void wacom_setup_cintiq(struct wacom_wac
>> >> *wacom_wac)
>> >>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
>> >>  {
>> >> struct input_dev *input_dev = wacom_wac->input;
>> >> +   struct wacom_features *features = _wac->features;
>> >>
>> >> input_set_capability(input_dev, EV_REL, REL_WHEEL);
>> >>
>> >> wacom_setup_cintiq(wacom_wac);
>> >>
>> >> -   __set_bit(BTN_LEFT, input_dev->keybit);
>> >> -   __set_bit(BTN_RIGHT, input_dev->keybit);
>> >> -   __set_bit(BTN_MIDDLE, input_dev->keybit);
>> >> -   __set_bit(BTN_SIDE, input_dev->keybit);
>> >> -   __set_bit(BTN_EXTRA, input_dev->keybit);
>> >> -   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
>> >> -   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
>> >> +   if (features->type != INTUOSP2) {
>> >> +   __set_bit(BTN_LEFT, input_dev->keybit);
>> >> +   __set_bit(BTN_RIGHT, input_dev->keybit);
>> >> +   __set_bit(BTN_MIDDLE, input_dev->keybit);
>> >> +   __set_bit(BTN_SIDE, input_dev->keybit);
>> >> +   __set_bit(BTN_EXTRA, input_dev->keybit);
>> >> +   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
>> >> +   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
>> >> +   }
>> >>
>> >> input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
>> >> input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0,
>> 0);
>> >> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
>> >> index 54432390e13f..640c61e8b295 100644
>> >> --- a/2.6.36/wacom_wac.c
>> >> +++ b/2.6.36/wacom_wac.c
>> >> @@ -1704,18 +1704,21 @@ static void wacom_setup_cintiq(struct wacom_wac
>> >> *wacom_wac)
>> >>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
>> >>  {
>> >> struct input_dev *input_dev = wacom_wac->

Re: [Linuxwacom-devel] [PATCH] Intuos Pro 2nd Generation doesn't support the puck.

2017-12-06 Thread Ping Cheng
On Wednesday, December 6, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> On Tue, Dec 5, 2017 at 2:15 PM, Ping Cheng <pingli...@gmail.com> wrote:
> > Yeah, puck’s feature is pretty much replaced by MT’s...
> >
> > On Tuesday, December 5, 2017, Aaron Armstrong Skomra <sko...@gmail.com>
> > wrote:
> >>
> >> Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
> >
> >
> > Reviewed-by: Ping Cheng <ping.ch...@wacom.com>
> >
> > Ping
> >
>
> I notice that although the buttons don't work (making the puck
> useless), the pointer itself still moves. Should this patch also
> update the "don't report events for invalid data" block of
> wacom_intuos_general() to completely ignore the puck for INTUOSP2?
>
>
It makes sense to me.


> Something similar for the generic codepath/upstream would be good as
> well, but that's a different patch.


That may need a bit of work, depending on how the descriptors are defined.

Cheers,
Ping


>
> Jason
> ---
> Now instead of four in the eights place /
> you’ve got three, ‘Cause you added one  /
> (That is to say, eight) to the two, /
> But you can’t take seven from three,/
> So you look at the sixty-fours
>
> >>
> >> ---
> >>  2.6.30/wacom_wac.c | 17 ++---
> >>  2.6.36/wacom_wac.c | 17 ++---
> >>  2.6.38/wacom_wac.c | 17 ++---
> >>  3.7/wacom_wac.c| 17 ++---
> >>  4 files changed, 40 insertions(+), 28 deletions(-)
> >>
> >> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> >> index 3020ade403a7..aa6c6d279343 100644
> >> --- a/2.6.30/wacom_wac.c
> >> +++ b/2.6.30/wacom_wac.c
> >> @@ -1875,18 +1875,21 @@ static void wacom_setup_cintiq(struct wacom_wac
> >> *wacom_wac)
> >>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
> >>  {
> >> struct input_dev *input_dev = wacom_wac->input;
> >> +   struct wacom_features *features = _wac->features;
> >>
> >> input_set_capability(input_dev, EV_REL, REL_WHEEL);
> >>
> >> wacom_setup_cintiq(wacom_wac);
> >>
> >> -   __set_bit(BTN_LEFT, input_dev->keybit);
> >> -   __set_bit(BTN_RIGHT, input_dev->keybit);
> >> -   __set_bit(BTN_MIDDLE, input_dev->keybit);
> >> -   __set_bit(BTN_SIDE, input_dev->keybit);
> >> -   __set_bit(BTN_EXTRA, input_dev->keybit);
> >> -   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> >> -   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> >> +   if (features->type != INTUOSP2) {
> >> +   __set_bit(BTN_LEFT, input_dev->keybit);
> >> +   __set_bit(BTN_RIGHT, input_dev->keybit);
> >> +   __set_bit(BTN_MIDDLE, input_dev->keybit);
> >> +   __set_bit(BTN_SIDE, input_dev->keybit);
> >> +   __set_bit(BTN_EXTRA, input_dev->keybit);
> >> +   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> >> +   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> >> +   }
> >>
> >> input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
> >> input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0,
> 0);
> >> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> >> index 54432390e13f..640c61e8b295 100644
> >> --- a/2.6.36/wacom_wac.c
> >> +++ b/2.6.36/wacom_wac.c
> >> @@ -1704,18 +1704,21 @@ static void wacom_setup_cintiq(struct wacom_wac
> >> *wacom_wac)
> >>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
> >>  {
> >> struct input_dev *input_dev = wacom_wac->input;
> >> +   struct wacom_features *features = _wac->features;
> >>
> >> input_set_capability(input_dev, EV_REL, REL_WHEEL);
> >>
> >> wacom_setup_cintiq(wacom_wac);
> >>
> >> -   __set_bit(BTN_LEFT, input_dev->keybit);
> >> -   __set_bit(BTN_RIGHT, input_dev->keybit);
> >> -   __set_bit(BTN_MIDDLE, input_dev->keybit);
> >> -   __set_bit(BTN_SIDE, input_dev->keybit);
> >> -   __set_bit(BTN_EXTRA, input_dev->keybit);
> >> -   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> >> -   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> >> +   if (features->type != INTUOSP2) {
> >> +   __set_bit(BTN_LEFT, input_dev->keybit

Re: [Linuxwacom-devel] [PATCH] Intuos Pro 2nd Generation doesn't support the puck.

2017-12-05 Thread Ping Cheng
Yeah, puck’s feature is pretty much replaced by MT’s...

On Tuesday, December 5, 2017, Aaron Armstrong Skomra <sko...@gmail.com>
wrote:

> Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>


Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Ping


> ---
>  2.6.30/wacom_wac.c | 17 ++---
>  2.6.36/wacom_wac.c | 17 ++---
>  2.6.38/wacom_wac.c | 17 ++---
>  3.7/wacom_wac.c| 17 ++---
>  4 files changed, 40 insertions(+), 28 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 3020ade403a7..aa6c6d279343 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -1875,18 +1875,21 @@ static void wacom_setup_cintiq(struct wacom_wac
> *wacom_wac)
>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
>  {
> struct input_dev *input_dev = wacom_wac->input;
> +   struct wacom_features *features = _wac->features;
>
> input_set_capability(input_dev, EV_REL, REL_WHEEL);
>
> wacom_setup_cintiq(wacom_wac);
>
> -   __set_bit(BTN_LEFT, input_dev->keybit);
> -   __set_bit(BTN_RIGHT, input_dev->keybit);
> -   __set_bit(BTN_MIDDLE, input_dev->keybit);
> -   __set_bit(BTN_SIDE, input_dev->keybit);
> -   __set_bit(BTN_EXTRA, input_dev->keybit);
> -   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> -   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> +   if (features->type != INTUOSP2) {
> +   __set_bit(BTN_LEFT, input_dev->keybit);
> +   __set_bit(BTN_RIGHT, input_dev->keybit);
> +   __set_bit(BTN_MIDDLE, input_dev->keybit);
> +   __set_bit(BTN_SIDE, input_dev->keybit);
> +   __set_bit(BTN_EXTRA, input_dev->keybit);
> +   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> +   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> +   }
>
> input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
> input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index 54432390e13f..640c61e8b295 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1704,18 +1704,21 @@ static void wacom_setup_cintiq(struct wacom_wac
> *wacom_wac)
>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
>  {
> struct input_dev *input_dev = wacom_wac->input;
> +   struct wacom_features *features = _wac->features;
>
> input_set_capability(input_dev, EV_REL, REL_WHEEL);
>
> wacom_setup_cintiq(wacom_wac);
>
> -   __set_bit(BTN_LEFT, input_dev->keybit);
> -   __set_bit(BTN_RIGHT, input_dev->keybit);
> -   __set_bit(BTN_MIDDLE, input_dev->keybit);
> -   __set_bit(BTN_SIDE, input_dev->keybit);
> -   __set_bit(BTN_EXTRA, input_dev->keybit);
> -   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> -   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> +   if (features->type != INTUOSP2) {
> +   __set_bit(BTN_LEFT, input_dev->keybit);
> +   __set_bit(BTN_RIGHT, input_dev->keybit);
> +   __set_bit(BTN_MIDDLE, input_dev->keybit);
> +   __set_bit(BTN_SIDE, input_dev->keybit);
> +   __set_bit(BTN_EXTRA, input_dev->keybit);
> +   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> +   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> +   }
>
> input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
> input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index 3db445f6fbcd..7809c5904325 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -2139,18 +2139,21 @@ static void wacom_setup_cintiq(struct wacom_wac
> *wacom_wac)
>  static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
>  {
> struct input_dev *input_dev = wacom_wac->input;
> +   struct wacom_features *features = _wac->features;
>
> input_set_capability(input_dev, EV_REL, REL_WHEEL);
>
> wacom_setup_cintiq(wacom_wac);
>
> -   __set_bit(BTN_LEFT, input_dev->keybit);
> -   __set_bit(BTN_RIGHT, input_dev->keybit);
> -   __set_bit(BTN_MIDDLE, input_dev->keybit);
> -   __set_bit(BTN_SIDE, input_dev->keybit);
> -   __set_bit(BTN_EXTRA, input_dev->keybit);
> -   __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
> -   __set_bit(BTN_TOOL_LENS, input_dev->keybit);
> +   if (features->type != INTUOSP2) {
> +   __set_bit(BTN_LEFT, input_dev-&g

Re: [Linuxwacom-devel] [PATCH 1/3] xsetwacom: Use explicit NULL for final element of 'parameters' array

2017-11-28 Thread Ping Cheng
On Tuesday, November 28, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> C does not strictly allow allow an empty initializer


I like people to put efforts on cleaning up the code. It is a very
good habit, which we all should have ;).

Patches in this set, plus the individual one after this set, look good to
me. One nitpicking is: I don’t think you wanted to emphasize your idea by
double “allow” in the above line.

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Cheers,
Ping


> list `{}`, which can
> result in missing-field-initializers warnings from the compiler. All
> consumers of this array cycle through until they see a NULL name, so
> this commit replaces the empty initializer with { .name = NULL }.
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>
> ---
>  tools/xsetwacom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> index 1051868..a94d1f9 100644
> --- a/tools/xsetwacom.c
> +++ b/tools/xsetwacom.c
> @@ -484,7 +484,7 @@ static param_t parameters[] =
> .get_func = get_all,
> .prop_flags = PROP_FLAG_READONLY,
> },
> -   {}
> +   {.name = NULL}
>  };
>
>  /**
> --
> 2.15.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] Process 24HDT and 27QHDT in wacom_multitouch_generic

2017-11-03 Thread Ping Cheng
On Friday, November 3, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> The wacom_multitouch_generic function was based upon wacom_24hdt_irq
> and can be fairly trivially swapped in to its place. By doing this, we
> can bring more functionality under one common umbrella that is available
> in every kernel tree (wacom_24hdt_irq itself was never backported to
> 2.6.30/2.6.36).
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>


Acked-by: Ping Cheng <ping.ch...@wacom.com>

Ping

---
>  2.6.30/wacom_wac.c |   5 +-
>  2.6.36/wacom_wac.c |   5 +-
>  2.6.38/wacom_wac.c | 137 +-
> ---
>  3.7/wacom_wac.c| 135 +-
> --
>  4 files changed, 110 insertions(+), 172 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 1484a1a..b110a7d 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -964,11 +964,10 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> int x = -1;
> int y = -1;
> int prox = -1;
> -   int offset;
> +   int offset = bytes_per_packet * i + bytes_header;
>
> switch (features->type) {
> case WACOM_MSPROT:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> @@ -976,7 +975,6 @@ static int wacom_multitouch_generic(struct wacom_wac
> *wacom)
> break;
>
> case INTUOSP2:
> -   offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> x = get_unaligned_le16([offset + 2]);
> @@ -984,7 +982,6 @@ static int wacom_multitouch_generic(struct wacom_wac
> *wacom)
> break;
>
> case DTH1152T:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index 1d5ee35..cc76104 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1315,11 +1315,10 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> int x = -1;
> int y = -1;
> int prox = -1;
> -   int offset;
> +   int offset = bytes_per_packet * i + bytes_header;
>
> switch (features->type) {
> case WACOM_MSPROT:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> @@ -1327,7 +1326,6 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> break;
>
> case INTUOSP2:
> -   offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> x = get_unaligned_le16([offset + 2]);
> @@ -1335,7 +1333,6 @@ static int wacom_multitouch_generic(struct
> wacom_wac *wacom)
> break;
>
> case DTH1152T:
> -   offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x1;
> contact_id = get_unaligned_le16([offset +
> 1]);
> x = get_unaligned_le16([offset + 3]);
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index d6797a5..8c0c1d7 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1142,7 +1142,8 @@ static int wacom_wac_finger_count_touches(struct
> wacom_wac *wacom)
>
>  static void wacom_multitouch_generic_finger(struct wacom_wac *wacom,
> int contact_id, bool prox,
> -   int x, int y, int w, int h)
> +   int x, int y, int w, int h,
> +   int c_x, int c_y)
>  {
>  

Re: [Linuxwacom-devel] [PATCH input-wacom] Correct tilt range for MobileStudio/Intuos/Cintiq Pro devices

2017-11-03 Thread Ping Cheng
On Friday, November 3, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> The pre-3.17 kernels set up their tilt axis ranges to be 0..127 rather
> than -64..+63 like with the HID kernels. We need to add a correction for
> this to the wacom_mspro_pen_irq function so that userspace properly
> interprets the data. Without this fix, any physical tilt angle will be
> interprted as being to the upper-left (and any amount of actual up/left
> tilt angle will be saturated at -64 degrees).
>
> Fixes: cd79aac597 ("backport: MobileStudio Pro to 3.7, 2.6.38, 2.6.36,
> 2.6.30")
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>


Acked-by: Ping Cheng <ping.ch...@wacom.com>

Ping


> ---
>  2.6.30/wacom_wac.c | 4 
>  2.6.36/wacom_wac.c | 4 
>  2.6.38/wacom_wac.c | 4 
>  3.7/wacom_wac.c| 4 
>  4 files changed, 16 insertions(+)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index ae3e1b4..1484a1a 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -1653,6 +1653,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index 85683d6..1d5ee35 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1490,6 +1490,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index 0b8b15f..d6797a5 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1953,6 +1953,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index 08d375e..cde8d22 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -1933,6 +1933,10 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
> if (rotation > 899)
> rotation -= 1800;
>
> +   /* Fix tilt zero-point: wacom_setup_cintiq declares
> 0..127, not -63..+64 */
> +   tilt_x += 64;
> +   tilt_y += 64;
> +
> input_report_key(input, BTN_TOUCH,proximity ? tip
>: 0);
> input_report_key(input, BTN_STYLUS,   proximity ? sw1
>: 0);
> input_report_key(input, BTN_STYLUS2,  proximity ? sw2
>: 0);
> --
> 2.15.0
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/4] Synchronize trivial changes into to 3.17

2017-10-31 Thread Ping Cheng
On Fri, Oct 27, 2017 at 11:07 AM, Jason Gerecke <killert...@gmail.com> wrote:
> A number of minor changes have either been unintentionally made to the
> 3.17 tree or occurred as a result of not backporting all upstream changes.
> These differences do not affect driver operation, but the clutter they
> produce in the output of `diff` does serve to hide a number of "real"
> semantic differences. They also make it more difficult to backport
> upstream patches, as the patch command will fail if the context does
> not exactly match.
>
> To resolve these issues, this commit pulls in as many trivial changes
> from 4.5 (which we assume is nearly-identical to upstream) as possible.
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

Acked-by: Ping Cheng <ping.cheng@wacom,com>, if you were waiting for one ;).

Cheers,
Ping

> ---
>  3.17/wacom_sys.c | 9 +
>  3.17/wacom_wac.c | 7 +++
>  3.17/wacom_wac.h | 1 +
>  3 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/3.17/wacom_sys.c b/3.17/wacom_sys.c
> index 7387bd2..6f395dc 100644
> --- a/3.17/wacom_sys.c
> +++ b/3.17/wacom_sys.c
> @@ -1444,7 +1444,7 @@ err:
>  static int wacom_initialize_battery(struct wacom *wacom)
>  {
> if (wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY)
> -return __wacom_initialize_battery(wacom, >battery);
> +   return __wacom_initialize_battery(wacom, >battery);
>
> return 0;
>  }
> @@ -2219,8 +2219,8 @@ static void wacom_remote_destroy_one(struct wacom 
> *wacom, unsigned int index)
>
>  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
> if (WACOM_POWERSUPPLY_DEVICE(remote->remotes[index].battery.battery))
> -devres_release_group(>hdev->dev,
> - 
> >remotes[index].battery.bat_desc);
> +   devres_release_group(>hdev->dev,
> +
> >remotes[index].battery.bat_desc);
>  #else
> if (remote->remotes[index].battery.battery.dev)
> wacom_destroy_remote_battery(>remotes[index].battery);
> @@ -2307,6 +2307,7 @@ static int wacom_remote_attach_battery(struct wacom 
> *wacom, int index)
>  {
> struct wacom_remote *remote = wacom->remote;
> int error;
> +
> if (!remote->remotes[index].registered)
> return 0;
>
> @@ -2317,7 +2318,7 @@ static int wacom_remote_attach_battery(struct wacom 
> *wacom, int index)
> return 0;
>
> error = __wacom_initialize_battery(wacom,
> -  
> >remote->remotes[index].battery);
> +   
> >remote->remotes[index].battery);
> if (error)
> return error;
>
> diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
> index dc83356..c2bf12b 100644
> --- a/3.17/wacom_wac.c
> +++ b/3.17/wacom_wac.c
> @@ -21,7 +21,7 @@
>  #endif
>
>  #ifndef KEY_ONSCREEN_KEYBOARD
> -#define KEY_ONSCREEN_KEYBOARD  0x278
> +#define KEY_ONSCREEN_KEYBOARD  0x278
>  #endif
>
>  #ifndef KEY_BUTTONCONFIG
> @@ -1095,7 +1095,6 @@ static int wacom_remote_irq(struct wacom_wac 
> *wacom_wac, size_t len)
> WACOM_POWER_SUPPLY_STATUS_AUTO, bat_percent,
> bat_charging, 1, bat_charging);
>
> -
>  out:
> spin_unlock_irqrestore(>remote_lock, flags);
> return 0;
> @@ -1990,7 +1989,7 @@ static void wacom_wac_pad_event(struct hid_device 
> *hdev, struct hid_field *field
> is_touch_on = wacom_wac->shared->is_touch_on;
> }
>
> -   /* fall through*/
> +   /* fall through*/
> case WACOM_HID_WD_TOUCHONOFF:
> if (wacom_wac->shared->touch_input) {
> input_report_switch(wacom_wac->shared->touch_input,
> @@ -2364,7 +2363,7 @@ static void wacom_wac_finger_slot(struct wacom_wac 
> *wacom_wac,
> report_touch_events(wacom_wac);
>
> if (wacom_wac->shared->has_mute_touch_switch &&
> -   !wacom_wac->shared->is_touch_on) {
> +   !wacom_wac->shared->is_touch_on) {
> if (!wacom_wac->shared->touch_down)
> return;
> prox = 0;
> diff --git a/3.17/wacom_wac.h b/3.17/wacom_wac.h
> index 7b12d70..daf34f1 100644
> --- a/3.17/wacom_wac.h
> +++ b/3.17/wacom_wac.h
> @@ -361,6 +361,7 @@ struct wacom_wac {
> bool has_mute_touch_switch;
> bool has_mode_change;
> bool is_direct_mode;
> +
>  };
>
>  #endif
> --
> 2.14.3
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom] Fix tool type reporting by wacom_mspro_pen_irq on pre-3.17 kernels

2017-10-26 Thread Ping Cheng
On Thursday, October 26, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> The tool ID that is reported to userspace is generated by combining both
> the tool_uid and tool_type data received. The highest three nybbles of
> tool_uid do not contain tool type information, however, and must be masked
> off to generate the correct tool ID. This ensures that the GNOME Control
> Center correctly identifies these pens as they enter proximity.
>
> Fixes: cd79aac597 ("backport: MobileStudio Pro to 3.7, 2.6.38, 2.6.36,
> 2.6.30")
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>


Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Cheers,
Ping


> ---
>  2.6.30/wacom_wac.c | 2 +-
>  2.6.36/wacom_wac.c | 2 +-
>  2.6.38/wacom_wac.c | 2 +-
>  3.7/wacom_wac.c| 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 78d6858..679c4d8 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -1627,7 +1627,7 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
>
> if (range) {
> wacom->serial[0] = (tool_uid & 0x);
> -   wacom->id[0] = (tool_uid >> 32) | tool_type;
> +   wacom->id[0] = ((tool_uid >> 32) & 0xF) |
> tool_type;
> wacom->tool[0] = wacom_intuos_get_tool_type(wacom->id[0]
> & 0xF);
> }
>
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index 9be5390..85683d6 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1471,7 +1471,7 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
>
> if (range) {
> wacom->serial[0] = (tool_uid & 0x);
> -   wacom->id[0] = (tool_uid >> 32) | tool_type;
> +   wacom->id[0] = ((tool_uid >> 32) & 0xF) |
> tool_type;
> wacom->tool[0] = wacom_intuos_get_tool_type(wacom->id[0]
> & 0xF);
> }
>
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index c7ceb3d..2c0e347 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1933,7 +1933,7 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
>
> if (range) {
> wacom->serial[0] = (tool_uid & 0x);
> -   wacom->id[0] = (tool_uid >> 32) | tool_type;
> +   wacom->id[0] = ((tool_uid >> 32) & 0xF) |
> tool_type;
> wacom->tool[0] = wacom_intuos_get_tool_type(wacom->id[0]
> & 0xF);
> }
>
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index 14548f1..344894b 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -1913,7 +1913,7 @@ static int wacom_mspro_pen_irq(struct wacom_wac
> *wacom)
>
> if (range) {
> wacom->serial[0] = (tool_uid & 0x);
> -   wacom->id[0] = (tool_uid >> 32) | tool_type;
> +   wacom->id[0] = ((tool_uid >> 32) & 0xF) |
> tool_type;
> wacom->tool[0] = wacom_intuos_get_tool_type(wacom->id[0]
> & 0xF);
> }
>
> --
> 2.14.2
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Mark 2nd-gen non-professional "Intuos" devices (CTH-X90) as "Bamboo" class

2017-10-02 Thread Ping Cheng
On Mon, Oct 2, 2017 at 3:20 PM, Peter Hutterer <peter.hutte...@who-t.net> wrote:
> On Mon, Oct 02, 2017 at 02:33:05PM -0700, Ping Cheng wrote:
>> On Fri, Sep 29, 2017 at 7:25 AM, Jason Gerecke <killert...@gmail.com> wrote:
>> > These devices are much more similar to the Bamboo line of devices than to
>> > the original professional "Intuos" devices (GD-) that are nearly 20
>> > years old at this point. The 1st-gen non-professional "Intuos" devices
>> > (CTH-X80) are also marked as "Bamboo" class, FWIW.
>>
>> My questions are:
>>
>> How the "Class" key word is used? What's the targeted use cases/clients?
>
> It was meant as a general category but tbh, I don't think anyone uses it.
>
>> I ask the questions since the Intuos stylus we are talking about in
>> this data file follows the professional stylus features/data format.
>> But, its touch follows Bamboo data format. So, by "Class", are we
>> talking about the tablet itself, the stylus that works on the tablet,
>> or something else?
>
> it's not really well defined, the class was added when the bamboos were
> quite different to the intuos series (buttons at the top vs buttons+ring on
> the side). So beyond going with 'try to stay consistent' there isn't really
> a rule.
>
> I think the only really useful class right now is WCLASS_REMOTE because the
> EKR is really different to everything else.

Ok, I see. That makes sense. It's mainly for tablet
buttons/expresskeys/pad (well, depends on where to look for its names
;).

Maybe we should update wacom.example to give it a bit of hint?

Thanks,
Ping

>> I guess those questions are for Peter, the godfather of libwacom, to
>> answer. From the definition in wacom.example below
>>
>> # Class of the tablet. Valid classes include Intuos3, Intuos4,
>> Graphire, Bamboo, Cintiq
>> # If unsure, or not applicable (the tablet isn't stand-alone for
>> # example), just leave it out.
>>
>> We may need to "just leave it out"?
>
> I'd say let's merge this one because it is consistent with the 1st gen as
> Jason said.
>
> Cheers,
>Peter
>
>>
>> Ping
>>
>> > Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>> > ---
>> >  data/intuos-m-p2.tablet  | 2 +-
>> >  data/intuos-m-pt2.tablet | 2 +-
>> >  data/intuos-s-p2.tablet  | 2 +-
>> >  data/intuos-s-pt2.tablet | 2 +-
>> >  4 files changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/data/intuos-m-p2.tablet b/data/intuos-m-p2.tablet
>> > index 2c4b2a6..2c5b9de 100644
>> > --- a/data/intuos-m-p2.tablet
>> > +++ b/data/intuos-m-p2.tablet
>> > @@ -24,7 +24,7 @@
>> >  [Device]
>> >  Name=Intuos Pen Medium
>> >  DeviceMatch=usb:056a:033d
>> > -Class=Intuos
>> > +Class=Bamboo
>> >  Width=9
>> >  Height=5
>> >  Layout=intuos-m-p2.svg
>> > diff --git a/data/intuos-m-pt2.tablet b/data/intuos-m-pt2.tablet
>> > index 4549c4f..4806b76 100644
>> > --- a/data/intuos-m-pt2.tablet
>> > +++ b/data/intuos-m-pt2.tablet
>> > @@ -37,7 +37,7 @@
>> >  [Device]
>> >  Name=Intuos Pen & Touch Medium
>> >  DeviceMatch=usb:056a:033e
>> > -Class=Intuos
>> > +Class=Bamboo
>> >  Width=9
>> >  Height=5
>> >  Layout=intuos-m-pt2.svg
>> > diff --git a/data/intuos-s-p2.tablet b/data/intuos-s-p2.tablet
>> > index df42d11..1894c89 100644
>> > --- a/data/intuos-s-p2.tablet
>> > +++ b/data/intuos-s-p2.tablet
>> > @@ -22,7 +22,7 @@
>> >  [Device]
>> >  Name=Intuos Pen Small
>> >  DeviceMatch=usb:056a:033b
>> > -Class=Intuos
>> > +Class=Bamboo
>> >  Width=6
>> >  Height=4
>> >  Layout=intuos-s-p2.svg
>> > diff --git a/data/intuos-s-pt2.tablet b/data/intuos-s-pt2.tablet
>> > index a7f5f19..6fa504b 100644
>> > --- a/data/intuos-s-pt2.tablet
>> > +++ b/data/intuos-s-pt2.tablet
>> > @@ -36,7 +36,7 @@
>> >  [Device]
>> >  Name=Intuos Pen & Touch Small
>> >  DeviceMatch=usb:056a:033c
>> > -Class=Intuos
>> > +Class=Bamboo
>> >  Width=6
>> >  Height=4
>> >  Layout=intuos-s-pt2.svg
>> > --
>> > 2.14.1
>> >

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Mark 2nd-gen non-professional "Intuos" devices (CTH-X90) as "Bamboo" class

2017-10-02 Thread Ping Cheng
On Fri, Sep 29, 2017 at 7:25 AM, Jason Gerecke  wrote:
> These devices are much more similar to the Bamboo line of devices than to
> the original professional "Intuos" devices (GD-) that are nearly 20
> years old at this point. The 1st-gen non-professional "Intuos" devices
> (CTH-X80) are also marked as "Bamboo" class, FWIW.

My questions are:

How the "Class" key word is used? What's the targeted use cases/clients?

I ask the questions since the Intuos stylus we are talking about in
this data file follows the professional stylus features/data format.
But, its touch follows Bamboo data format. So, by "Class", are we
talking about the tablet itself, the stylus that works on the tablet,
or something else?

I guess those questions are for Peter, the godfather of libwacom, to
answer. From the definition in wacom.example below

# Class of the tablet. Valid classes include Intuos3, Intuos4,
Graphire, Bamboo, Cintiq
# If unsure, or not applicable (the tablet isn't stand-alone for
# example), just leave it out.

We may need to "just leave it out"?

Ping

> Signed-off-by: Jason Gerecke 
> ---
>  data/intuos-m-p2.tablet  | 2 +-
>  data/intuos-m-pt2.tablet | 2 +-
>  data/intuos-s-p2.tablet  | 2 +-
>  data/intuos-s-pt2.tablet | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/data/intuos-m-p2.tablet b/data/intuos-m-p2.tablet
> index 2c4b2a6..2c5b9de 100644
> --- a/data/intuos-m-p2.tablet
> +++ b/data/intuos-m-p2.tablet
> @@ -24,7 +24,7 @@
>  [Device]
>  Name=Intuos Pen Medium
>  DeviceMatch=usb:056a:033d
> -Class=Intuos
> +Class=Bamboo
>  Width=9
>  Height=5
>  Layout=intuos-m-p2.svg
> diff --git a/data/intuos-m-pt2.tablet b/data/intuos-m-pt2.tablet
> index 4549c4f..4806b76 100644
> --- a/data/intuos-m-pt2.tablet
> +++ b/data/intuos-m-pt2.tablet
> @@ -37,7 +37,7 @@
>  [Device]
>  Name=Intuos Pen & Touch Medium
>  DeviceMatch=usb:056a:033e
> -Class=Intuos
> +Class=Bamboo
>  Width=9
>  Height=5
>  Layout=intuos-m-pt2.svg
> diff --git a/data/intuos-s-p2.tablet b/data/intuos-s-p2.tablet
> index df42d11..1894c89 100644
> --- a/data/intuos-s-p2.tablet
> +++ b/data/intuos-s-p2.tablet
> @@ -22,7 +22,7 @@
>  [Device]
>  Name=Intuos Pen Small
>  DeviceMatch=usb:056a:033b
> -Class=Intuos
> +Class=Bamboo
>  Width=6
>  Height=4
>  Layout=intuos-s-p2.svg
> diff --git a/data/intuos-s-pt2.tablet b/data/intuos-s-pt2.tablet
> index a7f5f19..6fa504b 100644
> --- a/data/intuos-s-pt2.tablet
> +++ b/data/intuos-s-pt2.tablet
> @@ -36,7 +36,7 @@
>  [Device]
>  Name=Intuos Pen & Touch Small
>  DeviceMatch=usb:056a:033c
> -Class=Intuos
> +Class=Bamboo
>  Width=6
>  Height=4
>  Layout=intuos-s-pt2.svg
> --
> 2.14.1
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom] Allow __wacom_is_usb_parent to handle unconfigured USB devices

2017-09-27 Thread Ping Cheng
On Wed, Sep 27, 2017 at 4:19 PM, Aaron Armstrong Skomra
<sko...@gmail.com> wrote:
>
>
> On Fri, Aug 11, 2017 at 4:46 PM, Ping Cheng <pingli...@gmail.com> wrote:
>>
>> On Friday, August 11, 2017, Jason Gerecke <killert...@gmail.com> wrote:
>>>
>>> The USB protocol allows devices to have multiple "configurations" that
>>> the OS can switch between. A an "unconfigured" state is also possible,
>>> especially when the device is first connected. If '__wacom_is_usb_parent'
>>> comes across an unconfigured USB device, the 'config' variable will
>>> be NULL. We need to add a check for this state before attempting a
>>> dereference.
>>>
>>> Fixes: 38c795d ("backport: HID: wacom: Improve generic name generation")
>>> Fixes: bb55947 ("HID: wacom: Improve generic name generation")
>>> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>>
>>
> This patch doesn't need to go upstream?

It is only for kernels older than 4.14. See the following line at the
start of the block:

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)

Cheers,
Ping

>
> Best,
> Aaron
>>
>> The patch makes sense to me. It is
>>
>> Reviewed-by: Ping Cheng <ping.ch...@wavom.com>
>>
>> Cheers,
>> Ping
>>
>>> ---
>>> Changes from v1:
>>>   * Apply fix to 3.17 tree
>>>   * Add proper "Fixes" annotations
>>>
>>>  3.17/wacom_sys.c | 2 +-
>>>  4.5/wacom_sys.c  | 2 +-
>>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/3.17/wacom_sys.c b/3.17/wacom_sys.c
>>> index 9fccf59..2996d0d 100644
>>> --- a/3.17/wacom_sys.c
>>> +++ b/3.17/wacom_sys.c
>>> @@ -29,7 +29,7 @@ static int __wacom_is_usb_parent(struct usb_device
>>> *usbdev, void *ptr)
>>> struct usb_host_config *config = usbdev->actconfig;
>>> int i;
>>>
>>> -   for (i = 0; i < config->desc.bNumInterfaces; i++) {
>>> +   for (i = 0; config && i < config->desc.bNumInterfaces; i++) {
>>> if (>interface[i]->dev == parent)
>>> return 1;
>>> }
>>> diff --git a/4.5/wacom_sys.c b/4.5/wacom_sys.c
>>> index cfe5fa8..3a65174 100644
>>> --- a/4.5/wacom_sys.c
>>> +++ b/4.5/wacom_sys.c
>>> @@ -30,7 +30,7 @@ static int __wacom_is_usb_parent(struct usb_device
>>> *usbdev, void *ptr)
>>> struct usb_host_config *config = usbdev->actconfig;
>>> int i;
>>>
>>> -   for (i = 0; i < config->desc.bNumInterfaces; i++) {
>>> +   for (i = 0; config && i < config->desc.bNumInterfaces; i++) {
>>> if (>interface[i]->dev == parent)
>>> return 1;
>>> }
>>> --
>>> 2.13.4
>>>
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] xsetwacom: Recognize 'AltGr' key as synonym for 'ISO_Level3_Shift'

2017-09-14 Thread Ping Cheng
On Thursday, September 14, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> The table of keysyms does not include an obvious synonym for the "AltGr"
> key that is found on some international keyboard layouts. It seems that
> "ISO_Level3_Shift" is the magic name that should typically be used.
>
> https://sourceforge.net/p/linuxwacom/bugs/344/


> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>


xsetwacom forces us to get familiar with international keys and ISO keysyms
;).

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Cheers,
Ping


> ---
>  tools/xsetwacom.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> index 834ebde..1051868 100644
> --- a/tools/xsetwacom.c
> +++ b/tools/xsetwacom.c
> @@ -581,6 +581,8 @@ static struct modifier modifiers[] = {
> {"lhyper", "Hyper_L"},
> {"rhyper", "Hyper_R"},
>
> +   {"altgr", "ISO_Level3_Shift"},
> +
> { NULL, NULL }
>  };
>
> --
> 2.14.1
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/2] Add support for 2nd-generation Intuos Pro

2017-08-10 Thread Ping Cheng
On Thursday, August 10, 2017, Jason Gerecke <killert...@gmail.com> wrote:

> This tablet is usable without this patch, but the device type is missing
> the WCM_RING flag. This prevents the ring valuator from being initialized
> correctly, and in turn causes recent versions of gnome-control-center to
> not allow configuration of the ring.
>
> https://bugzilla.gnome.org/show_bug.cgi?id=785358
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>


Reviewed-by: Ping Cheng <ping.ch...@wacom.com> for the set of two patches.

Thank you Jason for the fix!

Ping

---
>  src/wcmValidateDevice.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index bfff8e7..8eac0dd 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -202,6 +202,8 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
> TabletSetFeature(priv->common, WCM_DUALRING |
> WCM_LCD);
> /* fall through */
>
> +   case 0x357: /* Intuos Pro 2 M */
> +   case 0x358: /* Intuos Pro 2 L */
> case 0x314: /* Intuos Pro S */
> case 0x315: /* Intuos Pro M */
> case 0x317: /* Intuos Pro L */
> --
> 2.13.4
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Remove the device's fd from the select() set when we get ENODEV

2017-07-31 Thread Ping Cheng
On Mon, Jul 17, 2017 at 5:28 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> If the device is unplugged, the fd triggers in select/poll/... but comes back
> with ENODEV. This triggers a lot of error messages in the log until finally
> the udev code catches up with us and the device is removed properly.
>
> Catch that case by removing the fd from the select() set so we don't get
> triggered to call read_input on it anymore.
>
> https://sourceforge.net/p/linuxwacom/bugs/337/

Thank you Peter for your support. Somehow I thought the patch has been
merged. But it is not. The patch is:

> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

Tested-by: crocket <crockabisc...@gmail.com>
Reviewed-by: Ping Cheng <ping.ch...@wacom.com>

Please merge it, Peter.

Cheers,
Ping

> ---
>  src/xf86Wacom.c | 12 +---
>  src/xf86Wacom.h |  2 +-
>  2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> index 738690f..1eb3f57 100644
> --- a/src/xf86Wacom.c
> +++ b/src/xf86Wacom.c
> @@ -632,7 +632,8 @@ static void wcmDevReadInput(InputInfoPtr pInfo)
> if (!wcmReady(pInfo)) break;
>
> /* dispatch */
> -   wcmReadPacket(pInfo);
> +   if (!wcmReadPacket(pInfo))
> +   break;
> }
>
>  #ifdef DEBUG
> @@ -649,7 +650,7 @@ static void wcmDevReadInput(InputInfoPtr pInfo)
>  #endif
>  }
>
> -void wcmReadPacket(InputInfoPtr pInfo)
> +Bool wcmReadPacket(InputInfoPtr pInfo)
>  {
> WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
> WacomCommonPtr common = priv->common;
> @@ -672,7 +673,10 @@ void wcmReadPacket(InputInfoPtr pInfo)
> if (errno != EAGAIN && errno != EINTR)
> LogMessageVerbSigSafe(X_ERROR, 0,
>   "%s: Error reading wacom device 
> : %s\n", pInfo->name, strerror(errno));
> -   return;
> +   if (errno == ENODEV)
> +   xf86RemoveEnabledDevice(pInfo);
> +
> +   return FALSE;
> }
>
> /* account for new data */
> @@ -704,6 +708,8 @@ void wcmReadPacket(InputInfoPtr pInfo)
> }
>
> common->bufpos = len;
> +
> +   return TRUE;
>  }
>
>  int wcmDevChangeControl(InputInfoPtr pInfo, xDeviceCtl * control)
> diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
> index afb4e9e..ccc2d56 100644
> --- a/src/xf86Wacom.h
> +++ b/src/xf86Wacom.h
> @@ -120,7 +120,7 @@ char *wcmEventAutoDevProbe (InputInfoPtr pInfo);
>  int wcmInitTablet(InputInfoPtr pInfo, const char* id, float version);
>
>  /* standard packet handler */
> -void wcmReadPacket(InputInfoPtr pInfo);
> +Bool wcmReadPacket(InputInfoPtr pInfo);
>
>  /* handles suppression, filtering, and dispatch. */
>  void wcmEvent(WacomCommonPtr common, unsigned int channel, const 
> WacomDeviceState* ds);
> --
> 2.13.0
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Support recent display devices on older kernels

2017-05-15 Thread Ping Cheng
On Mon, May 15, 2017 at 9:59 AM, Aaron Armstrong Skomra
 wrote:
> On Sun, May 14, 2017 at 5:17 PM, Peter Hutterer
>  wrote:
>> On Fri, May 12, 2017 at 01:37:53PM -0700, Aaron Armstrong Skomra wrote:
>>> Older kernels like 2.6.30 will end up with touches
>>> interpreted as relative events unless these devices
>>> are explicitly added.
>>>
>>> Signed-off-by: Aaron Armstrong Skomra 
>>> ---
>>>  src/wcmUSB.c| 4 
>>>  src/wcmValidateDevice.c | 8 
>>>  2 files changed, 12 insertions(+)
>>>
>>> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
>>> index 2f9d93f937d7..d48027915546 100644
>>> --- a/src/wcmUSB.c
>>> +++ b/src/wcmUSB.c
>>> @@ -287,6 +287,10 @@ static struct WacomModelDesc
>>>   { WACOM_VENDOR_ID, 0x57, 20, 20, ,   "DTK2241"
>>>   },
>>>   { WACOM_VENDOR_ID, 0x59, 20, 20, ,   "DTH2242"
>>>   },
>>>   { WACOM_VENDOR_ID, 0x5B, 20, 20, ,   "Cintiq 
>>> 22HDT" },
>>> + { WACOM_VENDOR_ID, 0x34D, 20, 20, ,  
>>> "MobileStudio Pro 13"  },
>>> + { WACOM_VENDOR_ID, 0x34E, 20, 20, ,  
>>> "MobileStudio Pro 16"  },
>>> + { WACOM_VENDOR_ID, 0x34F, 20, 20, ,  "Cintiq 13 
>>> FHD Pro"},
>>> + { WACOM_VENDOR_ID, 0x350, 20, 20, ,  "Cintiq 16 
>>> UHD Pro"},
>>>
>>>   { WACOM_VENDOR_ID, 0x90, 10, 10, ,   "TabletPC 
>>> 0x90"},
>>>   { WACOM_VENDOR_ID, 0x93, 10, 10, ,   "TabletPC 
>>> 0x93"},
>>> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
>>> index 0b8387c3614c..d2a77238c729 100644
>>> --- a/src/wcmValidateDevice.c
>>> +++ b/src/wcmValidateDevice.c
>>> @@ -309,6 +309,14 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
>>>   case 0x5D: /* DTH2242 Touch */
>>>   case 0x5E: /* Cintiq 22HDT Touch */
>>>   case 0x304:/* Cintiq 13HD */
>>> + case 0x34A:/* MobileStudio Pro 13 Touch */
>>> + case 0x34B:/* MobileStudio Pro 16 Touch */
>>> + case 0x34D:/* MobileStudio Pro 13 */
>>> + case 0x34E:/* MobileStudio Pro 13 */
>>> + case 0x34F:/* Cintiq Pro 13 FHD */
>>> + case 0x350:/* Cintiq Pro 16 UHD */
>>> + case 0x353:/* Cintiq Pro 13 FHD Touch */
>>> + case 0x354:/* Cintiq Pro 13 UHD Touch */
>>
>> aren't some of these missing from the list above? do they need to be added
>> there too?
>>
> Hi Peter,
>
> The list in wcmUSB.c doesn't have any PIDs from the touch side. I don't know
> the history of why the PIDs are in one list but not the other.

The reason was that we didn't back-port touch support to
input-wacom/2.6.30 for multi-touch (MT) devices initially. We thought
2.6.30 doesn't support true MT anyway. But, we later had to add
2-figure touch support by using _DOUBLETAP and _TRIPPLETAP to make
Tablet PC users happy. That's why those Cintiqs were ignored in X
driver since we focused on the solution for Tablet PC. Cintiq touch
was only a by-product...

With that said, it makes sense to add touch PIDs to the list.

Cheers,
Ping

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH linuxwacom] Add support for Oracle Solaris 10

2017-04-20 Thread Ping Cheng
On Thu, Apr 20, 2017 at 2:48 PM, Jason Gerecke <killert...@gmail.com> wrote:
> This patch adds support for Solaris 10 and is based on code produced
> in 2010 by Sun Microsystems. The original code was targeted at OpenSolaris
> snv_115 - snv_129 and was based on linuxwacom 0.8.4. The original patches
> don't appear to be available online [1] anymore, except in our out-of-date
> 'solaris' branch.
>
> [1]: 
> http://hub.opensolaris.org/bin/view/Community+Group+device_drivers/wacomtablet
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

It was a few developers' effort to get this far. Let's keep the code
for those who still need it.

Acked-by: Ping Cheng <ping.ch...@wacom.com>

Thank you Jason for maintaining the code.

Ping
> ---
>  README.solaris.md| 179 
>  THIRDPARTYLICENSEREADME.txt  |   8 +
>  configure.in |  26 ++-
>  solaris-build.sh | 387 
> +++
>  src/include/usbwcm_build.h   | 110 
>  src/util/10-linuxwacom.fdi   |  25 +++
>  src/util/Makefile.am |   6 +
>  src/util/hal-setup-wacom.c   | 127 +-
>  src/util/wactablet.c |  28 
>  src/util/wacusb.c|  28 +++-
>  src/xdrv/Makefile.am |   2 +-
>  src/xdrv/wcmUSB.c|  29 
>  src/xdrv/wcmValidateDevice.c |  10 +-
>  src/xdrv/xf86Wacom.h |   5 +
>  src/xdrv/xf86WacomDefs.h |   8 +
>  15 files changed, 968 insertions(+), 10 deletions(-)
>  create mode 100644 README.solaris.md
>  create mode 100644 THIRDPARTYLICENSEREADME.txt
>  create mode 100755 solaris-build.sh
>  create mode 100644 src/include/usbwcm_build.h
>
> diff --git a/README.solaris.md b/README.solaris.md
> new file mode 100644
> index 000..47238e2
> --- /dev/null
> +++ b/README.solaris.md
> @@ -0,0 +1,179 @@
> +**Solaris Notes For linuxwacom**
> +
> +
> +# Overview  ###
> +
> +[usbwcm STREAMS module]:
> +https://github.com/linuxwacom/usbwcm/
> +
> +Version 0.12.0 of the linuxwacom driver introduced support for the Solaris
> +operating system. This code is minimally tested and regressions may occur
> +without warning. At the time of writing, only Solaris 10 U9 and U11
> +("5/10" and "1/13") have been explicitly tested for compatibility. Please
> +contact the linuxwacom project maintainers through SourceForge or Github
> +if you have specific concerns or issues using this driver on Solaris.
> +
> +Note that these sources do not contain any Solaris kernel code. License
> +incompatibilities prevent us from distributing both as a combined work.
> +Please be sure to install the [usbwcm STREAMS module][] in addition to
> +this driver.
> +
> +
> +# Usage  ##
> +
> +[configuring X11]:
> +http://linuxwacom.sourceforge.net/index_old.php/howto/x11
> +
> +The Xorg server must be manually configured to make use of connected
> +tablets in Solaris 10. Please see the [configuring X11][] section of
> +the linuxwacom manual for details on the modifications that must be
> +made to the `/etc/X11/xorg.conf` file. The appropriate device node
> +(e.g. `/dev/usb/hid0`) will need to be determined based on the output
> +of `dmesg`. See the Troubleshooting section below if you encounter
> +problems. The mouse pointer should move in response to pen input once
> +the X server is properly configured.
> +
> +Some applications require additional configuration to make full use
> +of tablet data. For example, GIMP must have the "stylus" and "eraser"
> +tools set to "Screen" mode in its Extended Input Devices preferences.
> +It is impossible to provide instructions for each application. Please
> +see your application documentation for details if the tablet does not
> +appear to be automatically detected.
> +
> +The linuxwacom driver provides a pair of configuration utilities
> +that can be used to modify or tune the behavior of connected tablets.
> +The `xsetwacom` utility provides a scriptable command-line interface,
> +while `wacomcpl` is a graphical Tcl/Tk application. Debug utilities
> +such as `wacdump` and `xidump` are also included should issues arise.
> +
> +
> +# Build, Install, and Uninstall ###
> +
> +## Solaris 10 ##
> +
> +Although the linuxwacom driver can be built for Solaris 10, the process
> +is non-obvious largely due to a lack of Xorg SDK development headers. An
> +interactive script which takes care of the entire build process (from
> +obtaining prerequisites to setting up environ

Re: [Linuxwacom-devel] [PATCH input-wacom 1/2] backport: report width and height for Intuos Pro 2 on 3.7 and 2.6.38

2017-04-14 Thread Ping Cheng
On Thu, Apr 13, 2017 at 12:22 PM, Aaron Armstrong Skomra
<sko...@gmail.com> wrote:
> Also remove extra spaces.
>
> Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>

Reviewed-by: Ping Cheng <ping.ch...@wacom.com> for the set.

Thank you, Aaron, for the cleanup.

Ping

> ---
>  2.6.30/wacom_wac.c |8 
>  2.6.36/wacom_wac.c |4 ++--
>  2.6.38/wacom_wac.c |6 --
>  3.7/wacom_wac.c|6 --
>  4 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
> index 78cd7b7..4184644 100644
> --- a/2.6.30/wacom_wac.c
> +++ b/2.6.30/wacom_wac.c
> @@ -1134,16 +1134,16 @@ static int wacom_multitouch_generic(struct wacom_wac 
> *wacom)
> offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
> prox = data[offset] & 0x01;
> contact_id = get_unaligned_le16([offset + 1]);
> -   x  = get_unaligned_le16([offset + 3]);
> -   y  = get_unaligned_le16([offset + 5]);
> +   x = get_unaligned_le16([offset + 3]);
> +   y = get_unaligned_le16([offset + 5]);
> break;
>
> case INTUOSP2:
> offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> -   x  = get_unaligned_le16([offset + 2]);
> -   y  = get_unaligned_le16([offset + 4]);
> +   x = get_unaligned_le16([offset + 2]);
> +   y = get_unaligned_le16([offset + 4]);
> break;
>
> default:
> diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
> index f3b9a4d..f9ceb58 100644
> --- a/2.6.36/wacom_wac.c
> +++ b/2.6.36/wacom_wac.c
> @@ -1298,8 +1298,8 @@ static int wacom_multitouch_generic(struct wacom_wac 
> *wacom)
> offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> -   x  = get_unaligned_le16([offset + 2]);
> -   y  = get_unaligned_le16([offset + 4]);
> +   x = get_unaligned_le16([offset + 2]);
> +   y = get_unaligned_le16([offset + 4]);
> break;
>
> default:
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index f66f283..8cfcb6c 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1179,8 +1179,10 @@ static int wacom_multitouch_generic(struct wacom_wac 
> *wacom)
> offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> -   x  = get_unaligned_le16([offset + 2]);
> -   y  = get_unaligned_le16([offset + 4]);
> +   x = get_unaligned_le16([offset + 2]);
> +   y = get_unaligned_le16([offset + 4]);
> +   w = data[offset + 6];
> +   h = data[offset + 7];
> break;
>
> default:
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index 096864e..3fb1c33 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -1159,8 +1159,10 @@ static int wacom_multitouch_generic(struct wacom_wac 
> *wacom)
> offset = WACOM_BYTES_PER_INTUOSP2_PACKET * i + 2;
> contact_id = data[offset];
> prox = data[offset + 1] & 0x01;
> -   x  = get_unaligned_le16([offset + 2]);
> -   y  = get_unaligned_le16([offset + 4]);
> +   x = get_unaligned_le16([offset + 2]);
> +   y = get_unaligned_le16([offset + 4]);
> +   w = data[offset + 6];
> +   h = data[offset + 7];
> break;
>
> default:
> --
> 1.7.9.5
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH linuxwacom 1/5] Mark DTU-2231 as a display tablet in wacomcpl

2017-04-14 Thread Ping Cheng
On Tue, Apr 11, 2017 at 1:20 PM, Jason Gerecke <killert...@gmail.com> wrote:
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

Reviewed-by: Ping Cheng <ping.ch...@wacom.com> for the while set.

Thanks,
Ping

> ---
>  src/wacomxi/wacomcpl-exec | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/wacomxi/wacomcpl-exec b/src/wacomxi/wacomcpl-exec
> index b5fc6f6..5d8bbd0 100755
> --- a/src/wacomxi/wacomcpl-exec
> +++ b/src/wacomxi/wacomcpl-exec
> @@ -2088,6 +2088,9 @@ proc updateModelInfo { } {
>  set numPadButtons(197) 10
>  set numPadStrips(197) 2
>
> +# DTU-2231
> +set isLCD(206) 1
> +
>  # Hummingbird (Cintiq 12WX)
>  set numPadButtons(198) 10
>  set numPadStrips(198) 2
> --
> 2.12.0
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH v2] Make sibling device name matching slightly more lenient

2017-02-10 Thread Ping Cheng
The wcmIsSiblingDevice function uses several tricks to try and determine
if two devices should be considered siblings. If its 'logical_only'
parameter is false, this includes comparing device names. Device name
comparison is complicated by the fact that suffixes are added on by
the X and kernel drivers. To deal with this, the wcmSplitName function
tries to split a device name into three pieces: its "basename" that
describes the model, its "subdevice" name that describes the interface,
and its "tool" name which describes the X11 tool.

Spliting the name is a somewhat kludgy process which does not properly
handle the device names for the MobileStudio Pro or Cintiq Pro. The
kernel reads the name of these devices directly from the hardware's
descriptors, and the names are slightly different between the pen and
touch interfaces (the touch device has an extra "Touch" suffix).

This patch tweaks how wcmSplitName breaks apart device names in order
to handle the MobileStudio Pro and Cintiq Pro. Specifically, it now
allows the "subdevice" to contain an arbitrary number of "Pen", "Finger",
:Touch", or "Pad" suffixes. For the MobileStudio Pro and Cintiq Pro,
this should allow the "basename" that is considered for sibling device
matches to be identical between both the pen and touch interfaces.

Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
---
v2: split a long if statement into two lines, as per Peter's suggestion.
---
 src/wcmConfig.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 27c686f..0924c43 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -320,10 +320,19 @@ static void wcmSplitName(char* devicename, char 
*basename, char *subdevice, char
{
*a = '\0';
b = strrchr(name, ' ');
-   if (b && (!strcmp(b, " Pen") || !strcmp(b, " Finger") || 
!strcmp(b, " Pad")))
+
+   while (b)
{
-   *b = '\0';
-   strncat(subdevice, b+1, len-1);
+   if (!strcmp(b, " Pen") || !strcmp(b, " Finger") ||
+   !strcmp(b, " Pad") || !strcmp(b, " Touch"))
+   {
+   *b = '\0';
+   strncpy(subdevice, b+1, len-1);
+   subdevice[len-1] = '\0';
+   b = strrchr(name, ' ');
+   }
+   else
+   b = NULL;
}
strncat(tool, a+1, len-1);
}
-- 
1.8.3.1


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Make sibling device name matching slightly more lenient

2017-02-09 Thread Ping Cheng
On Wednesday, February 8, 2017, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> On Mon, Feb 06, 2017 at 05:36:21PM -0800, Ping Cheng wrote:
> > The wcmIsSiblingDevice function uses several tricks to try and determine
> > if two devices should be considered siblings. If its 'logical_only'
> > parameter is false, this includes comparing device names. Device name
> > comparison is complicated by the fact that suffixes are added on by
> > the X and kernel drivers. To deal with this, the wcmSplitName function
> > tries to split a device name into three pieces: its "basename" that
> > describes the model, its "subdevice" name that describes the interface,
> > and its "tool" name which describes the X11 tool.
> >
> > Spliting the name is a somewhat kludgy process which does not properly
> > handle the device names for the MobileStudio Pro or Cintiq Pro. The
> > kernel reads the name of these devices directly from the hardware's
> > descriptors, and the names are slightly different between the pen and
> > touch interfaces (the touch device has an extra "Touch" suffix).
> >
> > This patch tweaks how wcmSplitName breaks apart device names in order
> > to handle the MobileStudio Pro and Cintiq Pro. Specifically, it now
> > allows the "subdevice" to contain an arbitrary number of "Pen", "Finger",
> > or "Pad" suffixes. For the MobileStudio Pro and Cintiq Pro, this should
> > allow the "basename" that is considered for sibling device matches
> > to be identical between both the pen and touch interfaces.
> >
> > Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>
> > Signed-off-by: Ping Cheng <ping.ch...@wacom.com <javascript:;>>
> > ---
> >  src/wcmConfig.c | 14 +++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> > index 27c686f..ab82918 100644
> > --- a/src/wcmConfig.c
> > +++ b/src/wcmConfig.c
> > @@ -320,10 +320,18 @@ static void wcmSplitName(char* devicename, char
> *basename, char *subdevice, char
> >   {
> >   *a = '\0';
> >   b = strrchr(name, ' ');
> > - if (b && (!strcmp(b, " Pen") || !strcmp(b, " Finger") ||
> !strcmp(b, " Pad")))
> > +
> > + while (b)
> >   {
> > - *b = '\0';
> > - strncat(subdevice, b+1, len-1);
> > + if (!strcmp(b, " Pen") || !strcmp(b, " Finger") ||
> !strcmp(b, " Pad") || !strcmp(b, " Touch"))
>
> can we break this up over two lines please?


Sure. Can you update the patch and merge it upstream? Thanks.


> > + {
> > + *b = '\0';
> > + strncpy(subdevice, b+1, len-1);
> > + subdevice[len-1] = '\0';
> > + b = strrchr(name, ' ');
> > + }
> > + else
> > + b = NULL;
> >   }
> >   strncat(tool, a+1, len-1);
> >   }
>
> I'm really wondering if we can't have a better approach here, similar to
> libinput's device groups? we can read bits from udev or worst case even
> write out a giant xorg.conf file with static options associations.


That's a great idea. Let's keep the info here so we can come back when we
have time.

The patch itself loks good though, thanks.
>

Thank you for the review. The patch fixes a potential touch switch issue...

Cheers,
Ping
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Make sibling device name matching slightly more lenient

2017-02-06 Thread Ping Cheng
The wcmIsSiblingDevice function uses several tricks to try and determine
if two devices should be considered siblings. If its 'logical_only'
parameter is false, this includes comparing device names. Device name
comparison is complicated by the fact that suffixes are added on by
the X and kernel drivers. To deal with this, the wcmSplitName function
tries to split a device name into three pieces: its "basename" that
describes the model, its "subdevice" name that describes the interface,
and its "tool" name which describes the X11 tool.

Spliting the name is a somewhat kludgy process which does not properly
handle the device names for the MobileStudio Pro or Cintiq Pro. The
kernel reads the name of these devices directly from the hardware's
descriptors, and the names are slightly different between the pen and
touch interfaces (the touch device has an extra "Touch" suffix).

This patch tweaks how wcmSplitName breaks apart device names in order
to handle the MobileStudio Pro and Cintiq Pro. Specifically, it now
allows the "subdevice" to contain an arbitrary number of "Pen", "Finger",
or "Pad" suffixes. For the MobileStudio Pro and Cintiq Pro, this should
allow the "basename" that is considered for sibling device matches
to be identical between both the pen and touch interfaces.

Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
---
 src/wcmConfig.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 27c686f..ab82918 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -320,10 +320,18 @@ static void wcmSplitName(char* devicename, char 
*basename, char *subdevice, char
{
*a = '\0';
b = strrchr(name, ' ');
-   if (b && (!strcmp(b, " Pen") || !strcmp(b, " Finger") || 
!strcmp(b, " Pad")))
+
+   while (b)
{
-   *b = '\0';
-   strncat(subdevice, b+1, len-1);
+   if (!strcmp(b, " Pen") || !strcmp(b, " Finger") || 
!strcmp(b, " Pad") || !strcmp(b, " Touch"))
+   {
+   *b = '\0';
+   strncpy(subdevice, b+1, len-1);
+   subdevice[len-1] = '\0';
+   b = strrchr(name, ' ');
+   }
+   else
+   b = NULL;
}
strncat(tool, a+1, len-1);
}
-- 
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom A 1/2] Add missing pen arbitration function calls

2016-11-17 Thread Ping Cheng
On Wed, Nov 16, 2016 at 11:15 AM, Jason Gerecke <killert...@gmail.com>
wrote:

> The backport of the touch_arbitration parameter (a88d7da) missed a few
> cases where the new 'report_touch_events' or 'delay_pen_events' function
> should have been called. This commit adds them in.
>

Thank you Jason for cleaning up my mess. For A, B, and D sets,

Reviewed-by: Ping Cheng <ping.ch...@wacom.com>.

Cheers,
Ping


> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> ---
>  3.17/wacom_wac.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
> index 20db2f3..f262cc1 100644
> --- a/3.17/wacom_wac.c
> +++ b/3.17/wacom_wac.c
> @@ -1529,8 +1529,10 @@ static int wacom_wac_pen_event(struct hid_device
> *hdev, struct hid_field *field,
> return 0;
> }
>
> -   /* send pen events only when touch is up or forced out */
> -   if (!usage->type || wacom_wac->shared->touch_down)
> +   /* send pen events only when touch is up or forced out
> +* or touch arbitration is off
> +*/
> +   if (!usage->type || delay_pen_events(wacom_wac))
> return 0;
>
> input_event(input, usage->type, usage->code, value);
> @@ -1560,8 +1562,7 @@ static void wacom_wac_pen_report(struct hid_device
> *hdev,
> /* keep pen state for touch events */
> wacom_wac->shared->stylus_in_proximity = prox;
>
> -   /* send pen events only when touch is up or forced out */
> -   if (!wacom_wac->shared->touch_down) {
> +   if (!delay_pen_events(wacom_wac)) {
> input_report_key(input, BTN_TOUCH,
> wacom_wac->hid_data.tipswitch);
> input_report_key(input, wacom_wac->tool[0], prox);
> @@ -1618,7 +1619,7 @@ static void wacom_wac_finger_slot(struct wacom_wac
> *wacom_wac,
> struct hid_data *hid_data = _wac->hid_data;
> bool mt = wacom_wac->features.touch_max > 1;
> bool prox = hid_data->tipswitch &&
> -   !wacom_wac->shared->stylus_in_proximity;
> +   report_touch_events(wacom_wac);
>
> wacom_wac->hid_data.num_received++;
> if (wacom_wac->hid_data.num_received > wacom_wac->hid_data.num_
> expected)
> --
> 2.10.2
>
>
--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: set the 22HD(T) to allow for touch strip modes

2016-10-31 Thread Ping Cheng
On Sun, Oct 30, 2016 at 2:58 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Sat, Oct 29, 2016 at 01:48:49AM +0200, Bastien Nocera wrote:
>> On Fri, 2016-10-28 at 16:23 -0700, Ping Cheng wrote:
>> > On Thu, Oct 27, 2016 at 2:53 AM, Bastien Nocera <had...@hadess.net>
>> > wrote:
>> > > On Thu, 2016-10-27 at 13:39 +1000, Peter Hutterer wrote:
>> > > > There is no physical LED to show the current mode, but the tablet
>> > > > was
>> > > > clearly
>> > > > intended to be used that way [1] and we already reserve two
>> > > > buttons
>> > > > as mode
>> > > > switch buttons anyway. Declare it correctly and let the userspace
>> > > > stack worry
>> > > > about displaying mode switches (it's already responsible for
>> > > > changing
>> > > > LEDs
>> > > > anyway).
>> > > >
>> > > > [1] "The ambidextrous design of the Cintiq 22HD touch features a
>> > > > pair
>> > > > of
>> > > > rear-mounted Touch Strips, along with accompanying Touch Strip
>> > > > Toggle
>> > > > buttons.
>> > > > Each controls up to four application-specific functions, such as
>> > > > brush size,
>> > > > zooming, scrolling and on-screen canvas rotation."
>> > > > https://buywacom.com.au/cintiq-22hd-touch.html
>> > >
>> > > Looks like this would need user-space changes to show an OSD when
>> > > the
>> > > feature is being used. In the meanwhile, I'd hold off on making a
>> > > change until at least one front-end implemented the functionality.
>> >
>> > Maybe it's not a bad idea to make the change now so front-end can
>> > rely
>> > on it when user-space is ready, as long as the change won't break the
>> > existing user-space implementation. Does that make sense?
>>
>> If you made that change without the corresponding user-space changes,
>> you'd have a button that used to work as simply a button, and that now
>> would change modes without any feedback as to which mode it's using.
>
> the buttons are already assigned to the strips. not 100% what gnome does,
> but I'd expect them to be dead right now given they're assigned to the
> strips but the strips have no mode.
>
>> I would at least expect a bug filed explaining the intent (for GNOME I
>> guess), so that Carlos has a chance to look into how we'd hook the UI
>> for this.
>
> see https://bugzilla.gnome.org/show_bug.cgi?id=771098

Then, please merge the patch so we make the request official ;). Maybe
also add the above info to your commit comments.

Thank you both!

Ping

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: set the 22HD(T) to allow for touch strip modes

2016-10-28 Thread Ping Cheng
On Thu, Oct 27, 2016 at 2:53 AM, Bastien Nocera  wrote:
> On Thu, 2016-10-27 at 13:39 +1000, Peter Hutterer wrote:
>> There is no physical LED to show the current mode, but the tablet was
>> clearly
>> intended to be used that way [1] and we already reserve two buttons
>> as mode
>> switch buttons anyway. Declare it correctly and let the userspace
>> stack worry
>> about displaying mode switches (it's already responsible for changing
>> LEDs
>> anyway).
>>
>> [1] "The ambidextrous design of the Cintiq 22HD touch features a pair
>> of
>> rear-mounted Touch Strips, along with accompanying Touch Strip Toggle
>> buttons.
>> Each controls up to four application-specific functions, such as
>> brush size,
>> zooming, scrolling and on-screen canvas rotation."
>> https://buywacom.com.au/cintiq-22hd-touch.html
>
> Looks like this would need user-space changes to show an OSD when the
> feature is being used. In the meanwhile, I'd hold off on making a
> change until at least one front-end implemented the functionality.

Maybe it's not a bad idea to make the change now so front-end can rely
on it when user-space is ready, as long as the change won't break the
existing user-space implementation. Does that make sense?

Ping

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/2] Increase full-scale pressure range from 0..2047 to 0..65535

2016-10-27 Thread Ping Cheng
On Thursday, October 27, 2016, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> On Wed, Oct 26, 2016 at 11:56:57PM -0700, Ping Cheng wrote:
> > On Wednesday, October 26, 2016, Peter Hutterer <peter.hutte...@who-t.net
> <javascript:;>>
> > wrote:
> >
> > > On Wed, Oct 26, 2016 at 06:24:48PM -0700, Ping Cheng wrote:
> > > > On Fri, Oct 7, 2016 at 10:25 AM, Jason Gerecke <killert...@gmail.com
> <javascript:;>
> > > <javascript:;>> wrote:
> > > > > The driver has historically normalized the pressure range of all
> kernel
> > > > > devices to 0..2047 rather than using their native range to keep
> things
> > > > > like the application of the pressure curve simple. Pens that report
> > > more
> > > > > than 2048 pressure levels are also normalized down to this range
> > > though,
> > > > > reducing their precision. In order to accomodate the new 8K pen
> (and
> > > any
> > > > > future pens with even higher precision), this patch bumps up the
> full-
> > > > > scale range to be 0..65535. This number was chosen both because it
> far
> > > > > exceeds anything currently known about, and also because it
> matches the
> > > > > normalization range used over the wire by the Wayland tablet
> protocol.
> > > > >
> > > > > Note that the WACOM_PROP_PRESSURE_THRESHOLD value has been tied to
> the
> > > > > normalized (2048-level) pressure range for some time, meaning that
> we
> > > > > cannot simply change the range without causing a change in the
> > > perceived
> > > > > threshold for users. To ensure compatibility, the value is
> interpreted
> > > > > as a fraction of 2048 and then scaled to the actual normalization
> > > range.
> > > > >
> > > > > Signed-off-by: Jason Gerecke <jason.gere...@wacom.com
> <javascript:;> <javascript:;>>
> > > >
> > > > Reviewed-by: Ping Cheng <pi...@wacom.com <javascript:;>
> <javascript:;>> for the set of
> > > 2 patches.
> > > >
> > > > Thank you for considering backward compatibility. That's a bonus for
> > > > many system admins who use xsetwacom/xinput to configure the driver.
> > > >
> > > > Please update this patch as Peter suggested though.
> > >
> > > uhm, just something else I noticed. we precalculate the pressure
> curve, so
> > > we now have 256 KB in the driver allocated just for the values. We
> should
> > > probably split this out to be allocated on demand
> >
> >
> > How do you plan to make it on demand? Will it add a new API?
>
> Changing pPressCurve[FILTER_PRESSURE_RES + 1] to a dynamically allocated
> memory should be enough, no new API is needed, this is just an
> implementation detail.


Great! That's smart. Then go for it ;).

Cheers,

Ping
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: set the 22HD(T) to allow for touch strip modes

2016-10-27 Thread Ping Cheng
On Wednesday, October 26, 2016, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> There is no physical LED to show the current mode, but the tablet was
> clearly
> intended to be used that way [1] and we already reserve two buttons as mode
> switch buttons anyway. Declare it correctly and let the userspace stack
> worry
> about displaying mode switches (it's already responsible for changing LEDs
> anyway).


If user space agrees with your suggestion, I am all for it!

Reviewed-by: Ping Cheng <pi...@wacom.com>

Thank you for the patch.

Ping


>
> [1] "The ambidextrous design of the Cintiq 22HD touch features a pair of
> rear-mounted Touch Strips, along with accompanying Touch Strip Toggle
> buttons.
> Each controls up to four application-specific functions, such as brush
> size,
> zooming, scrolling and on-screen canvas rotation."
> https://buywacom.com.au/cintiq-22hd-touch.html
>
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net <javascript:;>>
> ---
>  data/cintiq-22hd.tablet  | 2 ++
>  data/cintiq-22hdt.tablet | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/data/cintiq-22hd.tablet b/data/cintiq-22hd.tablet
> index 54f3219..9c32131 100644
> --- a/data/cintiq-22hd.tablet
> +++ b/data/cintiq-22hd.tablet
> @@ -54,3 +54,5 @@ Right=K;L;M;N;J;O;P;Q;R
>
>  Touchstrip=A
>  Touchstrip2=J
> +# Note: no physical LEDs to show mode
> +StripsNumModes=4
> diff --git a/data/cintiq-22hdt.tablet b/data/cintiq-22hdt.tablet
> index 9e74c41..63c5bc5 100644
> --- a/data/cintiq-22hdt.tablet
> +++ b/data/cintiq-22hdt.tablet
> @@ -56,3 +56,5 @@ Right=K;L;M;N;J;O;P;Q;R
>
>  Touchstrip=A
>  Touchstrip2=J
> +# Note: no physical LEDs to show mode
> +StripsNumModes=4
> --
> 2.9.3
>
>
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/2] Increase full-scale pressure range from 0..2047 to 0..65535

2016-10-26 Thread Ping Cheng
On Fri, Oct 7, 2016 at 10:25 AM, Jason Gerecke <killert...@gmail.com> wrote:
> The driver has historically normalized the pressure range of all kernel
> devices to 0..2047 rather than using their native range to keep things
> like the application of the pressure curve simple. Pens that report more
> than 2048 pressure levels are also normalized down to this range though,
> reducing their precision. In order to accomodate the new 8K pen (and any
> future pens with even higher precision), this patch bumps up the full-
> scale range to be 0..65535. This number was chosen both because it far
> exceeds anything currently known about, and also because it matches the
> normalization range used over the wire by the Wayland tablet protocol.
>
> Note that the WACOM_PROP_PRESSURE_THRESHOLD value has been tied to the
> normalized (2048-level) pressure range for some time, meaning that we
> cannot simply change the range without causing a change in the perceived
> threshold for users. To ensure compatibility, the value is interpreted
> as a fraction of 2048 and then scaled to the actual normalization range.
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

Reviewed-by: Ping Cheng <pi...@wacom.com> for the set of 2 patches.

Thank you for considering backward compatibility. That's a bonus for
many system admins who use xsetwacom/xinput to configure the driver.

Please update this patch as Peter suggested though.

Ping

> ---
>  src/wcmXCommand.c   | 6 +-
>  src/xf86WacomDefs.h | 2 +-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
> index 02278ba..403bc84 100644
> --- a/src/wcmXCommand.c
> +++ b/src/wcmXCommand.c
> @@ -256,6 +256,7 @@ void InitWcmDeviceProperties(InputInfoPtr pInfo)
> }
>
> values[0] = (!common->wcmMaxZ) ? 0 : common->wcmThreshold;
> +   values[0] /= (FILTER_PRESSURE_RES / 2048); /* backwards compatibility 
> */
> prop_threshold = InitWcmAtom(pInfo->dev, 
> WACOM_PROP_PRESSURE_THRESHOLD, XA_INTEGER, 32, 1, values);
>
> values[0] = common->wcmSuppress;
> @@ -827,6 +828,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
> XIPropertyValuePtr prop,
> common->wcmCursorProxoutDist = value;
> } else if (property == prop_threshold)
> {
> +   const INT32 MAXIMUM = 2048; /* backwards compatibility */
> INT32 value;
>
> if (prop->size != 1 || prop->format != 32)
> @@ -836,8 +838,10 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
> XIPropertyValuePtr prop,
>
> if (value == -1)
> value = DEFAULT_THRESHOLD;
> -   else if ((value < 1) || (value > FILTER_PRESSURE_RES))
> +   else if ((value < 1) || (value > MAXIMUM))
> return BadValue;
> +   else
> +   value *= (FILTER_PRESSURE_RES / MAXIMUM);
>
> if (!checkonly)
> common->wcmThreshold = value;
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index 1575960..9de9cab 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -183,7 +183,7 @@ struct _WacomModel
>
>  #define IsUSBDevice(common) ((common)->wcmDevCls == )
>
> -#define FILTER_PRESSURE_RES2048/* maximum points in pressure curve */
> +#define FILTER_PRESSURE_RES65536   /* maximum points in pressure curve */
>  /* Tested result for setting the pressure threshold to a reasonable value */
>  #define THRESHOLD_TOLERANCE (FILTER_PRESSURE_RES / 125)
>  #define DEFAULT_THRESHOLD (FILTER_PRESSURE_RES / 75)
> --
> 2.10.0
>

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 01/25] backport: HID: wacom: actually report the battery level for wireless connected

2016-10-24 Thread Ping Cheng
Thank you Aaron for the heavy backward lifting! It is a big bonus for
those users who don't/can't upgrade their systems...

The patchset looks fine to me.

Acked-by: Ping Cheng <pi...@wacom.com>

Ping

On Thu, Oct 20, 2016 at 11:42 AM, Aaron Armstrong Skomra
<sko...@gmail.com> wrote:
> From: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
>
> Since fd5f92b ("HID: wacom: reuse wacom_parse_and_register() in
> wireless_work"), wacom->shared->type is not set.
> Send the information of the battery if we have one.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
> Acked-by: Ping Cheng <pi...@wacom.com>
> Signed-off-by: Jiri Kosina <jkos...@suse.cz>
> [aaron.sko...@wacom.com: Imported into input-wacom repository (d453b87)]
> Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
> [aaron.sko...@wacom.com: Backported from input-wacom repository (ea3af31)]
> Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
> ---
>  2.6.38/wacom_wac.c | 3 ++-
>  3.17/wacom_wac.c   | 3 ++-
>  3.7/wacom_wac.c| 3 ++-
>  3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index 91bf137..379bfdb 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -1547,6 +1547,7 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, 
> size_t len)
>
>  static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
>  {
> +   struct wacom *w = container_of(wacom, struct wacom, wacom_wac);
> unsigned char *data = wacom->data;
> int connected;
>
> @@ -1574,7 +1575,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, 
> size_t len)
> wacom_schedule_work(wacom);
> }
>
> -   if (wacom->shared->type)
> +   if (w->battery.dev)
> wacom_notify_battery(wacom, battery, charging, 1, 0);
>
> } else if (wacom->pid != 0) {
> diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
> index 81df74e..89cbe51 100644
> --- a/3.17/wacom_wac.c
> +++ b/3.17/wacom_wac.c
> @@ -2131,6 +2131,7 @@ static int wacom_bamboo_pad_irq(struct wacom_wac 
> *wacom, size_t len)
>
>  static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
>  {
> +   struct wacom *w = container_of(wacom, struct wacom, wacom_wac);
> unsigned char *data = wacom->data;
> int connected;
>
> @@ -2158,7 +2159,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, 
> size_t len)
> wacom_schedule_work(wacom);
> }
>
> -   if (wacom->shared->type)
> +   if (WACOM_POWERSUPPLY_DEVICE(w->battery))
> wacom_notify_battery(wacom, battery, charging, 1, 0);
>
> } else if (wacom->pid != 0) {
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index 3aac8ea..2a9e173 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -1528,6 +1528,7 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, 
> size_t len)
>
>  static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
>  {
> +   struct wacom *w = container_of(wacom, struct wacom, wacom_wac);
> unsigned char *data = wacom->data;
> int connected;
>
> @@ -1555,7 +1556,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, 
> size_t len)
> wacom_schedule_work(wacom);
> }
>
> -   if (wacom->shared->type)
> +   if (w->battery.dev)
> wacom_notify_battery(wacom, battery, charging, 1, 0);
>
> } else if (wacom->pid != 0) {
> --
> 2.7.4
>

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: the 22HD(T) have virtual modes - note it as a comment

2016-08-30 Thread Ping Cheng
On Monday, August 29, 2016, Peter Hutterer <peter.hutte...@who-t.net> wrote:

> Not adding the actual StripsNumModes entry because this would require
> callers
> to display an OSD for mode changes. Right now callers (GNOME anyway) relies
> on LEDs to show the mode,


Can you add the connection between LED and  mode to the comments of
https://sourceforge.net/p/linuxwacom/libwacom/ci/master/tree/data/wacom.example
?

Except that, the patch is fine.


> not an on-screen notification. Also, since the modes
>
are completely caller-controlled without any LEDs the caller could implement
> any number of modes, not just what libwacom suggests.
>
> Add the modes as a comment so we have an explanation.
>
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net <javascript:;>>


Reviewed-by: Ping Cheng <pi...@wacom.com>

Thanks,

Ping


> ---
>  data/cintiq-22hd.tablet  | 3 +++
>  data/cintiq-22hdt.tablet | 3 +++
>  2 files changed, 6 insertions(+)
>
> diff --git a/data/cintiq-22hd.tablet b/data/cintiq-22hd.tablet
> index 54f3219..bfdffcd 100644
> --- a/data/cintiq-22hd.tablet
> +++ b/data/cintiq-22hd.tablet
> @@ -54,3 +54,6 @@ Right=K;L;M;N;J;O;P;Q;R
>
>  Touchstrip=A
>  Touchstrip2=J
> +# This tablet has mode buttons but no LEDs to signal the current mode to
> the
> +# user and thus requires the caller to display an on-screen notification.
> +# StripsNumModes=4
> diff --git a/data/cintiq-22hdt.tablet b/data/cintiq-22hdt.tablet
> index 9e74c41..6258436 100644
> --- a/data/cintiq-22hdt.tablet
> +++ b/data/cintiq-22hdt.tablet
> @@ -56,3 +56,6 @@ Right=K;L;M;N;J;O;P;Q;R
>
>  Touchstrip=A
>  Touchstrip2=J
> +# This tablet has mode buttons but no LEDs to signal the current mode to
> the
> +# user and thus requires the caller to display an on-screen notification.
> +# StripsNumModes=4
> --
> 2.7.4
>
>
> 
> --
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net <javascript:;>
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 3/3] Make DEVICE_CLOSE a noop

2016-08-18 Thread Ping Cheng
On Wed, Aug 10, 2016 at 9:14 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> The server guarantees that DEVICE_OFF is called for any previously enabled
> device, so we don't really have anything to do here. And since the input
> thread addition to the server we can't safely call xf86RemoveEnabledDevice()
> twice for the same device.
>
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

I tested this set of 3 patches on the xserver built from master of
git.freedesktop.org/git/xorg/xserver. My script that emulates a series
of repeated disconnecting and connecting of Wacom device didn't show
issues related to either X server or Wacom driver. The new X server is
quite robust. And I am more confident with the performance of
xf86-input-wacom than before.

Thank you for your effort here and at freedesktop!

The whole series is: Tested-by: Ping Cheng <pi...@wacom.com>

Cheers,

Ping


> ---
>  src/xf86Wacom.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> index 4127239..40b5c3d 100644
> --- a/src/xf86Wacom.c
> +++ b/src/xf86Wacom.c
> @@ -854,7 +854,6 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what)
> break;
>
> case DEVICE_OFF:
> -   case DEVICE_CLOSE:
> wcmDisableTool(pWcm);
> wcmUnlinkTouchAndPen(pInfo);
> if (pInfo->fd >= 0)
> @@ -864,6 +863,8 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what)
> }
> pWcm->public.on = FALSE;
> break;
> +   case DEVICE_CLOSE:
> +   break;
>  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 100 + 
> GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 1901
> case DEVICE_ABORT:
> break;
> --
> 2.7.4
>
>
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Handle error case of missing parent

2016-08-15 Thread Ping Cheng
On Sun, Aug 14, 2016 at 9:37 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
> Not 100% why this is triggered, but when devices are added/removed like
> crazy (running the libinput test suite with the server trying to pick all of
> them up) the parent can sometimes be null.

It at least serves as a safeguard. So,

Acked-by: Ping Cheng <pi...@wacom.com>.

Cheers,

Ping

>  libwacom/libwacom.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 863dc2a..5ab0ab5 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -267,6 +267,8 @@ get_device_info (const char*path,
> GUdevDevice *parent;
>
> parent = g_udev_device_get_parent (device);
> +   if (!parent)
> +   goto out;
> *name = g_strdup (g_udev_device_get_sysfs_attr (parent, 
> "name"));
> g_object_unref (parent);
> }
> --
> 2.7.4
>
>
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] xsetwacom: refer KeySyms defined by keysymdef.h in man page

2016-08-05 Thread Ping Cheng
xsetwacom accepts keys in X11 KeySyms format. To make the interface
user friendly, we mapped a set of modifiers to aliases that can be
recognized by most users. But, there are a few less recognizable or
confusing keys/modifiers left. This patch tells users where to find
the X11 KeySyms they are looking for.

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 man/xsetwacom.man | 15 +++
 tools/xsetwacom.c |  3 +++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/man/xsetwacom.man b/man/xsetwacom.man
index 1930d67..234e9ba 100644
--- a/man/xsetwacom.man
+++ b/man/xsetwacom.man
@@ -109,7 +109,7 @@ button-number will produce a press of X11 button 3 (i.e. 
right click).
 Action mappings allow button presses to perform many events. They take the form
 of a string of keywords and arguments.
 
-The "key" keyword is following by a list of key names. These can optionally
+The "key" keyword is followed by a list of key names. These can optionally
 be preceded by "+" for press and "-" for release. If +/- is not given,
 press-and-release is assumed, except for modifier keys which are left pressed.
 Key names can be X11 KeySyms or some aliases such as 'shift' or 'f1' (the
@@ -117,9 +117,16 @@ full list can be seen with the
 .B list modifiers
 command).
 
-For example, "key +a +shift b -shift -a" converts the button into a series of
-keystrokes, in this example "press a, press shift, press and release b,
-release shift, release a".
+To assign a key that is not in the modifiers list, use the KeySym in
+/usr/include/X11/keysymdef.h with the XK_ prefix removed or its actual value
+as is. For example, XK_BackSpace should be specified as "BackSpace". "0xff80"
+can also be used to replace "BackSpace" since it's the unique KeySym value of
+Backspace key.
+
+Here is a combined example: "key +a shift b shift -a 0xff0d" converts the
+button into a series of keystrokes. In this example, "press a, press shift,
+press and release b, release shift, release a, then press and release enter".
+"key +a +shift b -shift -a 0xff0d" does the same thing.
 
 The "button" keyword is similar except that its arguments are X11 button
 numbers.
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index f5291ee..bbc92f1 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -939,6 +939,9 @@ static void list_mod(Display *dpy)
m = specialkeys;
while(m->name)
printf("%s\n", m++->name);
+
+   printf("Keys not listed above can be specified via their KeySyms."
+   " See the man page for details.\n");
 }
 
 static void list(Display *dpy, int argc, char **argv)
-- 
1.8.3.1


--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] xsetwacom: refer KeySyms defined by keysymdef.h in man page

2016-08-04 Thread Ping Cheng
On Wed, Aug 3, 2016 at 10:52 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Wed, Aug 03, 2016 at 10:13:48PM -0700, Ping Cheng wrote:
>> xsetwacom accepts keys in X11 KeySyms format. To make the interface
>> user friendly, we mapped a set of modifiers to aliases that can be
>> recognized by most users. But, there are a few less recognizable or
>> confusing keys/modifiers left. This patch tells users where to find
>> the X11 KeySyms code they are looking for.
>>
>> Return key is added as a bonus (by-product ;).
>
> No, please don't add this in the same patch. it's completely unrelated and
> for stable branch cherry-picking, etc. hiding these things in the same patch
> is a bad idea.
>
> Golden rule: when you need to write "Also..." in a commit message you
> probably need two patches :)
>
> Same goes for typo fixes (which IMO you can just push directly, they're
> usually safe anyway).
>
>> Signed-off-by: Ping Cheng <pi...@wacom.com>
>> Tested-by: Kelly Price <strredw...@gmail.com>
>> ---
>>  man/xsetwacom.man | 13 +++--
>>  tools/xsetwacom.c |  4 
>>  2 files changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/man/xsetwacom.man b/man/xsetwacom.man
>> index 1930d67..8276e32 100644
>> --- a/man/xsetwacom.man
>> +++ b/man/xsetwacom.man
>> @@ -109,17 +109,18 @@ button-number will produce a press of X11 button 3 
>> (i.e. right click).
>>  Action mappings allow button presses to perform many events. They take the 
>> form
>>  of a string of keywords and arguments.
>>
>> -The "key" keyword is following by a list of key names. These can optionally
>> +The "key" keyword is followed by a list of key names. These can optionally
>>  be preceded by "+" for press and "-" for release. If +/- is not given,
>>  press-and-release is assumed, except for modifier keys which are left 
>> pressed.
>> -Key names can be X11 KeySyms or some aliases such as 'shift' or 'f1' (the
>> +Key names can be X11 KeySyms code or some aliases such as 'shift' or 'f1' 
>> (the
>
> don't use keysyms code, that's confusing because key code is a specific term
> in X.
> "Key names can be an X11 KeySym or "

I guess key code is not the same as keysym code. What does "The new
keysym code" mean in the following description (from keysymdef.h)?
Does it mean the set of keysym + value?

"
* For any future extension of the keysyms with characters already
 * found in ISO 10646 / Unicode, the following algorithm shall be
 * used. The new keysym code position will simply be the character's
 * Unicode number plus 0x0100. The keysym values in the range
 * 0x01000100 to 0x0110 are reserved to represent Unicode
 * characters in the range U+0100 to U+10.
"

Then what term do I use for the value of a keysym? That value can be
used directly without any confusion or extra work.

Cheers,

Ping

>>  full list can be seen with the
>>  .B list modifiers
>> -command).
>> +command). To assign a key that is not in the modifiers list, look for its 
>> KeySyms
>> +code in keysymdef.h under /usr/include/X11 on your system.
>
> hmm, that makes me wonder why we have special treatment for modifiers. IIRC
> they're just special so we can use "shift" instead of "Shift_L". but we
> should parse the actual keysym as well. maybe a future patch.
> either way:
>
> "To assign a key that is not in the modifiers list use the KeySym in
> /usr/include/X11/keysymdef.h with the XK_ prefix removed.
> For exampmle, XK_BackSpace should be specified as "BackSpace".
>
>
>> -For example, "key +a +shift b -shift -a" converts the button into a series 
>> of
>> -keystrokes, in this example "press a, press shift, press and release b,
>> -release shift, release a".
>> +For example, "key +a +shift b -shift -a 0xff0d" converts the button into a
>> +series of keystrokes, in this example "press a, press shift, press and 
>> release b,
>> +release shift, release a, then enter".
>
> whoah, does this actually work? I didn't know that we parsed hex codes
> correctly.
>
>>  The "button" keyword is similar except that its arguments are X11 button
>>  numbers.
>> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
>> index 2f75d78..aa5f7a1 100644
>> --- a/tools/xsetwacom.c
>> +++ b/tools/xsetwacom.c
>> @@ -605,6 +605,8 @@ static struct modifier specialkeys[] = {
>>
>>   {"backspace", "BackSpace"}, {"Backspace", "BackSpace"},
>&g

Re: [Linuxwacom-devel] [PATCH] xsetwacom: refer KeySyms defined by keysymdef.h in man page

2016-08-04 Thread Ping Cheng
On Wed, Aug 3, 2016 at 10:52 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Wed, Aug 03, 2016 at 10:13:48PM -0700, Ping Cheng wrote:
>> xsetwacom accepts keys in X11 KeySyms format. To make the interface
>> user friendly, we mapped a set of modifiers to aliases that can be
>> recognized by most users. But, there are a few less recognizable or
>> confusing keys/modifiers left. This patch tells users where to find
>> the X11 KeySyms code they are looking for.
>>
>> Return key is added as a bonus (by-product ;).
>
> No, please don't add this in the same patch. it's completely unrelated and
> for stable branch cherry-picking, etc. hiding these things in the same patch
> is a bad idea.
>
> Golden rule: when you need to write "Also..." in a commit message you
> probably need two patches :)
>
> Same goes for typo fixes (which IMO you can just push directly, they're
> usually safe anyway).
>
>> Signed-off-by: Ping Cheng <pi...@wacom.com>
>> Tested-by: Kelly Price <strredw...@gmail.com>
>> ---
>>  man/xsetwacom.man | 13 +++--
>>  tools/xsetwacom.c |  4 
>>  2 files changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/man/xsetwacom.man b/man/xsetwacom.man
>> index 1930d67..8276e32 100644
>> --- a/man/xsetwacom.man
>> +++ b/man/xsetwacom.man
>> @@ -109,17 +109,18 @@ button-number will produce a press of X11 button 3 
>> (i.e. right click).
>>  Action mappings allow button presses to perform many events. They take the 
>> form
>>  of a string of keywords and arguments.
>>
>> -The "key" keyword is following by a list of key names. These can optionally
>> +The "key" keyword is followed by a list of key names. These can optionally
>>  be preceded by "+" for press and "-" for release. If +/- is not given,
>>  press-and-release is assumed, except for modifier keys which are left 
>> pressed.
>> -Key names can be X11 KeySyms or some aliases such as 'shift' or 'f1' (the
>> +Key names can be X11 KeySyms code or some aliases such as 'shift' or 'f1' 
>> (the
>
> don't use keysyms code, that's confusing because key code is a specific term
> in X.
> "Key names can be an X11 KeySym or "
>
>>  full list can be seen with the
>>  .B list modifiers
>> -command).
>> +command). To assign a key that is not in the modifiers list, look for its 
>> KeySyms
>> +code in keysymdef.h under /usr/include/X11 on your system.
>
> hmm, that makes me wonder why we have special treatment for modifiers. IIRC
> they're just special so we can use "shift" instead of "Shift_L". but we
> should parse the actual keysym as well. maybe a future patch.
> either way:

Well, modifier used to mean the key won't do anything by itself until
another(other)
key(s) is pressed. So, modifiers would always have two separate
states: pressed or released.

"Key +shift a -shift" is different from "Key shift a shift"

You made those individual states available to all keys although

"key +a  +shift b -shift- a" is the same as "key a +shift b -shift"

 With that change, all keys could be treated the same way by xsetwacom.

> "To assign a key that is not in the modifiers list use the KeySym in
> /usr/include/X11/keysymdef.h with the XK_ prefix removed.
> For exampmle, XK_BackSpace should be specified as "BackSpace".
>
>> -For example, "key +a +shift b -shift -a" converts the button into a series 
>> of
>> -keystrokes, in this example "press a, press shift, press and release b,
>> -release shift, release a".
>> +For example, "key +a +shift b -shift -a 0xff0d" converts the button into a
>> +series of keystrokes, in this example "press a, press shift, press and 
>> release b,
>> +release shift, release a, then enter".
>
> whoah, does this actually work? I didn't know that we parsed hex codes
> correctly.

Yeah, it was there at the beginning. Since it was too long ago, we
just forgot what we've done...

>>  The "button" keyword is similar except that its arguments are X11 button
>>  numbers.
>> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
>> index 2f75d78..aa5f7a1 100644
>> --- a/tools/xsetwacom.c
>> +++ b/tools/xsetwacom.c
>> @@ -605,6 +605,8 @@ static struct modifier specialkeys[] = {
>>
>>   {"backspace", "BackSpace"}, {"Backspace", "BackSpace"},
>>
>> + {"return", "Return"},
>> +
>
> as said above, this needs to be a separate patch (feel f

[Linuxwacom-devel] [PATCH] xsetwacom: refer KeySyms defined by keysymdef.h in man page

2016-08-03 Thread Ping Cheng
xsetwacom accepts keys in X11 KeySyms format. To make the interface
user friendly, we mapped a set of modifiers to aliases that can be
recognized by most users. But, there are a few less recognizable or
confusing keys/modifiers left. This patch tells users where to find
the X11 KeySyms code they are looking for.

Return key is added as a bonus (by-product ;).

Signed-off-by: Ping Cheng <pi...@wacom.com>
Tested-by: Kelly Price <strredw...@gmail.com>
---
 man/xsetwacom.man | 13 +++--
 tools/xsetwacom.c |  4 
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/man/xsetwacom.man b/man/xsetwacom.man
index 1930d67..8276e32 100644
--- a/man/xsetwacom.man
+++ b/man/xsetwacom.man
@@ -109,17 +109,18 @@ button-number will produce a press of X11 button 3 (i.e. 
right click).
 Action mappings allow button presses to perform many events. They take the form
 of a string of keywords and arguments.
 
-The "key" keyword is following by a list of key names. These can optionally
+The "key" keyword is followed by a list of key names. These can optionally
 be preceded by "+" for press and "-" for release. If +/- is not given,
 press-and-release is assumed, except for modifier keys which are left pressed.
-Key names can be X11 KeySyms or some aliases such as 'shift' or 'f1' (the
+Key names can be X11 KeySyms code or some aliases such as 'shift' or 'f1' (the
 full list can be seen with the
 .B list modifiers
-command).
+command). To assign a key that is not in the modifiers list, look for its 
KeySyms
+code in keysymdef.h under /usr/include/X11 on your system.
 
-For example, "key +a +shift b -shift -a" converts the button into a series of
-keystrokes, in this example "press a, press shift, press and release b,
-release shift, release a".
+For example, "key +a +shift b -shift -a 0xff0d" converts the button into a
+series of keystrokes, in this example "press a, press shift, press and release 
b,
+release shift, release a, then enter".
 
 The "button" keyword is similar except that its arguments are X11 button
 numbers.
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 2f75d78..aa5f7a1 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -605,6 +605,8 @@ static struct modifier specialkeys[] = {
 
{"backspace", "BackSpace"}, {"Backspace", "BackSpace"},
 
+   {"return", "Return"},
+
{"tab", "Tab"},
 
{"PgUp", "Prior"}, {"PgDn", "Next"},
@@ -937,6 +939,8 @@ static void list_mod(Display *dpy)
m = specialkeys;
while(m->name)
printf("%s\n", m++->name);
+
+   printf("If you don't see your special key listed above, please use its 
keysyms code or refer to man page for details.\n");
 }
 
 static void list(Display *dpy, int argc, char **argv)
-- 
1.9.1


--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH input-wacom 1/4] backport: Input: wacom_w8001 - drop use of ABS_MT_TOOL_TYPE

2016-07-14 Thread Ping Cheng
On Wed, Jul 13, 2016 at 3:45 PM, Aaron Armstrong Skomra
<sko...@gmail.com> wrote:
> As of e0361b70175 ("Input: wacom_w8001 - split the touch and pen devices
> into two devices") the touch events aren't multiplexed over the same device
> anymore, the use of ABS_MT_TOOL_TYPE is superfluous. And even before then
> it only ever sent MT_TOOL_TYPE_FINGER anyway.
>
> NOTES: 1) This patch backports the bug where
>  'input_mt_report_slot_state(dev, MT_TOOL_FINGER, touch);' has been removed.
>  This will be corrected in a subsequent patch.
> 2) This backport was accidentally skipped in the previous release and is
>  thus applied out of order.
> 3) e0361b70175 was only backported to 2.6.38 and 3.7.

Your comments trigged Dmitry's action. He reverted the patch upstream
already. Now, you need either to revert it at input-wacom after this
one is merged, or not even bother to push this one out. It's your
call. I have no preference ;).

> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> Signed-off-by: Dmitry Torokhov <dmitry.torok...@gmail.com>
> [jason.gere...@wacom.com: Imported into input-wacom repository (5f7e544)]
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> [aaron.sko...@wacom.com: backported from input-wacom repository (215a2f5)]
> Signed-off-by: Aaron Skomra <aaron.sko...@wacom.com>

The backporting looks good to me. The whole set is:

Reviewed-by: Ping Cheng <pi...@wacom.com>

Ping

> ---
>  2.6.38/wacom_w8001.c | 3 ---
>  3.7/wacom_w8001.c| 3 ---
>  2 files changed, 6 deletions(-)
>
> diff --git a/2.6.38/wacom_w8001.c b/2.6.38/wacom_w8001.c
> index 7946419..1a33fad 100644
> --- a/2.6.38/wacom_w8001.c
> +++ b/2.6.38/wacom_w8001.c
> @@ -155,7 +155,6 @@ static void parse_multi_touch(struct w8001 *w8001)
> bool touch = data[0] & (1 << i);
>
> input_mt_slot(dev, i);
> -   input_mt_report_slot_state(dev, MT_TOOL_FINGER, touch);
> if (touch) {
> x = (data[6 * i + 1] << 7) | data[6 * i + 2];
> y = (data[6 * i + 3] << 7) | data[6 * i + 4];
> @@ -513,8 +512,6 @@ static int w8001_setup_touch(struct w8001 *w8001, char 
> *basename,
> 0, touch.x, 0, 0);
> input_set_abs_params(dev, ABS_MT_POSITION_Y,
> 0, touch.y, 0, 0);
> -   input_set_abs_params(dev, ABS_MT_TOOL_TYPE,
> -   0, MT_TOOL_MAX, 0, 0);
>
> strlcat(basename, " 2FG", basename_sz);
> if (w8001->max_pen_x && w8001->max_pen_y)
> diff --git a/3.7/wacom_w8001.c b/3.7/wacom_w8001.c
> index fe983e7..bab3c6a 100644
> --- a/3.7/wacom_w8001.c
> +++ b/3.7/wacom_w8001.c
> @@ -155,7 +155,6 @@ static void parse_multi_touch(struct w8001 *w8001)
> bool touch = data[0] & (1 << i);
>
> input_mt_slot(dev, i);
> -   input_mt_report_slot_state(dev, MT_TOOL_FINGER, touch);
> if (touch) {
> x = (data[6 * i + 1] << 7) | data[6 * i + 2];
> y = (data[6 * i + 3] << 7) | data[6 * i + 4];
> @@ -514,8 +513,6 @@ static int w8001_setup_touch(struct w8001 *w8001, char 
> *basename,
> 0, touch.x, 0, 0);
> input_set_abs_params(dev, ABS_MT_POSITION_Y,
> 0, touch.y, 0, 0);
> -   input_set_abs_params(dev, ABS_MT_TOOL_TYPE,
> -   0, MT_TOOL_MAX, 0, 0);
>
> strlcat(basename, " 2FG", basename_sz);
> if (w8001->max_pen_x && w8001->max_pen_y)
> --
> 1.9.1
>

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: enable modes on the ExpressKey Remote

2016-07-14 Thread Ping Cheng
On Wed, Jul 13, 2016 at 11:05 AM, Benjamin Tissoires
<benjamin.tissoi...@redhat.com> wrote:
> While it's true modes are read-only and it doesn't change a bit on X.org,
> under wayland, we need to have the number of modes and the toggle key.
>
> The first change in X.org is that now g-s-d calls gsd-wacom-led-helper
> to try to set the LED, but this just fails and no one cares actually.
>
> The second change is that now the OSD shows modes and might be out of
> sync with the actual mode in use. It's not a big issue as right now
> g-c-c doesn't show anything for the EKR so users who are actually using
> the OSD played with dconf and are not beginners. Given that g-c-c needs
> fixes for the EKR, we can also make sure g-s-d updates the mode according
> to what the hardware provides.

It makes sense to me. I bet Aaron knew we would need those info sooner
or later ;).

> Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>

Acked-by: Ping Cheng <pi...@wacom.com>

Cheers,

Ping

> ---
>  data/ek-remote.tablet | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/data/ek-remote.tablet b/data/ek-remote.tablet
> index bc9ff73..4bbe8fb 100644
> --- a/data/ek-remote.tablet
> +++ b/data/ek-remote.tablet
> @@ -22,7 +22,7 @@ Stylus=false
>  Ring=true
>  NumStrips=0
>  Buttons=18
> -#StatusLEDs=Ring
> +StatusLEDs=Ring
>
>  [Buttons]
>  Left=A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R
> @@ -30,5 +30,5 @@ Left=A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R
>  #Note that though this device has 3 ring modes
>  #this mode selection does not function the same
>  #as previous devices. The EKR's mode is read-only.
> -#RingNumModes=3
> +RingNumModes=3
>  Ring=A
> --
> 2.5.5
>
>
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v2 2/3] layouts: fix the anchors of some svg button labels

2016-05-27 Thread Ping Cheng
On Friday, May 27, 2016, Benjamin Tissoires <benjamin.tissoi...@redhat.com>
wrote:

> If g-s-d is to rely on the actual anchor position and orientation of the
> labels, we need to make sure our labels are correct.


Thank you Benjamin for cleanning up the mess. I've never
noticed those start, middle, and end details when I copy/pasted the labels.

The other two patches are sensible to me too. So, the whole series is

Reviewed-by: Ping Cheng <pi...@wacom.com>

Ping


> Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com
> <javascript:;>>
> ---
>
> new in v2
>
>  data/layouts/dtu-1031.svg | 8 
>  data/layouts/intuos-m-p.svg   | 4 ++--
>  data/layouts/intuos-m-p2.svg  | 4 ++--
>  data/layouts/intuos-m-pt.svg  | 4 ++--
>  data/layouts/intuos-m-pt2.svg | 4 ++--
>  data/layouts/intuos-s-p.svg   | 4 ++--
>  data/layouts/intuos-s-p2.svg  | 4 ++--
>  data/layouts/intuos-s-pt.svg  | 4 ++--
>  data/layouts/intuos-s-pt2.svg | 4 ++--
>  9 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/data/layouts/dtu-1031.svg b/data/layouts/dtu-1031.svg
> index f27c14d..04682f2 100644
> --- a/data/layouts/dtu-1031.svg
> +++ b/data/layouts/dtu-1031.svg
> @@ -26,7 +26,7 @@
> class="A Label"
> x="91"
> y="42.5"
> -   style="text-anchor:middle;">A
> +   style="text-anchor:start;">A
>
>
>   @@ -44,7 +44,7 @@
> class="B Label"
> x="91"
> y="62.5"
> -   style="text-anchor:middle;">B
> +   style="text-anchor:start;">B
>
>
>   @@ -62,7 +62,7 @@
> class="C Label"
> x="91"
> y="82.5"
> -   style="text-anchor:middle;">C
> +   style="text-anchor:start;">C
>
>
>   @@ -80,6 +80,6 @@
> class="D Label"
> x="91"
> y="102.5"
> -   style="text-anchor:middle;">D
> +   style="text-anchor:start;">D
>
>  
> diff --git a/data/layouts/intuos-m-p.svg b/data/layouts/intuos-m-p.svg
> index 3cf1f9b..eaf4177 100644
> --- a/data/layouts/intuos-m-p.svg
> +++ b/data/layouts/intuos-m-p.svg
> @@ -22,7 +22,7 @@
>  
>  
>  
> - style="text-anchor:start;">C
> + style="text-anchor:end;">C
>
>
>
> @@ -30,7 +30,7 @@
>  
>  
>  
> - style="text-anchor:start;">D
> + style="text-anchor:end;">D
>
>
>  
> diff --git a/data/layouts/intuos-m-p2.svg b/data/layouts/intuos-m-p2.svg
> index 10ef9ac..dbd8809 100644
> --- a/data/layouts/intuos-m-p2.svg
> +++ b/data/layouts/intuos-m-p2.svg
> @@ -22,7 +22,7 @@
>  
>  
>  
> - style="text-anchor:start;">C
> + style="text-anchor:end;">C
>
>
>
> @@ -30,7 +30,7 @@
>  
>  
>  
> - style="text-anchor:start;">D
> + style="text-anchor:end;">D
>
>
>  
> diff --git a/data/layouts/intuos-m-pt.svg b/data/layouts/intuos-m-pt.svg
> index 0969a59..c952993 100644
> --- a/data/layouts/intuos-m-pt.svg
> +++ b/data/layouts/intuos-m-pt.svg
> @@ -22,7 +22,7 @@
>  
>  
>  
> - style="text-anchor:start;">C
> + style="text-anchor:end;">C
>
>
>
> @@ -30,7 +30,7 @@
>  
>  
>  
> - style="text-anchor:start;">D
> + style="text-anchor:end;">D
>
>
>  
> diff --git a/data/layouts/intuos-m-pt2.svg b/data/layouts/intuos-m-pt2.svg
> index 091613e..a16e4b3 100644
> --- a/data/layouts/intuos-m-pt2.svg
> +++ b/data/layouts/intuos-m-pt2.svg
> @@ -22,7 +22,7 @@
>  
>  
>  
> - style="text-anchor:start;">C
> + style="text-anchor:end;">C
>
>
>
> @@ -30,7 +30,7 @@
>  
>  
>  
> - style="text-anchor:start;">D
> + style="text-anchor:end;">D
>
>
>  
> diff --git a/data/layouts/intuos-s-p.svg b/data/layouts/intuos-s-p.svg
> index fe96474..c833ce0 100644
> --- a/data/layouts/intuos-s-p.svg
> +++ b/data/layouts/intuos-s-p.svg
> @@ -22,7 +22,7 @@
>  
>  
>  
> - style="text-anchor:start;">C
> + style="text-anchor:end;">C
>
>
>
> @@ -30,7 +30,7 @@
>  
>  
>  
> - style="text-anchor:start;">

Re: [Linuxwacom-devel] [PATCH input-wacom] Prevent NULL derefence when bNumEndpoints is 0

2016-05-04 Thread Ping Cheng
On Wed, May 4, 2016 at 2:44 AM, Peter Hutterer <peter.hutte...@who-t.net> wrote:
> On Tue, May 03, 2016 at 03:33:43PM -0700, Jason Gerecke wrote:
>> If a device with a malformed USB interface descriptor that indicates
>> zero enpoints are available is probed by our driver, the system will
>
> typo, endpoints
>
>> crash due to NULL dereferences. This patch implements the fix suggested
>> in the mentioned Red Hat bugs.
>>
>> Ref: CVE-2016-3139
>> Fixes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1556883
>> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1283375
>> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1283377
>>
>> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>> ---
>> Open question: RHEL has no plans to fix this in their tree -- do we want
>> to fix it in input-wacom?

It's a bug fix. We need the patch at least for input-wacom.

Since the patch was initially created by Vladis Dronov
(https://bugzilla.redhat.com/attachment.cgi?id=1099056=diff),
shouldn't we get Vladis' s-o-b?

> yes. RHEL has its own schedule, don't take it as a reference unless you
> *specifically* work on something you intend to get into RHEL only. There are
> a variety of other ways how this patch could end up in a future RHEL
> version.

This patch only affects kernels older than 3.17. If RHEL only
backports patches from kernel.org, the fix won't be in kernel 3.10
unless we submit a patch for those longterm stable versions.

>>  2.6.30/wacom_sys.c | 6 ++
>>  2.6.36/wacom_sys.c | 6 ++
>>  2.6.38/wacom_sys.c | 6 ++
>>  3.7/wacom_sys.c| 6 ++
>>  4 files changed, 24 insertions(+)
>>
>> diff --git a/2.6.30/wacom_sys.c b/2.6.30/wacom_sys.c
>> index c12cb02..473292c 100644
>> --- a/2.6.30/wacom_sys.c
>> +++ b/2.6.30/wacom_sys.c
>> @@ -798,6 +798,12 @@ static int wacom_probe(struct usb_interface *intf, 
>> const struct usb_device_id *i
>>
>>   wacom_wac->input = input_dev;
>>
>> + /* Verify that a device really has an endpoint */
>> + if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
>> + error = -EINVAL;
>> + goto fail3;
>> + }
>> +

I think we want to validate bNumEndpoints before creating other
objects. Something like below would get the job done:

diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c
index 3047773..8afeeb2 100644
--- a/3.7/wacom_sys.c
+++ b/3.7/wacom_sys.c
@@ -1630,6 +1630,10 @@ static int wacom_probe(struct usb_interface
*intf, const struct usb_device_id *i
if (!id->driver_info)
return -EINVAL;

+   /* Verify that a device really has an endpoint */
+   if (intf->cur_altsetting->desc.bNumEndpoints < 1)
+   return -EINVAL;
+
wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
if (!wacom)
return -ENOMEM;

Either way, you get my

Reviewed-by: Ping Cheng <pi...@wacom.com>

Cheers,

Ping

>>   endpoint = >cur_altsetting->endpoint[0].desc;
>>
>>   /* Retrieve the physical and logical size for OEM devices */
>> diff --git a/2.6.36/wacom_sys.c b/2.6.36/wacom_sys.c
>> index eda6175..1d90a91 100644
>> --- a/2.6.36/wacom_sys.c
>> +++ b/2.6.36/wacom_sys.c
>> @@ -885,6 +885,12 @@ static int wacom_probe(struct usb_interface *intf, 
>> const struct usb_device_id *i
>>
>>   wacom_wac->input = input_dev;
>>
>> + /* Verify that a device really has an endpoint */
>> + if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
>> + error = -EINVAL;
>> + goto fail3;
>> + }
>> +
>>   endpoint = >cur_altsetting->endpoint[0].desc;
>>
>>   /* Retrieve the physical and logical size for touch devices */
>> diff --git a/2.6.38/wacom_sys.c b/2.6.38/wacom_sys.c
>> index 7902e21..190e5bc 100644
>> --- a/2.6.38/wacom_sys.c
>> +++ b/2.6.38/wacom_sys.c
>> @@ -1664,6 +1664,12 @@ static int wacom_probe(struct usb_interface *intf, 
>> const struct usb_device_id *i
>>   usb_make_path(dev, wacom->phys, sizeof(wacom->phys));
>>   strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
>>
>> + /* Verify that a device really has an endpoint */
>> + if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
>> + error = -EINVAL;
>> + goto fail3;
>> + }
>> +
>>   endpoint = >cur_altsetting->endpoint[0].desc;
>>
>>   /* set the default size in case we do not get them from hid */
>> diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c
>> index 304

Re: [Linuxwacom-devel] [PATCH libwacom] tools: add a quirk for the HUION Consumer Control device in the udev rules

2016-04-14 Thread Ping Cheng
On Wed, Apr 13, 2016 at 8:28 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Wed, Apr 13, 2016 at 05:43:02PM -0700, Ping Cheng wrote:
>> On Thu, Mar 31, 2016 at 5:44 PM, Peter Hutterer
>> <peter.hutte...@who-t.net> wrote:
>> > These devices have the same VID/PID as the tablet devices but are 
>> > effectively
>> > keyboards. Labelling them as tablets causes a libinput crash (fixed in
>> > libinput with 1.2.1-5-g5d904b6).
>> >
>> > https://bugzilla.redhat.com/show_bug.cgi?id=1314955
>> >
>> > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
>> > ---
>> >  tools/generate-udev-rules.c | 12 
>> >  1 file changed, 12 insertions(+)
>> >
>> > diff --git a/tools/generate-udev-rules.c b/tools/generate-udev-rules.c
>> > index 338ab82..87d43fe 100644
>> > --- a/tools/generate-udev-rules.c
>> > +++ b/tools/generate-udev-rules.c
>> > @@ -52,6 +52,17 @@ static void print_udev_header (void)
>> > printf ("\n");
>> >  }
>> >
>> > +static void print_huion_quirk (void)
>> > +{
>> > +   /* Huion tablets have a "consumer control" device with the same
>> > +* VID/PID as the tablet but only a few buttons and no axes.
>>
>> Is that the same as Wacom Expresskey Remote, the expresskey only device?
>
> no, it's afaict an device for the routing of macros (?) and it doesn't
> correspond to any physical device.
>
>> > +*
>> > +*/
>> > +   printf("# HUION consumer control devices are not tablets.\n");
>>
>> Don't we allow the buttons to be configured later?
>>
>> I don't have the device. So, I'm trying to see the whole picture...
>
> I don't actually know how to trigger events on that, so far no one's
> reported any events coming out of that device :)
> Benjamin has one, maybe he can test it but I suspect it corresponds to a hid
> collection the device announces.

If it is just a fake tablet, let's make sure it won't take the stage ;-).

Thank you for fixing the issue. The patch is

Reviewed-by: Ping Cheng <pi...@wacom.com>

Ping

>> > +   printf("ATTRS{name}==\"HUION * Consumer Control\", 
>> > GOTO=\"libwacom_end\"\n");
>> > +   printf ("\n");
>> > +}
>> > +
>> >  static char * generate_device_match(WacomDevice *device, const WacomMatch 
>> > *match)
>> >  {
>> > WacomBusType type   = libwacom_match_get_bustype (match);
>> > @@ -208,6 +219,7 @@ int main(int argc, char **argv)
>> > }
>> >
>> > print_udev_header ();
>> > +   print_huion_quirk ();
>> > for (p = list; *p; p++)
>> > print_udev_entry ((WacomDevice *) *p, WBUSTYPE_USB);
>> >
>> > --
>> > 2.5.0
>> >
>> >
>> > --
>> > Transform Data into Opportunity.
>> > Accelerate data analysis in your applications with
>> > Intel Data Analytics Acceleration Library.
>> > Click to learn more.
>> > http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140
>> > ___
>> > Linuxwacom-devel mailing list
>> > Linuxwacom-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] isdv4: Use last-known event position in touch up events

2016-04-14 Thread Ping Cheng
On Thu, Apr 14, 2016 at 9:16 AM, Jason Gerecke <killert...@gmail.com> wrote:
> Old serial ISDv4 sensors that (still?!) use the driver-internal parsing
> routines can inadvertantly send (0,0) coordinates to X on touch up.
> Even if a sensor sends (0,0) as the touch up coordinate, the code in
> wcmTouchFilter.c should do the right thing by only sending motion
> eventions while the touch is down. This isn't the case when in-driver
> gestures are disabled though, since motion events (specifically XI_TouchEnd)
> will be sent for touch up events as well.
>
> To prevent potential (0,0) coordinates from being emitted on touch up
> while in-driver gestures are disabled, we use the last-known touch
> position as the current touch position. This mirrors what is done by
> the standard input kernel driver (which leaves X/Y at its last known
> position on touch up).

Sounds sensible to me.

>
> Fixes: https://sourceforge.net/p/linuxwacom/bugs/312/
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

Reviewed-by: Ping Cheng <pingli...@gmail.com>

Ping

> ---
>  src/wcmISDV4.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
> index 95001a1..8cc4483 100644
> --- a/src/wcmISDV4.c
> +++ b/src/wcmISDV4.c
> @@ -625,8 +625,8 @@ static int isdv4ParseTouchPacket(InputInfoPtr pInfo, 
> const unsigned char *data,
> return -1;
> }
>
> -   ds->x = touchdata.x;
> -   ds->y = touchdata.y;
> +   ds->x = touchdata.status ? touchdata.x : last->x;
> +   ds->y = touchdata.status ? touchdata.y : last->y;
> ds->proximity = touchdata.status;
> ds->device_type = TOUCH_ID;
> ds->device_id = TOUCH_DEVICE_ID;
> @@ -651,8 +651,8 @@ static int isdv4ParseTouchPacket(InputInfoPtr pInfo, 
> const unsigned char *data,
> channel = 1;
> ds = >wcmChannel[channel].work;
> RESET_RELATIVE(*ds);
> -   ds->x = touchdata.finger2.x;
> -   ds->y = touchdata.finger2.y;
> +   ds->x = touchdata.finger2.status ? 
> touchdata.finger2.x : lastTemp->x;
> +   ds->y = touchdata.finger2.status ? 
> touchdata.finger2.y : lastTemp->y;
> ds->device_type = TOUCH_ID;
> ds->device_id = TOUCH_DEVICE_ID;
> ds->serial_num = 2;
> --
> 2.8.0
>

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] tools: add a quirk for the HUION Consumer Control device in the udev rules

2016-04-13 Thread Ping Cheng
On Thu, Mar 31, 2016 at 5:44 PM, Peter Hutterer
 wrote:
> These devices have the same VID/PID as the tablet devices but are effectively
> keyboards. Labelling them as tablets causes a libinput crash (fixed in
> libinput with 1.2.1-5-g5d904b6).
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1314955
>
> Signed-off-by: Peter Hutterer 
> ---
>  tools/generate-udev-rules.c | 12 
>  1 file changed, 12 insertions(+)
>
> diff --git a/tools/generate-udev-rules.c b/tools/generate-udev-rules.c
> index 338ab82..87d43fe 100644
> --- a/tools/generate-udev-rules.c
> +++ b/tools/generate-udev-rules.c
> @@ -52,6 +52,17 @@ static void print_udev_header (void)
> printf ("\n");
>  }
>
> +static void print_huion_quirk (void)
> +{
> +   /* Huion tablets have a "consumer control" device with the same
> +* VID/PID as the tablet but only a few buttons and no axes.

Is that the same as Wacom Expresskey Remote, the expresskey only device?

> +*
> +*/
> +   printf("# HUION consumer control devices are not tablets.\n");

Don't we allow the buttons to be configured later?

I don't have the device. So, I'm trying to see the whole picture...

Cheers,

Ping

> +   printf("ATTRS{name}==\"HUION * Consumer Control\", 
> GOTO=\"libwacom_end\"\n");
> +   printf ("\n");
> +}
> +
>  static char * generate_device_match(WacomDevice *device, const WacomMatch 
> *match)
>  {
> WacomBusType type   = libwacom_match_get_bustype (match);
> @@ -208,6 +219,7 @@ int main(int argc, char **argv)
> }
>
> print_udev_header ();
> +   print_huion_quirk ();
> for (p = list; *p; p++)
> print_udev_entry ((WacomDevice *) *p, WBUSTYPE_USB);
>
> --
> 2.5.0
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Add .data files for DTK-1651

2016-04-13 Thread Ping Cheng
svg file was created by our in-house SVG expert, Jason Gerecke.

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 data/dtk-1651.tablet  |  34 +++
 data/layouts/dtk-1651.svg | 144 ++
 2 files changed, 178 insertions(+)
 create mode 100644 data/dtk-1651.tablet
 create mode 100644 data/layouts/dtk-1651.svg

diff --git a/data/dtk-1651.tablet b/data/dtk-1651.tablet
new file mode 100644
index 000..3aff2e6
--- /dev/null
+++ b/data/dtk-1651.tablet
@@ -0,0 +1,34 @@
+# Wacom
+# DTK-1651 Interactive Pen Display
+# Button Map:
+# (A=1, B=2, C=3, ...)
+#
+#  *-*
+#  | | D
+#  | | C
+#  | DISPLAY |
+#  | | B
+#  | | A
+#  *-*
+#
+
+[Device]
+Name=Wacom DTK1651
+DeviceMatch=usb:056a:0343
+Class=PenDisplay
+Width=14
+Height=8
+Layout=dtk-1651.svg
+IntegratedIn=Display
+
+[Features]
+Stylus=true
+Reversible=false
+Touch=false
+Ring=false
+Ring2=false
+NumStrips=0
+Buttons=4
+
+[Buttons]
+Right=A;B;C;D
diff --git a/data/layouts/dtk-1651.svg b/data/layouts/dtk-1651.svg
new file mode 100644
index 000..6141c45
--- /dev/null
+++ b/data/layouts/dtk-1651.svg
@@ -0,0 +1,144 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
+http://www.w3.org/2000/svg;
+version="1.1"
+style="color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8"
+id="dtk-1651"
+width="275"
+height="222">
+  Wacom DTK-1651
+  
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+  
+
+  
+
+
+
+  A
+
+
+  
+  
+
+
+
+  B
+
+
+  
+  
+
+
+
+  C
+
+
+  
+  
+
+
+
+  D
+
+
+  
+
-- 
1.9.1


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH wdaemon 1/2] Cleanup initial values

2016-01-20 Thread Ping Cheng
On Tue, Jan 19, 2016 at 7:11 PM, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> On Tue, Jan 19, 2016 at 06:35:24PM -0800, Ping Cheng wrote:
> > On Tue, Jan 19, 2016 at 6:17 PM, Peter Hutterer <
> peter.hutte...@who-t.net>
> > wrote:
> >
> > > On Tue, Jan 19, 2016 at 05:47:50PM -0800, Ping Cheng wrote:
> > > > On Tue, Jan 19, 2016 at 5:03 PM, Peter Hutterer <
> > > peter.hutte...@who-t.net>
> > > > wrote:
> > > >
> > > > > On Tue, Jan 19, 2016 at 04:29:09PM -0800, Ping Cheng wrote:
> > > > > > Group inital values by device types.
> > > > > >
> > > > > > Signed-off-by: Ping Cheng <pi...@wacom.com>
> > > > > > ---
> > > > > > v2: rely on device type instead of kernel version, as suggested
> by
> > > Peter.
> > > > > > ---
> > > > > >  wacom.c | 67
> > > > > +
> > > > > >  1 file changed, 13 insertions(+), 54 deletions(-)
> > > > > >
> > > > > > diff --git a/wacom.c b/wacom.c
> > > > > > index 32a98c4..3f5a725 100644
> > > > > > --- a/wacom.c
> > > > > > +++ b/wacom.c
> > > > > > @@ -211,26 +211,21 @@ static int wacom_intuos_events(struct
> > > uinput_info
> > > > > *info)
> > > > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_RUBBER);
> > > > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_MOUSE);
> > > > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_LENS);
> > > > > > - if (features->type != INTUOS5S &&
> > > > > > - features->type != INTUOS5M &&
> > > > > > - features->type != INTUOS5L)
> > > > > > + if (features->type != INTUOS)
> > > > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_FINGER);
> > > > >
> > > > > ok, now Im confused. in the previous version you had > INTUOS which
> > > > > would've
> > > > > excluded a couple of devices. Now you're only excluding the
> Intuos1. Is
> > > > > this
> > > > > intended?
> > > > >
> > > >
> > > > Yes, it is intentional.
> > > >
> > > > "> INTUOS" meant INTUOS is not included. All types after INTUOS were
> > > > included, which are Intuos 3 and later, as well as all Cintitqs.
> Now, I
> > > > don't have those types in order. I can not use > INTUOS any more. In
> > > fact,
> > > > "> INTUOS" was unnecessary then. The type enum rearrangement was not
> for
> > > > this statement. It was for the if/switch statement you commented
> below.
> > >
> > > I was referring to the devices < INTUOS that would've been dropped
> with v1
> > >
> >
> > There was no < INTUOS in v1. This was a <= INTUOS3L. But, that was for
> > another loop...
>
> In the current code, the intuos 5 ones don't get the BTN_TOOL_FINGER bit
> set (at least not here).
>

That was a bug in the original code. It should be set.


> in the first version [1], you removed the intous5 condition and replaced it
> with an kernel version check and the condition
>

I see why I got confused. I didn't count the original code/version.

> + if (features->type > INTUOS)
>
> this would've added the tag to everything except PTU, PL, GRAPHIRE, P4,
> PENPARTNER and INTUOS.
>

We are inside wacom_intuos_events. Except INTUOS, all other types mentioned
above won't get into the routine. That's why we only need to consider
INTUOS here.

In the second version [2], you removed the intuos5 condition and replaced it
> with
> > + if (features->type != INTUOS)
>
> so PTU, PL, GRAPHIRE, P4 and PENPARTNER now get the bit set.
>

No, they still don't get the bit set. They are not in wacom_intuos_events
at all.

that's equivalent to the current code, so with v2 you're unsetting
> BTN_TOOL_FINGER from the Intuos, but leaving it in place for everything
> else
> (including Intuos 5 models which were previously excluded)


> [1] http://sourceforge.net/p/linuxwacom/mailman/message/34776688/
> [2] http://sourceforge.net/p/linuxwacom/mailman/message/34779774/
>
> It looks correct enough, but I'm just making sure this is indeed what you
> intended (the commit message should've mentioned this change, "Cleanup" is
> always a bi

Re: [Linuxwacom-devel] [PATCH wdaemon 1/2] Cleanup initial values

2016-01-19 Thread Ping Cheng
On Tue, Jan 19, 2016 at 5:03 PM, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> On Tue, Jan 19, 2016 at 04:29:09PM -0800, Ping Cheng wrote:
> > Group inital values by device types.
> >
> > Signed-off-by: Ping Cheng <pi...@wacom.com>
> > ---
> > v2: rely on device type instead of kernel version, as suggested by Peter.
> > ---
> >  wacom.c | 67
> +
> >  1 file changed, 13 insertions(+), 54 deletions(-)
> >
> > diff --git a/wacom.c b/wacom.c
> > index 32a98c4..3f5a725 100644
> > --- a/wacom.c
> > +++ b/wacom.c
> > @@ -211,26 +211,21 @@ static int wacom_intuos_events(struct uinput_info
> *info)
> >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_RUBBER);
> >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_MOUSE);
> >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_LENS);
> > - if (features->type != INTUOS5S &&
> > - features->type != INTUOS5M &&
> > - features->type != INTUOS5L)
> > + if (features->type != INTUOS)
> >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_FINGER);
>
> ok, now Im confused. in the previous version you had > INTUOS which
> would've
> excluded a couple of devices. Now you're only excluding the Intuos1. Is
> this
> intended?
>

Yes, it is intentional.

"> INTUOS" meant INTUOS is not included. All types after INTUOS were
included, which are Intuos 3 and later, as well as all Cintitqs. Now, I
don't have those types in order. I can not use > INTUOS any more. In fact,
"> INTUOS" was unnecessary then. The type enum rearrangement was not for
this statement. It was for the if/switch statement you commented below.


> > - set_event(info, UI_SET_KEYBIT, BTN_TOUCH);
> >   set_event(info, UI_SET_KEYBIT, BTN_STYLUS2);
> >   set_event(info, UI_SET_KEYBIT, BTN_RIGHT);
> >   set_event(info, UI_SET_KEYBIT, BTN_LEFT);
> >   set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
> >   set_event(info, UI_SET_KEYBIT, BTN_SIDE);
> >   set_event(info, UI_SET_KEYBIT, BTN_EXTRA);
> > - if (features->type != INTUOS5S &&
> > - features->type != INTUOS5M &&
> > - features->type != INTUOS5L)
> > - set_event(info, UI_SET_KEYBIT, BTN_7);
> > - set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
> >
> > - if (features->type != INTUOS5S &&
> > - features->type != INTUOS5M &&
> > - features->type != INTUOS5L) {
> > + if (features->type == INTUOS3S ||
> > + features->type == INTUOS3 ||
> > + features->type == INTUOS3L ||
> > + features->type == CINTIQ ||
> > + features->type == BEE ||
> > + features->type == WACOM_21UX2) {
>
> I'd prefer a switch for simpler fallthrough, but I'm not going to fight too
> hard for this :)
>

Yeah, I paid attention to your suggestion ;-). But, there are only two
states: with RX/Y, or without. We can definitely go with

switch (features->type) {
case INTUOS3S:
case INTUOS3:
case INTUOS3L:
case CINTIQ:
case BEE:
case WACOM_21UX2:
set_event(info, UI_SET_ABSBIT, ABS_RX);
set_event(info, UI_SET_ABSBIT, ABS_RY);
break;
 }

Feel free to merge it in when you push the patch. You have my
signed-off-by, either way.

Thank you for your review.

Ping


> >   set_event(info, UI_SET_ABSBIT, ABS_RX);
> >   set_event(info, UI_SET_ABSBIT, ABS_RY);
> >   }
> > @@ -352,26 +347,14 @@ static int wacom_set_events(struct uinput_info
> *info, struct uinput_user_dev *de
> >   break;
> >   case INTUOS4:
> >   case INTUOS4L:
> > - set_event(info, UI_SET_ABSBIT, ABS_Z);
> > - set_event(info, UI_SET_KEYBIT, BTN_7);
> > - set_event(info, UI_SET_KEYBIT, BTN_8);
> > - /* fall trhu */
> > - case INTUOS4S:
> > - set_event(info, UI_SET_KEYBIT, BTN_0);
> > - set_event(info, UI_SET_KEYBIT, BTN_1);
> > - set_event(info, UI_SET_KEYBIT, BTN_2);
> > - set_event(info, UI_SET_KEYBIT, BTN_3);
> > - set_event(info, UI_SET_KEYBIT, BTN_4);
> > - set_event(info, UI_SET_KEYBIT, BTN_5);
> > - set_event(info, UI_SET_KEYBIT, BTN_6);
> > - wacom_intuos_events(info);
> > - break;
> >   case INTUOS5M:
> >   case INTUOS5L:
> >   set_event(info, UI_SET_KEYBIT, BTN_7);

Re: [Linuxwacom-devel] [PATCH wdaemon 1/2] Cleanup initial values

2016-01-19 Thread Ping Cheng
On Tue, Jan 19, 2016 at 6:17 PM, Peter Hutterer <peter.hutte...@who-t.net>
wrote:

> On Tue, Jan 19, 2016 at 05:47:50PM -0800, Ping Cheng wrote:
> > On Tue, Jan 19, 2016 at 5:03 PM, Peter Hutterer <
> peter.hutte...@who-t.net>
> > wrote:
> >
> > > On Tue, Jan 19, 2016 at 04:29:09PM -0800, Ping Cheng wrote:
> > > > Group inital values by device types.
> > > >
> > > > Signed-off-by: Ping Cheng <pi...@wacom.com>
> > > > ---
> > > > v2: rely on device type instead of kernel version, as suggested by
> Peter.
> > > > ---
> > > >  wacom.c | 67
> > > +
> > > >  1 file changed, 13 insertions(+), 54 deletions(-)
> > > >
> > > > diff --git a/wacom.c b/wacom.c
> > > > index 32a98c4..3f5a725 100644
> > > > --- a/wacom.c
> > > > +++ b/wacom.c
> > > > @@ -211,26 +211,21 @@ static int wacom_intuos_events(struct
> uinput_info
> > > *info)
> > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_RUBBER);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_MOUSE);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_LENS);
> > > > - if (features->type != INTUOS5S &&
> > > > - features->type != INTUOS5M &&
> > > > - features->type != INTUOS5L)
> > > > + if (features->type != INTUOS)
> > > >   set_event(info, UI_SET_KEYBIT, BTN_TOOL_FINGER);
> > >
> > > ok, now Im confused. in the previous version you had > INTUOS which
> > > would've
> > > excluded a couple of devices. Now you're only excluding the Intuos1. Is
> > > this
> > > intended?
> > >
> >
> > Yes, it is intentional.
> >
> > "> INTUOS" meant INTUOS is not included. All types after INTUOS were
> > included, which are Intuos 3 and later, as well as all Cintitqs. Now, I
> > don't have those types in order. I can not use > INTUOS any more. In
> fact,
> > "> INTUOS" was unnecessary then. The type enum rearrangement was not for
> > this statement. It was for the if/switch statement you commented below.
>
> I was referring to the devices < INTUOS that would've been dropped with v1
>

There was no < INTUOS in v1. This was a <= INTUOS3L. But, that was for
another loop...

but included in v2. Since this is the same as the current code, I guess this
> was intentational though and maybe an oversight in v1?
>

I am a bit confused ;-). This is v2 we are looking at. We only had one
version before this one. Do you refer to another version?

Cheers,

Ping

> > > - set_event(info, UI_SET_KEYBIT, BTN_TOUCH);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_STYLUS2);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_RIGHT);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_LEFT);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_SIDE);
> > > >   set_event(info, UI_SET_KEYBIT, BTN_EXTRA);
> > > > - if (features->type != INTUOS5S &&
> > > > - features->type != INTUOS5M &&
> > > > - features->type != INTUOS5L)
> > > > - set_event(info, UI_SET_KEYBIT, BTN_7);
> > > > - set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
> > > >
> > > > - if (features->type != INTUOS5S &&
> > > > - features->type != INTUOS5M &&
> > > > - features->type != INTUOS5L) {
> > > > + if (features->type == INTUOS3S ||
> > > > + features->type == INTUOS3 ||
> > > > + features->type == INTUOS3L ||
> > > > + features->type == CINTIQ ||
> > > > + features->type == BEE ||
> > > > + features->type == WACOM_21UX2) {
> > >
> > > I'd prefer a switch for simpler fallthrough, but I'm not going to
> fight too
> > > hard for this :)
> > >
> >
> > Yeah, I paid attention to your suggestion ;-). But, there are only two
> > states: with RX/Y, or without. We can definitely go with
> >
> > switch (features->type) {
> > case INTUOS3S:
> > case INTUOS3:
> > case INTUOS3L:
> > case CINTIQ:
> > case BEE:
> > case WACOM_21UX2:
> > set_event(info, UI_SET_ABSBIT, ABS_RX);
> >

[Linuxwacom-devel] [PATCH wdaemon 1/2] Cleanup initial values

2016-01-19 Thread Ping Cheng
Group inital values by device types.

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
v2: rely on device type instead of kernel version, as suggested by Peter.
---
 wacom.c | 67 +
 1 file changed, 13 insertions(+), 54 deletions(-)

diff --git a/wacom.c b/wacom.c
index 32a98c4..3f5a725 100644
--- a/wacom.c
+++ b/wacom.c
@@ -211,26 +211,21 @@ static int wacom_intuos_events(struct uinput_info *info)
set_event(info, UI_SET_KEYBIT, BTN_TOOL_RUBBER);
set_event(info, UI_SET_KEYBIT, BTN_TOOL_MOUSE);
set_event(info, UI_SET_KEYBIT, BTN_TOOL_LENS);
-   if (features->type != INTUOS5S &&
-   features->type != INTUOS5M &&
-   features->type != INTUOS5L)
+   if (features->type != INTUOS)
set_event(info, UI_SET_KEYBIT, BTN_TOOL_FINGER);
-   set_event(info, UI_SET_KEYBIT, BTN_TOUCH);
set_event(info, UI_SET_KEYBIT, BTN_STYLUS2);
set_event(info, UI_SET_KEYBIT, BTN_RIGHT);
set_event(info, UI_SET_KEYBIT, BTN_LEFT);
set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
set_event(info, UI_SET_KEYBIT, BTN_SIDE);
set_event(info, UI_SET_KEYBIT, BTN_EXTRA);
-   if (features->type != INTUOS5S &&
-   features->type != INTUOS5M &&
-   features->type != INTUOS5L)
-   set_event(info, UI_SET_KEYBIT, BTN_7);
-   set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
 
-   if (features->type != INTUOS5S &&
-   features->type != INTUOS5M &&
-   features->type != INTUOS5L) {
+   if (features->type == INTUOS3S ||
+   features->type == INTUOS3 ||
+   features->type == INTUOS3L ||
+   features->type == CINTIQ ||
+   features->type == BEE ||
+   features->type == WACOM_21UX2) {
set_event(info, UI_SET_ABSBIT, ABS_RX);
set_event(info, UI_SET_ABSBIT, ABS_RY);
}
@@ -352,26 +347,14 @@ static int wacom_set_events(struct uinput_info *info, 
struct uinput_user_dev *de
break;
case INTUOS4:
case INTUOS4L:
-   set_event(info, UI_SET_ABSBIT, ABS_Z);
-   set_event(info, UI_SET_KEYBIT, BTN_7);
-   set_event(info, UI_SET_KEYBIT, BTN_8);
-   /* fall trhu */
-   case INTUOS4S:
-   set_event(info, UI_SET_KEYBIT, BTN_0);
-   set_event(info, UI_SET_KEYBIT, BTN_1);
-   set_event(info, UI_SET_KEYBIT, BTN_2);
-   set_event(info, UI_SET_KEYBIT, BTN_3);
-   set_event(info, UI_SET_KEYBIT, BTN_4);
-   set_event(info, UI_SET_KEYBIT, BTN_5);
-   set_event(info, UI_SET_KEYBIT, BTN_6);
-   wacom_intuos_events(info);
-   break;
case INTUOS5M:
case INTUOS5L:
set_event(info, UI_SET_KEYBIT, BTN_7);
set_event(info, UI_SET_KEYBIT, BTN_8);
case INTUOS5S:
set_event(info, UI_SET_ABSBIT, ABS_Z);
+   /* fall through */
+   case INTUOS4S:
set_event(info, UI_SET_KEYBIT, BTN_0);
set_event(info, UI_SET_KEYBIT, BTN_1);
set_event(info, UI_SET_KEYBIT, BTN_2);
@@ -416,7 +399,6 @@ static int wacom_set_initial_values(struct uinput_info 
*info,
dev->absmax[ABS_WHEEL] = 71;
/* fall through */
case G4:
-   /* fall through */
case GRAPHIRE:
break;
 
@@ -429,45 +411,22 @@ static int wacom_set_initial_values(struct uinput_info 
*info,
/* fall through */
case INTUOS3S:
dev->absmax[ABS_RX] = 4096;
-   dev->absmax[ABS_Z] = 899;
-   dev->absmin[ABS_Z] = -900;
/* fall through */
-   case INTUOS:
-   dev->absmax[ABS_WHEEL] = 1023;
-   dev->absmax[ABS_TILT_X] = 127;
-   dev->absmax[ABS_TILT_Y] = 127;
-   dev->absmin[ABS_RZ] = -900;
-   dev->absmax[ABS_RZ] = 899;
-   dev->absmin[ABS_THROTTLE] = -1023;
-   dev->absmax[ABS_THROTTLE] = 1023;
-   break;
-   case PL:
-   case PTU:
-   break;
-   case PENPARTNER:
-   break;
-   case TABLETPC:
-   dev->absmax[ABS_RX] = 1023;
-   dev->absmax[ABS_RY] = 1023;
case INTUOS4S:
case INTUOS4:
case INTUOS4L:
-   dev->absmin[ABS_Z] = -900;
-   dev->absmax[ABS_Z] = 899;
-   break;
case INTUOS5S:
case INTUOS5M:
case INTUOS5L:
-   dev->absfuzz[ABS_X] = 4;
-   dev->absfuzz[ABS_Y] = 4;
-   dev->absfuzz[ABS_Y] = 4;
dev->absmin[ABS_Z] =

[Linuxwacom-devel] [PATCH wdaemon 2/2] Add Intuos Pro support

2016-01-19 Thread Ping Cheng
Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 udev/60-wacom.rules   |  3 +++
 udev/wdaemon_is_uinput.sh |  3 +++
 wacom.c   | 12 
 3 files changed, 18 insertions(+)

diff --git a/udev/60-wacom.rules b/udev/60-wacom.rules
index 7f536e3..0e62b35 100644
--- a/udev/60-wacom.rules
+++ b/udev/60-wacom.rules
@@ -76,6 +76,9 @@ ENV{ID_MODEL_ID}=="0027", 
SYMLINK+="input/wacom-tablets/intuos5-t-m input/wacom-
 ENV{ID_MODEL_ID}=="0028", SYMLINK+="input/wacom-tablets/intuos5-t-l 
input/wacom-tablets/intuos5-t-l-%b"
 ENV{ID_MODEL_ID}=="0029", SYMLINK+="input/wacom-tablets/intuos5-s 
input/wacom-tablets/intuos5-s-%b"
 ENV{ID_MODEL_ID}=="002a", SYMLINK+="input/wacom-tablets/intuos5-m 
input/wacom-tablets/intuos5-m-%b"
+ENV{ID_MODEL_ID}=="0314", SYMLINK+="input/wacom-tablets/intuospro-s 
input/wacom-tablets/intuospro-s-%b"
+ENV{ID_MODEL_ID}=="0315", SYMLINK+="input/wacom-tablets/intuospro-m 
input/wacom-tablets/intuospro-m-%b"
+ENV{ID_MODEL_ID}=="0317", SYMLINK+="input/wacom-tablets/intuospro-l 
input/wacom-tablets/intuospro-l-%b"
 ENV{ID_MODEL_ID}=="00cc", SYMLINK+="input/wacom-tablets/cintiq-21ux2 
input/wacom-tablets/cintiq-21ux2-%b"
 
 LABEL="wacom_end"
diff --git a/udev/wdaemon_is_uinput.sh b/udev/wdaemon_is_uinput.sh
index d93f661..3c56c85 100755
--- a/udev/wdaemon_is_uinput.sh
+++ b/udev/wdaemon_is_uinput.sh
@@ -88,6 +88,9 @@ case "$vendor-$product" in
"056a-0028") echo "intuos5-t-l"; ;;
"056a-0029") echo "intuos5-s"; ;;
"056a-002a") echo "intuos5-m"; ;;
+   "056a-0314") echo "intuospro-s"; ;;
+   "056a-0315") echo "intuospro-m"; ;;
+   "056a-0317") echo "intuospro-l"; ;;
"056a-00CC") echo "cintiq-21ux2"; ;;
"056a-00F0") echo "dtu1631"; ;;
"056a-00CE") echo "dtu2231"; ;;
diff --git a/wacom.c b/wacom.c
index 3f5a725..99f0b3d 100644
--- a/wacom.c
+++ b/wacom.c
@@ -99,6 +99,9 @@ enum {
INTUOS5M,
INTUOS5L,
INTUOS5_FG,
+   INTUOSPS,
+   INTUOSPM,
+   INTUOSPL,
MAX_TYPE
 };
 
@@ -181,6 +184,9 @@ static struct wacom_features {
{ "Wacom Intuos5 touch L Finger",  4096,  4096,0,  0, INTUOS5_FG, 
0x28},
{ "Wacom Intuos5 S Pen",  31496, 19685, 2047, 63, INTUOS5S,   
0x29},
{ "Wacom Intuos5 M Pen",  44704, 27940, 2047, 63, INTUOS5M,   
0x2A},
+   { "Wacom Intuos Pro S Pen",   31496, 19685, 2047, 63, INTUOSPS,   
0x314},
+   { "Wacom Intuos Pro M Pen",   44704, 27940, 2047, 63, INTUOSPM,   
0x315},
+   { "Wacom Intuos Pro L Pen",   65024, 40640, 2047, 63, INTUOSPL,   
0x317},
 };
 #define WACOM_N_TABLETS (sizeof(wacom_features)/sizeof(wacom_features[0]))
 int wacom_check_type(int x)
@@ -349,9 +355,12 @@ static int wacom_set_events(struct uinput_info *info, 
struct uinput_user_dev *de
case INTUOS4L:
case INTUOS5M:
case INTUOS5L:
+   case INTUOSPM:
+   case INTUOSPL:
set_event(info, UI_SET_KEYBIT, BTN_7);
set_event(info, UI_SET_KEYBIT, BTN_8);
case INTUOS5S:
+   case INTUOSPS:
set_event(info, UI_SET_ABSBIT, ABS_Z);
/* fall through */
case INTUOS4S:
@@ -418,6 +427,9 @@ static int wacom_set_initial_values(struct uinput_info 
*info,
case INTUOS5S:
case INTUOS5M:
case INTUOS5L:
+   case INTUOSPS:
+   case INTUOSPM:
+   case INTUOSPL:
dev->absmin[ABS_Z] = -900;
dev->absmax[ABS_Z] = 899;
/* fall through */
-- 
1.9.1


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH wdaemon 3/4] Add udev rules for Intuos5 series

2016-01-18 Thread Ping Cheng
It was missed in 228af55

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 udev/60-wacom.rules   | 5 +
 udev/wdaemon_is_uinput.sh | 5 +
 2 files changed, 10 insertions(+)

diff --git a/udev/60-wacom.rules b/udev/60-wacom.rules
index b883364..7f536e3 100644
--- a/udev/60-wacom.rules
+++ b/udev/60-wacom.rules
@@ -71,6 +71,11 @@ ENV{ID_MODEL_ID}=="00b8", 
SYMLINK+="input/wacom-tablets/intuos4-4x6 input/wacom-
 ENV{ID_MODEL_ID}=="00b9", SYMLINK+="input/wacom-tablets/intuos4-6x9 
input/wacom-tablets/intuos4-6x9-%b"
 ENV{ID_MODEL_ID}=="00ba", SYMLINK+="input/wacom-tablets/intuos4-8x13 
input/wacom-tablets/intuos4-8x13-%b"
 ENV{ID_MODEL_ID}=="00bb", SYMLINK+="input/wacom-tablets/intuos4-12x19 
input/wacom-tablets/intuos4-12x19-%b"
+ENV{ID_MODEL_ID}=="0026", SYMLINK+="input/wacom-tablets/intuos5-t-s 
input/wacom-tablets/intuos5-t-s-%b"
+ENV{ID_MODEL_ID}=="0027", SYMLINK+="input/wacom-tablets/intuos5-t-m 
input/wacom-tablets/intuos5-t-m-%b"
+ENV{ID_MODEL_ID}=="0028", SYMLINK+="input/wacom-tablets/intuos5-t-l 
input/wacom-tablets/intuos5-t-l-%b"
+ENV{ID_MODEL_ID}=="0029", SYMLINK+="input/wacom-tablets/intuos5-s 
input/wacom-tablets/intuos5-s-%b"
+ENV{ID_MODEL_ID}=="002a", SYMLINK+="input/wacom-tablets/intuos5-m 
input/wacom-tablets/intuos5-m-%b"
 ENV{ID_MODEL_ID}=="00cc", SYMLINK+="input/wacom-tablets/cintiq-21ux2 
input/wacom-tablets/cintiq-21ux2-%b"
 
 LABEL="wacom_end"
diff --git a/udev/wdaemon_is_uinput.sh b/udev/wdaemon_is_uinput.sh
index a88e0a6..d93f661 100755
--- a/udev/wdaemon_is_uinput.sh
+++ b/udev/wdaemon_is_uinput.sh
@@ -83,6 +83,11 @@ case "$vendor-$product" in
"056a-00B9") echo "intuos4-6x9"; ;;
"056a-00BA") echo "intuos4-8x13"; ;;
"056a-00BB") echo "intuos4-12x19"; ;;
+   "056a-0026") echo "intuos5-t-s"; ;;
+   "056a-0027") echo "intuos5-t-m"; ;;
+   "056a-0028") echo "intuos5-t-l"; ;;
+   "056a-0029") echo "intuos5-s"; ;;
+   "056a-002a") echo "intuos5-m"; ;;
"056a-00CC") echo "cintiq-21ux2"; ;;
"056a-00F0") echo "dtu1631"; ;;
"056a-00CE") echo "dtu2231"; ;;
-- 
1.9.1


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH wdaemon 4/4] Add Intuos Pro support

2016-01-18 Thread Ping Cheng
Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 udev/60-wacom.rules   | 3 +++
 udev/wdaemon_is_uinput.sh | 3 +++
 wacom.c   | 9 +
 3 files changed, 15 insertions(+)

diff --git a/udev/60-wacom.rules b/udev/60-wacom.rules
index 7f536e3..0e62b35 100644
--- a/udev/60-wacom.rules
+++ b/udev/60-wacom.rules
@@ -76,6 +76,9 @@ ENV{ID_MODEL_ID}=="0027", 
SYMLINK+="input/wacom-tablets/intuos5-t-m input/wacom-
 ENV{ID_MODEL_ID}=="0028", SYMLINK+="input/wacom-tablets/intuos5-t-l 
input/wacom-tablets/intuos5-t-l-%b"
 ENV{ID_MODEL_ID}=="0029", SYMLINK+="input/wacom-tablets/intuos5-s 
input/wacom-tablets/intuos5-s-%b"
 ENV{ID_MODEL_ID}=="002a", SYMLINK+="input/wacom-tablets/intuos5-m 
input/wacom-tablets/intuos5-m-%b"
+ENV{ID_MODEL_ID}=="0314", SYMLINK+="input/wacom-tablets/intuospro-s 
input/wacom-tablets/intuospro-s-%b"
+ENV{ID_MODEL_ID}=="0315", SYMLINK+="input/wacom-tablets/intuospro-m 
input/wacom-tablets/intuospro-m-%b"
+ENV{ID_MODEL_ID}=="0317", SYMLINK+="input/wacom-tablets/intuospro-l 
input/wacom-tablets/intuospro-l-%b"
 ENV{ID_MODEL_ID}=="00cc", SYMLINK+="input/wacom-tablets/cintiq-21ux2 
input/wacom-tablets/cintiq-21ux2-%b"
 
 LABEL="wacom_end"
diff --git a/udev/wdaemon_is_uinput.sh b/udev/wdaemon_is_uinput.sh
index d93f661..3c56c85 100755
--- a/udev/wdaemon_is_uinput.sh
+++ b/udev/wdaemon_is_uinput.sh
@@ -88,6 +88,9 @@ case "$vendor-$product" in
"056a-0028") echo "intuos5-t-l"; ;;
"056a-0029") echo "intuos5-s"; ;;
"056a-002a") echo "intuos5-m"; ;;
+   "056a-0314") echo "intuospro-s"; ;;
+   "056a-0315") echo "intuospro-m"; ;;
+   "056a-0317") echo "intuospro-l"; ;;
"056a-00CC") echo "cintiq-21ux2"; ;;
"056a-00F0") echo "dtu1631"; ;;
"056a-00CE") echo "dtu2231"; ;;
diff --git a/wacom.c b/wacom.c
index 2f0cce9..b64915e 100644
--- a/wacom.c
+++ b/wacom.c
@@ -100,6 +100,9 @@ enum {
INTUOS5S,
INTUOS5M,
INTUOS5L,
+   INTUOSPS,
+   INTUOSPM,
+   INTUOSPL,
TABLETPC,
DTU,
INTUOS5_FG,
@@ -185,6 +188,9 @@ static struct wacom_features {
{ "Wacom Intuos5 touch L Finger",  4096,  4096,0,  0, INTUOS5_FG, 
0x28},
{ "Wacom Intuos5 S Pen",  31496, 19685, 2047, 63, INTUOS5S,   
0x29},
{ "Wacom Intuos5 M Pen",  44704, 27940, 2047, 63, INTUOS5M,   
0x2A},
+   { "Wacom Intuos Pro S Pen",   31496, 19685, 2047, 63, INTUOSPS,   
0x314},
+   { "Wacom Intuos Pro M Pen",   44704, 27940, 2047, 63, INTUOSPM,   
0x315},
+   { "Wacom Intuos Pro L Pen",   65024, 40640, 2047, 63, INTUOSPL,   
0x317},
 };
 #define WACOM_N_TABLETS (sizeof(wacom_features)/sizeof(wacom_features[0]))
 int wacom_check_type(int x)
@@ -367,9 +373,12 @@ static int wacom_set_events(struct uinput_info *info, 
struct uinput_user_dev *de
break;
case INTUOS5M:
case INTUOS5L:
+   case INTUOSPM:
+   case INTUOSPL:
set_event(info, UI_SET_KEYBIT, BTN_7);
set_event(info, UI_SET_KEYBIT, BTN_8);
case INTUOS5S:
+   case INTUOSPS:
set_event(info, UI_SET_ABSBIT, ABS_Z);
set_event(info, UI_SET_KEYBIT, BTN_0);
set_event(info, UI_SET_KEYBIT, BTN_1);
-- 
1.9.1


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH wdaemon 1/4] Set Cintiq and Intuos events in a new routine

2016-01-18 Thread Ping Cheng
Those events are set for all devices in current code.

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 wacom.c | 141 ++--
 1 file changed, 57 insertions(+), 84 deletions(-)

diff --git a/wacom.c b/wacom.c
index 4ec3290..cd89aab 100644
--- a/wacom.c
+++ b/wacom.c
@@ -193,6 +193,58 @@ int wacom_get_n_devices(void)
return WACOM_N_TABLETS;
 }
 
+static int wacom_intuos_events(struct uinput_info *info)
+{
+   struct wacom_priv *priv = wacom_priv(info);
+   struct wacom_features *features = _features[priv->type];
+
+   set_event(info, UI_SET_EVBIT, EV_REL);
+   set_event(info, UI_SET_EVBIT, EV_SYN);
+   set_event(info, UI_SET_EVBIT, EV_MSC);
+
+   set_event(info, UI_SET_RELBIT, REL_WHEEL);
+   set_event(info, UI_SET_MSCBIT, MSC_SERIAL);
+
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_PENCIL);
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_BRUSH);
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_AIRBRUSH);
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_RUBBER);
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_MOUSE);
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_LENS);
+   if (features->type != INTUOS5S &&
+   features->type != INTUOS5M &&
+   features->type != INTUOS5L)
+   set_event(info, UI_SET_KEYBIT, BTN_TOOL_FINGER);
+   set_event(info, UI_SET_KEYBIT, BTN_TOUCH);
+   set_event(info, UI_SET_KEYBIT, BTN_STYLUS2);
+   set_event(info, UI_SET_KEYBIT, BTN_RIGHT);
+   set_event(info, UI_SET_KEYBIT, BTN_LEFT);
+   set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
+   set_event(info, UI_SET_KEYBIT, BTN_SIDE);
+   set_event(info, UI_SET_KEYBIT, BTN_EXTRA);
+   if (features->type != INTUOS5S &&
+   features->type != INTUOS5M &&
+   features->type != INTUOS5L)
+   set_event(info, UI_SET_KEYBIT, BTN_7);
+   set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
+
+   if (features->type != INTUOS5S &&
+   features->type != INTUOS5M &&
+   features->type != INTUOS5L) {
+   set_event(info, UI_SET_ABSBIT, ABS_RX);
+   set_event(info, UI_SET_ABSBIT, ABS_RY);
+   }
+   set_event(info, UI_SET_ABSBIT, ABS_RZ);
+   set_event(info, UI_SET_ABSBIT, ABS_TILT_X);
+   set_event(info, UI_SET_ABSBIT, ABS_TILT_Y);
+   set_event(info, UI_SET_ABSBIT, ABS_PRESSURE);
+   set_event(info, UI_SET_ABSBIT, ABS_DISTANCE);
+   set_event(info, UI_SET_ABSBIT, ABS_WHEEL);
+   set_event(info, UI_SET_ABSBIT, ABS_THROTTLE);
+
+   return 0;
+}
+
 static int wacom_set_events(struct uinput_info *info, struct uinput_user_dev 
*dev)
 {
struct wacom_priv *priv = wacom_priv(info);
@@ -201,12 +253,12 @@ static int wacom_set_events(struct uinput_info *info, 
struct uinput_user_dev *de
/* common */
set_event(info, UI_SET_EVBIT, EV_KEY);
set_event(info, UI_SET_EVBIT, EV_ABS);
+   set_event(info, UI_SET_ABSBIT, ABS_X);
+   set_event(info, UI_SET_ABSBIT, ABS_Y);
 
/* touch devices don't have the common features of others */
switch(features->type) {
case INTUOS5_FG:
-   set_event(info, UI_SET_ABSBIT, ABS_X);
-   set_event(info, UI_SET_ABSBIT, ABS_Y);
 #ifdef ABS_MT_SLOT
set_event(info, UI_SET_ABSBIT, ABS_MT_SLOT);
set_event(info, UI_SET_ABSBIT, ABS_MT_TOUCH_MAJOR);
@@ -277,7 +329,6 @@ static int wacom_set_events(struct uinput_info *info, 
struct uinput_user_dev *de
set_event(info, UI_SET_KEYBIT, BTN_7);
/* fall thru */
case INTUOS3S:
-   set_event(info, UI_SET_KEYBIT, BTN_TOOL_FINGER);
set_event(info, UI_SET_KEYBIT, BTN_0);
set_event(info, UI_SET_KEYBIT, BTN_1);
set_event(info, UI_SET_KEYBIT, BTN_2);
@@ -285,25 +336,7 @@ static int wacom_set_events(struct uinput_info *info, 
struct uinput_user_dev *de
set_event(info, UI_SET_ABSBIT, ABS_Z);
/* fall thru */
case INTUOS:
-   set_event(info, UI_SET_EVBIT, EV_MSC);
-   set_event(info, UI_SET_EVBIT, EV_REL);
-
-   set_event(info, UI_SET_MSCBIT, MSC_SERIAL);
-
-   set_event(info, UI_SET_RELBIT, REL_WHEEL);
-
-   set_event(info, UI_SET_KEYBIT, BTN_LEFT);
-   set_event(info, UI_SET_KEYBIT, BTN_RIGHT);
-   set_event(info, UI_SET_KEYBIT, BTN_MIDDLE);
-   set_event(info, UI_SET_KEYBIT, BTN_SIDE);
-   set_event(info, UI_SET_KEYBIT, BTN_EXTRA);
-   set_event(info, UI_SET_KEYBIT, BTN_TOOL_RUBBER);
-   set_event(info, UI_SET_KEYBIT, BTN_TOOL_MOUSE);
-   set_event(info, UI_SET_KEYBIT, BTN_TOOL_BRUSH);
-   set_event(info, UI_SET_KEYBIT, BTN_TOOL_PENCIL);
-

Re: [Linuxwacom-devel] [PATCH input-wacom 1/3] Allow user to specify kernel directory or version independently

2015-12-09 Thread Ping Cheng
On Fri, Dec 4, 2015 at 3:06 PM, Jason Gerecke <killert...@gmail.com> wrote:
> It should be possible to point the ./configure script at a kernel source
> tree and have it work without needing to also specifiy exactly what
> kernel version its looking at. This patch modifies configure.ac so that
> the MODUTS is only set to the output of `uname -r` if neither a kernel
> location nor version is given, and so the "sanity check" process which
> compares the kernel version is able to set MODUTS if it hasn't already
> been.
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

This patch makes compilation across versions a lot easier! The whole set is:

Tested-by: Ping Cheng <pi...@wacom.com>

Ping

> ---
>  configure.ac | 138 
> ---
>  1 file changed, 75 insertions(+), 63 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index cad0258..2e3af9d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -24,48 +24,11 @@ fi
>  AC_MSG_RESULT($WCM_ISLINUX)
>
>  dnl  kernel source, module versioning, etc
> -WCM_ENV_KERNEL=no
> +WCM_ENV_KERNEL=
>  WCM_KERNEL_DIR=
>  WCM_KERNEL_VER=
>  MODUTS=
>
> -dnl Check which version of the driver we should compile
> -AC_ARG_WITH(kernel-version,
> -   AS_HELP_STRING([--with-kernel-version=version], [Specify kernel 
> version]),
> -   [MODUTS="$withval"],
> -   [MODUTS=`uname -r`])
> -
> -AC_MSG_CHECKING(kernel version)
> -AC_MSG_RESULT([$MODUTS])
> -MINOR=`echo $MODUTS | sed 's/[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*/\1/'`
> -if echo $MODUTS | grep "^2.4" >/dev/null; then
> -   AC_MSG_ERROR([kernel 2.4.x is not supported])
> -elif echo $MODUTS | grep "^2.6" >/dev/null; then
> -   if test $MINOR -ge 26; then
> -   case $MINOR in
> -   26|27|28|29|30|31|32|33|34|35) 
> WCM_KERNEL_VER="2.6.30";;
> -   36|37) WCM_KERNEL_VER="2.6.36";;
> -   *) WCM_KERNEL_VER="2.6.38";;
> -   esac
> -   else
> -   AC_MSG_ERROR([use the kernel driver included in the 
> 'linuxwacom' package for kernels older than 2.6.26])
> -   fi
> -elif echo $MODUTS | grep "^3." >/dev/null; then
> -   MINOR=`echo $MODUTS | sed 's/[[0-9]]*\.\([[0-9]]*\).*/\1/'`
> -   if test $MINOR -ge 17; then
> -   WCM_KERNEL_VER="3.17"
> -   elif test $MINOR -ge 7; then
> -   WCM_KERNEL_VER="3.7"
> -   else
> -   WCM_KERNEL_VER="2.6.38"
> -   fi
> -elif echo $MODUTS | grep "^4." >/dev/null; then
> -   WCM_KERNEL_VER="3.17"
> -else
> -   AC_MSG_ERROR(kernel version $MODUTS not supported)
> -fi
> -
> -dnl Check for kernel build environment
>  AC_DEFUN([WCM_ISBUILDDIR], [\
>  \( -f "$1/.config" -o \
> -f "$1/include/config/auto.conf" -o \
> @@ -76,13 +39,28 @@ AC_ARG_WITH(kernel,
> AS_HELP_STRING([--with-kernel=dir], [Specify kernel source 
> directory]),
> [WCM_KERNEL_DIR="$withval"])
>
> +AC_ARG_WITH(kernel-version,
> +   AS_HELP_STRING([--with-kernel-version=version], [Specify kernel 
> version]),
> +   [MODUTS="$withval"])
> +
> +
> +dnl Assume the user wants to build for the running kernel version if neither
> +dnl the kernel directory nor version has been specified
> +if test "$WCM_KERNEL_DIR" = "yes" -o -z "$WCM_KERNEL_DIR"; then
> +   if test "$MODUTS" = "yes" -o -z "$MODUTS"; then
> +   MODUTS=`uname -r`
> +   fi
> +fi
> +
> +dnl Discover the kernel source location if not already set
>  AC_MSG_CHECKING(for kernel source/headers)
>  if test "$WCM_KERNEL_DIR" = "yes" -o -z "$WCM_KERNEL_DIR"; then
> +   if test "$MODUTS" = "yes" -o -z "$MODUTS"; then X=`uname -r`; else 
> X="$MODUTS"; fi
> AC_DEFUN([SEARCH_DIRECTORIES], [[
> - [/lib/modules/$MODUTS/source],
> - [/lib/modules/$MODUTS/build],
> + [/lib/modules/$X/source],
> + [/lib/modules/$X/build],
>   [/usr/src/linux],
> - [/usr/src/linux-$MODUTS],
> + [/usr/src/linux-$X],
>   [/usr/src/linux-2.6]
> ]])
> WCM_KERNEL_DIR=
> @@ -91,37 +69,71 @@ if test "$WCM_KERNEL_DIR" = "yes" -o -z 
> "$WCM_KERNEL_DIR"; then
> if test -z "$WCM_KERNEL_DIR"; then
> 

Re: [Linuxwacom-devel] [PATCH input-wacom] Enable additional compile warnings

2015-12-02 Thread Ping Cheng
On Monday, November 30, 2015, Jason Gerecke <killert...@gmail.com> wrote:

> Adds -Werror and -Wextra to the list of kernel CFLAGS so that we can be
> made aware of more potential issues with the code.
>
> -Wunused-parameter is explicitly disabled because unused parameters are
> quite common throughout the kernel, producing copious amounts of noise.
>
> -Wmissing-field-initializers is explicitly disabled because wacom_wac.c
> relies heavily on implicit initialization (despite not being "officially"
> supported by the gnu89 standard).
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com <javascript:;>>


It's a very good idea to make sure we take care of important warnings
before submitting patches upstream. Thank you Jason.

Acked-by: Ping Cheng <pi...@wacom.com>

Ping

---
>  2.6.30/Makefile.in | 2 +-
>  2.6.36/Makefile.in | 2 +-
>  2.6.38/Makefile.in | 2 +-
>  3.17/Makefile.in   | 2 +-
>  3.7/Makefile.in| 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/2.6.30/Makefile.in b/2.6.30/Makefile.in
> index bdabfe0..e2e7727 100644
> --- a/2.6.30/Makefile.in
> +++ b/2.6.30/Makefile.in
> @@ -6,7 +6,7 @@ ifneq ($(KERNELRELEASE),)
>
>  ifneq ($(CONFIG_USB_WACOM),y)
>  WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen)
> -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\"
> +ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra
> -Wno-unused-parameter -Wno-missing-field-initializers
>  wacom-objs := wacom_wac.o wacom_sys.o
>  obj-m += wacom.o
>  obj-m += wacom_w8001.o
> diff --git a/2.6.36/Makefile.in b/2.6.36/Makefile.in
> index bdabfe0..e2e7727 100644
> --- a/2.6.36/Makefile.in
> +++ b/2.6.36/Makefile.in
> @@ -6,7 +6,7 @@ ifneq ($(KERNELRELEASE),)
>
>  ifneq ($(CONFIG_USB_WACOM),y)
>  WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen)
> -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\"
> +ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra
> -Wno-unused-parameter -Wno-missing-field-initializers
>  wacom-objs := wacom_wac.o wacom_sys.o
>  obj-m += wacom.o
>  obj-m += wacom_w8001.o
> diff --git a/2.6.38/Makefile.in b/2.6.38/Makefile.in
> index 3e7168e..1e5978c 100644
> --- a/2.6.38/Makefile.in
> +++ b/2.6.38/Makefile.in
> @@ -6,7 +6,7 @@ ifneq ($(KERNELRELEASE),)
>
>  ifneq ($(CONFIG_USB_WACOM),y)
>  WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen)
> -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\"
> +ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra
> -Wno-unused-parameter -Wno-missing-field-initializers
>  wacom-objs := wacom_wac.o wacom_sys.o
>  obj-m += wacom.o
>  obj-m += wacom_w8001.o
> diff --git a/3.17/Makefile.in b/3.17/Makefile.in
> index b41b1c6..69b19e1 100644
> --- a/3.17/Makefile.in
> +++ b/3.17/Makefile.in
> @@ -6,7 +6,7 @@ ifneq ($(KERNELRELEASE),)
>
>  ifneq ($(CONFIG_HID_WACOM),y)
>  WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen)
> -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\"
> +ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra
> -Wno-unused-parameter -Wno-missing-field-initializers
>  wacom-objs := wacom_wac.o wacom_sys.o
>  obj-m += wacom.o
>  obj-m += wacom_w8001.o
> diff --git a/3.7/Makefile.in b/3.7/Makefile.in
> index c455b31..7d6db95 100644
> --- a/3.7/Makefile.in
> +++ b/3.7/Makefile.in
> @@ -6,7 +6,7 @@ ifneq ($(KERNELRELEASE),)
>
>  ifneq ($(CONFIG_USB_WACOM),y)
>  WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen)
> -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\"
> +ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra
> -Wno-unused-parameter -Wno-missing-field-initializers
>  wacom-objs := wacom_wac.o wacom_sys.o
>  obj-m += wacom.o
>  obj-m += wacom_w8001.o
> --
> 2.6.2
>
>
--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH libwacom 1/2] Add .data files for Intuos series

2015-11-04 Thread Ping Cheng
All svg files are created based on intuos-m-p.svg. People with
Inkscape experience can fine-tune the layouts if necessay.

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 data/intuos-m-pt.tablet  |  2 +-
 data/intuos-s-p.tablet   |  2 +-
 data/intuos-s-pt.tablet  |  2 +-
 data/layouts/intuos-m-p.svg  |  2 +-
 data/layouts/intuos-m-pt.svg | 36 
 data/layouts/intuos-s-p.svg  | 36 
 data/layouts/intuos-s-pt.svg | 36 
 7 files changed, 112 insertions(+), 4 deletions(-)
 create mode 100644 data/layouts/intuos-m-pt.svg
 create mode 100644 data/layouts/intuos-s-p.svg
 create mode 100644 data/layouts/intuos-s-pt.svg

diff --git a/data/intuos-m-pt.tablet b/data/intuos-m-pt.tablet
index 0d5d75c..51ba798 100644
--- a/data/intuos-m-pt.tablet
+++ b/data/intuos-m-pt.tablet
@@ -39,7 +39,7 @@ DeviceMatch=usb:056a:0303
 Class=Bamboo
 Width=9
 Height=5
-#Layout=intuos-m-pt.svg
+Layout=intuos-m-pt.svg
 IntegratedIn=
 
 [Features]
diff --git a/data/intuos-s-p.tablet b/data/intuos-s-p.tablet
index 373b50d..166ade2 100644
--- a/data/intuos-s-p.tablet
+++ b/data/intuos-s-p.tablet
@@ -24,7 +24,7 @@ DeviceMatch=usb:056a:030e
 Class=Bamboo
 Width=6
 Height=4
-#Layout=intuos-s-p.svg
+Layout=intuos-s-p.svg
 IntegratedIn=
 
 [Features]
diff --git a/data/intuos-s-pt.tablet b/data/intuos-s-pt.tablet
index 0585ed2..92698b6 100644
--- a/data/intuos-s-pt.tablet
+++ b/data/intuos-s-pt.tablet
@@ -39,7 +39,7 @@ DeviceMatch=usb:056a:0302
 Class=Bamboo
 Width=6
 Height=4
-#Layout=intuos-s-pt.svg
+Layout=intuos-s-pt.svg
 IntegratedIn=
 
 [Features]
diff --git a/data/layouts/intuos-m-p.svg b/data/layouts/intuos-m-p.svg
index f5495eb..3cf1f9b 100644
--- a/data/layouts/intuos-m-p.svg
+++ b/data/layouts/intuos-m-p.svg
@@ -2,7 +2,7 @@
 http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
 
-http://www.w3.org/2000/svg; version="1.1" 
style="color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" 
id="intuos-s-p" width="275" height="222">
+http://www.w3.org/2000/svg; version="1.1" 
style="color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" 
id="intuos-m-p" width="275" height="222">
   Wacom Intuos Pen Medium (CTL-680)
   
 
diff --git a/data/layouts/intuos-m-pt.svg b/data/layouts/intuos-m-pt.svg
new file mode 100644
index 000..0969a59
--- /dev/null
+++ b/data/layouts/intuos-m-pt.svg
@@ -0,0 +1,36 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
+
+http://www.w3.org/2000/svg; version="1.1" 
style="color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" 
id="intuos-m-pt" width="275" height="222">
+  Wacom Intuos PT Medium (CTH-680)
+  
+
+
+
+A
+  
+
+  
+
+
+
+B
+  
+
+  
+
+
+
+C
+  
+
+
+  
+
+
+
+D
+  
+
+
diff --git a/data/layouts/intuos-s-p.svg b/data/layouts/intuos-s-p.svg
new file mode 100644
index 000..fe96474
--- /dev/null
+++ b/data/layouts/intuos-s-p.svg
@@ -0,0 +1,36 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
+
+http://www.w3.org/2000/svg; version="1.1" 
style="color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" 
id="intuos-s-p" width="275" height="222">
+  Wacom Intuos Pen Small (CTL-480)
+  
+
+
+
+A
+  
+
+  
+
+
+
+B
+  
+
+  
+
+
+
+C
+  
+
+
+  
+
+
+
+D
+  
+
+
diff --git a/data/layouts/intuos-s-pt.svg b/data/layouts/intuos-s-pt.svg
new file mode 100644
index 000..326d4ea
--- /dev/null
+++ b/data/layouts/intuos-s-pt.svg
@@ -0,0 +1,36 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
+
+http://www.w3.org/2000/svg; version="1.1" 
style="color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" 
id="intuos-s-pt" width="275" height="222">
+  Wacom Intuos PT Small (CTH-480)
+  
+
+
+
+A
+  
+
+  
+
+
+
+B
+  
+
+  
+
+
+
+C
+  
+
+
+  
+
+
+
+D
+  
+
+
-- 
1.9.1


--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH libwacom 2/2] Add .data files for Intuos 2 series

2015-11-04 Thread Ping Cheng
A new stylus id, 0x8e2, is added to libwacom.stylus since
stylus for this series reports data in old Intuos format,
which support tool serial number and tool ID.

Signed-off-by: Ping Cheng <pi...@wacom.com>
---
 data/intuos-m-p2.tablet   | 41 
 data/intuos-m-pt2.tablet  | 55 +++
 data/intuos-s-p2.tablet   | 38 ++
 data/intuos-s-pt2.tablet  | 54 ++
 data/layouts/intuos-m-p2.svg  | 36 
 data/layouts/intuos-m-pt2.svg | 36 
 data/layouts/intuos-s-p2.svg  | 36 
 data/layouts/intuos-s-pt2.svg | 36 
 data/libwacom.stylus  |  8 +++
 test/tablet-validity.c|  2 +-
 10 files changed, 341 insertions(+), 1 deletion(-)
 create mode 100644 data/intuos-m-p2.tablet
 create mode 100644 data/intuos-m-pt2.tablet
 create mode 100644 data/intuos-s-p2.tablet
 create mode 100644 data/intuos-s-pt2.tablet
 create mode 100644 data/layouts/intuos-m-p2.svg
 create mode 100644 data/layouts/intuos-m-pt2.svg
 create mode 100644 data/layouts/intuos-s-p2.svg
 create mode 100644 data/layouts/intuos-s-pt2.svg

diff --git a/data/intuos-m-p2.tablet b/data/intuos-m-p2.tablet
new file mode 100644
index 000..40111e4
--- /dev/null
+++ b/data/intuos-m-p2.tablet
@@ -0,0 +1,41 @@
+# Wacom
+# Intuos Pen Medium
+# CTL-690
+#
+# Successor of Bamboo3 series while stylus
+# is in Intuos stylus format
+#
+# stylus with two buttons and no eraser
+# Pen active area: 8.5 x 5.3in
+#
+# Button Map:
+# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
+#
+# A C
+#  B   D
+#*---*
+#|   |
+#|   |
+#|TABLET |
+#|   |
+#|   |
+#*---*
+
+[Device]
+Name=Intuos Pen Medium
+DeviceMatch=usb:056a:033d
+Class=Intuos
+Width=9
+Height=5
+Layout=intuos-m-p2.svg
+IntegratedIn=
+Styli=0x8e2;
+
+[Features]
+Stylus=true
+Reversible=true
+Buttons=4
+
+[Buttons]
+Left=A;B
+Right=C;D
diff --git a/data/intuos-m-pt2.tablet b/data/intuos-m-pt2.tablet
new file mode 100644
index 000..58a8331
--- /dev/null
+++ b/data/intuos-m-pt2.tablet
@@ -0,0 +1,55 @@
+# Wacom
+# Intuos Pen & Touch Medium
+# CTH-690
+#
+# Successor of Bamboo3 series while stylus
+# is in Intuos stylus format
+#
+# stylus with two buttons and no eraser; 16FG touch
+# Pen active area: 8.5 x 5.3in
+# Touch active area: 8.5 x 5.3in
+#
+# Button Map:
+# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
+#
+# A C
+#  B   D
+#*---*
+#|   |
+#|   |
+#|TABLET |
+#|   |
+#|   |
+#*---*
+#
+# Touch Switch Map:
+# (on the edge of top right corner; switch to right: touch off; switch to 
left: touch on)
+#
+#   S
+#*---*
+#|   |
+#|   |
+#|TABLET |
+#|   |
+#|   |
+#*---*
+
+[Device]
+Name=Intuos Pen & Touch Medium
+DeviceMatch=usb:056a:033e
+Class=Intuos
+Width=9
+Height=5
+Layout=intuos-m-pt2.svg
+IntegratedIn=
+Styli=0x8e2;
+
+[Features]
+Stylus=true
+Reversible=true
+Touch=true
+Buttons=4
+TouchSwitch=true
+
+[Buttons]
+Top=A;B;C;D
diff --git a/data/intuos-s-p2.tablet b/data/intuos-s-p2.tablet
new file mode 100644
index 000..cadb0e1
--- /dev/null
+++ b/data/intuos-s-p2.tablet
@@ -0,0 +1,38 @@
+# Wacom
+# Intuos Pen Small
+# CTL-490
+#
+# Successor of Bamboo3 series while stylus
+# is in Intuos stylus format
+#
+# stylus with two buttons and no eraser
+# Pen active area: 6.0 x 3.7in
+#
+# Button Map:
+# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
+#
+# A C
+#  B   D
+#*---*
+#|   |
+#|TABLET |
+#|   |
+#*---*
+
+[Device]
+Name=Intuos Pen Small
+DeviceMatch=usb:056a:033b
+Class=Intuos
+Width=6
+Height=4
+Layout=intuos-s-p2.svg
+IntegratedIn=
+Styli=0x8e2;
+
+[Features]
+Stylus=true
+Reversible=true
+Buttons=4
+
+[Buttons]
+Top=A;B;C;D
diff --git a/data/intuos-s-pt2.tablet b/data/intuos-s-pt2.tablet
new file mode 100644
index 000..2252af2
--- /dev/null
+++ b/data/intuos-s-pt2.tablet
@@ -0,0 +1,54 @@
+# Wacom
+# Intuos Pen & Touch Small
+# CTH-490
+#
+# Successor of Bamboo3 series while stylus
+# is in Intuos stylus format
+#
+# stylus with two buttons and eraser; 16FG touch
+# Pen active area: 6.0 x 3.7in
+# Touch active area: 6.0 x 3.7in
+#
+# Button Map:
+# (A=RIGHT, B=LEFT, C=F

Re: [Linuxwacom-devel] [PATCH input-wacom] Fix powersupply issue for Wacom ExpressKey Remote

2015-10-07 Thread Ping Cheng
On Wed, Oct 7, 2015 at 4:52 PM, Jason Gerecke <killert...@gmail.com> wrote:

> As outlined in commit ea90b47, the power supply interface changed around
> Linux 4.1. This patch fixes up the usage of that interface by the
> ExpressKey Remote which was introduced in 6efc626.
>
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
>

Reviewed-by: Ping Cheng <pi...@wacom.com>

Thank you Jason for the quick fix.

Ping

---
>  3.17/wacom_wac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
> index 9850ffe..972c735 100644
> --- a/3.17/wacom_wac.c
> +++ b/3.17/wacom_wac.c
> @@ -698,7 +698,7 @@ static int wacom_remote_irq(struct wacom_wac
> *wacom_wac, size_t len)
> wacom->led.select[i] = touch_ring_mode;
> }
>
> -   if (!wacom->battery &&
> +   if (!WACOM_POWERSUPPLY_DEVICE(wacom->battery) &&
> !(features->quirks & WACOM_QUIRK_BATTERY)) {
> features->quirks |= WACOM_QUIRK_BATTERY;
> INIT_WORK(>work, wacom_battery_work);
> --
> 2.6.1
>
>
--
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] data: the model name of Cintiq 21UX is DTZ-2100

2015-04-24 Thread Ping Cheng
Just to correct the device model name.

Signed-off-by: Ping Cheng pi...@wacom.com
---
 data/cintiq-21ux.tablet | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/cintiq-21ux.tablet b/data/cintiq-21ux.tablet
index 69e8d4a..b905c1b 100644
--- a/data/cintiq-21ux.tablet
+++ b/data/cintiq-21ux.tablet
@@ -1,6 +1,6 @@
 # Wacom
 # Cintiq 21UX
-# DTZ-2231
+# DTZ-2100
 #
 # Button Map:
 # (A=1, B=2, C=3, ...)
-- 
1.9.1


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 2/2] data: cintiq 22hdt supports touch

2015-04-21 Thread Ping Cheng
Signed-off-by: Ping Cheng pi...@wacom.com
---
 data/cintiq-22hdt.tablet | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/cintiq-22hdt.tablet b/data/cintiq-22hdt.tablet
index c79f274..cc801ac 100644
--- a/data/cintiq-22hdt.tablet
+++ b/data/cintiq-22hdt.tablet
@@ -44,7 +44,7 @@ IntegratedIn=Display
 [Features]
 Stylus=true
 Reversible=false
-Touch=false
+Touch=true
 Ring=false
 NumStrips=2
 Buttons=18
-- 
1.9.1


--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 1/2] data: add cintiq 13hdt tablet

2015-04-21 Thread Ping Cheng
Signed-off-by: Ping Cheng pi...@wacom.com
---
 data/cintiq-13hdt.tablet | 43 +++
 1 file changed, 43 insertions(+)
 create mode 100644 data/cintiq-13hdt.tablet

diff --git a/data/cintiq-13hdt.tablet b/data/cintiq-13hdt.tablet
new file mode 100644
index 000..15a3499
--- /dev/null
+++ b/data/cintiq-13hdt.tablet
@@ -0,0 +1,43 @@
+# Wacom
+# Cintiq 13HD touch
+# DTH-1300
+#
+# Button Map:
+# (A=1, B=2, C=3, ...)
+#
+#  *---*
+#  |   |
+#B |   |
+#C |   |
+#  |   |
+#G |   |
+#  H A F   |DISPLAY|
+#I |   |
+#  |   |
+#D |   |
+#E |   |
+#  |   |
+#  *---*
+#
+# Note: Buttons F, G, H, I are on a circle
+#   touch data comes through the usb:056a:0335 interface
+
+[Device]
+Name=Wacom Cintiq 13HD touch
+Class=Cintiq
+DeviceMatch=usb:056a:0333
+Width=12
+Height=7
+Layout=cintiq-13hd.svg
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
+IntegratedIn=Display
+
+[Features]
+Stylus=true
+Reversible=false
+Touch=true
+Ring=false
+Buttons=9
+
+[Buttons]
+Left=B;C;G;H;A;F;I;D;E
-- 
1.9.1


--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Allow PAD only interfaces without EV_ABS and/or EV_X/Y to report events

2015-03-18 Thread Ping Cheng
On Wed, Mar 18, 2015 at 3:22 PM, Benjamin Tissoires
benjamin.tissoi...@gmail.com wrote:
 On Sun, Mar 15, 2015 at 10:01 PM, Peter Hutterer
 peter.hutte...@who-t.net wrote:
 On Fri, Mar 13, 2015 at 11:24:27AM -0400, Benjamin Tissoires wrote:
 commit 0cfe113 (Allow PAD only interface without setting up EV_ABS
 and/or EV_X/Y) allows xf86-input-wacom to handle Pad only interface but
 such interface do not report any events.

 We need to call usbWcmInitPadState() to be able to forward events.

 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@redhat.com
 ---
  src/wcmUSB.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

 diff --git a/src/wcmUSB.c b/src/wcmUSB.c
 index bac3c66..1efcb5b 100644
 --- a/src/wcmUSB.c
 +++ b/src/wcmUSB.c
 @@ -549,7 +549,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
   /* may be an expresskey only interface */
   if (ISBITSET(common-wcmKeys, BTN_FORWARD) ||
   ISBITSET(common-wcmKeys, BTN_0))
 - return Success;
 + goto pad_init;

   xf86Msg(X_ERROR, %s: no abs bits.\n, pInfo-name);
   return !Success;
 @@ -568,7 +568,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
   /* may be a PAD only interface */
   if (ISBITSET(common-wcmKeys, BTN_FORWARD) ||
   ISBITSET(common-wcmKeys, BTN_0))
 - return Success;
 + goto pad_init;

   xf86Msg(X_ERROR, %s: unable to ioctl xmax value.\n, 
 pInfo-name);
   return !Success;
 @@ -782,6 +782,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
   common-wcmHWTouchSwitchState = 1;
   }

 +pad_init:
   usbWcmInitPadState(pInfo);

   return Success;
 --
 2.3.1

 Acked-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-by: Ping Cheng pi...@wacom.com

Sorry for the delay...

Ping

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH libwacom] Add data files for Cintiq 27QHD and 27QHD touch

2015-03-04 Thread Ping Cheng
Signed-off-by: Ping Cheng pi...@wacom.com
---
 data/cintiq-27hd.tablet  | 21 +
 data/cintiq-27hdt.tablet | 22 ++
 2 files changed, 43 insertions(+)
 create mode 100644 data/cintiq-27hd.tablet
 create mode 100644 data/cintiq-27hdt.tablet

diff --git a/data/cintiq-27hd.tablet b/data/cintiq-27hd.tablet
new file mode 100644
index 000..9ed2325
--- /dev/null
+++ b/data/cintiq-27hd.tablet
@@ -0,0 +1,21 @@
+# Wacom
+# Cintiq 27QHD
+# DTK-2700
+#
+
+[Device]
+Name=Wacom Cintiq 27QHD
+DeviceMatch=usb:056a:032a
+Class=Cintiq
+Width=24
+Height=12
+Styli=0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
+IntegratedIn=Display
+
+[Features]
+Stylus=true
+Reversible=false
+Touch=false
+Buttons=0
+Ring=false
+Ring2=false
diff --git a/data/cintiq-27hdt.tablet b/data/cintiq-27hdt.tablet
new file mode 100644
index 000..9565bc8
--- /dev/null
+++ b/data/cintiq-27hdt.tablet
@@ -0,0 +1,22 @@
+# Wacom
+# Cintiq 27QHD touch
+# DTH-2700
+#
+# Note: touch data comes through the usb:056a:032c interface
+
+[Device]
+Name=Wacom Cintiq 27QHD touch
+DeviceMatch=usb:056a:032b
+Class=Cintiq
+Width=24
+Height=12
+Styli=0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
+IntegratedIn=Display
+
+[Features]
+Stylus=true
+Reversible=false
+Touch=true
+Buttons=0
+Ring=false
+Ring2=false
-- 
1.9.1


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: add Distance to the axes reported by the mice/lens cursors

2015-03-04 Thread Ping Cheng
On Sun, Mar 1, 2015 at 10:55 PM, Peter Hutterer
peter.hutte...@who-t.net wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 Not sure about the Intuos 1, 2, and 3 devices here, but I just assumed
 they'll do distance too.

Yes, all pucks report distance.

Reviewed-by: Ping Cheng pi...@wacom.com

Ping

  data/libwacom.stylus | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

 diff --git a/data/libwacom.stylus b/data/libwacom.stylus
 index ca4ae6b..3a59a9d 100644
 --- a/data/libwacom.stylus
 +++ b/data/libwacom.stylus
 @@ -377,7 +377,7 @@ Type=Airbrush
  [0x096]
  # Intuos and Intuos2
  Name=Lens Cursor
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=true
  HasWheel=false
 @@ -386,7 +386,7 @@ Buttons=5
  [0x097]
  # Intuos3
  Name=Lens Cursor
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=true
  HasWheel=false
 @@ -395,7 +395,7 @@ Buttons=5
  [0x006]
  # Intuos4 and Intuos5
  Name=Lens Cursor
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=true
  HasWheel=false
 @@ -404,7 +404,7 @@ Buttons=5
  [0x094]
  # Intuos and Intuos2
  Name=4D Mouse
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=false
  HasWheel=false
 @@ -413,7 +413,7 @@ Buttons=5
  [0x007]
  # Intuos3
  Name=2D Mouse
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=false
  HasWheel=true
 @@ -422,7 +422,7 @@ Buttons=3
  [0x017]
  # Intuos3
  Name=Mouse
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=false
  HasWheel=true
 @@ -431,7 +431,7 @@ Buttons=5
  [0x806]
  # Intuos4 and Intuos5
  Name=Five Button Mouse
 -Axes=Tilt;
 +Axes=Tilt;Distance;
  Type=Puck
  HasLens=false
  HasWheel=true
 --
 2.1.0


 --
 Dive into the World of Parallel Programming The Go Parallel Website, sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for all
 things parallel software development, from weekly thought leadership blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 2/2] tools: unset ID_INPUT_JOYSTICK for wacom tablets

2015-02-05 Thread Ping Cheng
On Wed, Feb 4, 2015 at 8:39 PM, Peter Hutterer peter.hutte...@who-t.net wrote:
 udev's input_id builtin assigns ID_INPUT_JOYSTICK based on BTN_1, ABS_WHEEL
 and a couple of other bits. Wacom devices trigger that but they're definitely
 not joysticks.

 Unset the bit, we know better than udev here.

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  tools/generate-udev-rules.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/tools/generate-udev-rules.c b/tools/generate-udev-rules.c
 index c6d430b..6883451 100644
 --- a/tools/generate-udev-rules.c
 +++ b/tools/generate-udev-rules.c
 @@ -82,7 +82,8 @@ static void print_udev_entry_for_match (WacomDevice 
 *device, const WacomMatch *m
 return;
 }

 -   printf(ENV{ID_INPUT}=\1\, ENV{ID_INPUT_TABLET}=\1\%s\n, 
 touchpad);
 +   /* unset joystick, set tablet and possibly touchpad */
 +   printf(ENV{ID_INPUT}=\1\, ENV{ID_INPUT_JOYSTICK}=\\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, touchpad);

On kernels 3.17 and later, those PADs will never be touchpad any more,
They are express keypads. Do we need/want to distinguish them?

Except that, the patchset looks good. Thank you.

Reviewed-by: Ping Cheng pi...@wacom.com for the series.

Ping

  }

  static void print_uinput_entry_for_match (WacomDevice *device, const 
 WacomMatch *match,
 --
 2.1.0


 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH v2] Update tool IDs for newer Cintiqs and Intuos 4/5/pro

2014-12-11 Thread Ping Cheng
New tools have been added when we added new tablets. Kernel driver
has been updated with new tool IDs. But, we didn't update corresponding
data/*.tablet and libwacom.stylus

Signed-off-by: Ping Cheng pi...@wacom.com
---
v2: updated Intuos4 series.
Fixed make check and dbverfiy issues as pointed by Peter
---
 data/cintiq-13hd.tablet | 2 +-
 data/cintiq-21ux2.tablet| 2 +-
 data/cintiq-22hd.tablet | 2 +-
 data/cintiq-22hdt.tablet| 2 +-
 data/cintiq-24hd-touch.tablet   | 2 +-
 data/cintiq-24hd.tablet | 2 +-
 data/cintiq-companion-hybrid.tablet | 2 +-
 data/cintiq-companion.tablet| 2 +-
 data/intuos-pro-l.tablet| 2 +-
 data/intuos-pro-m.tablet| 2 +-
 data/intuos-pro-s.tablet| 2 +-
 data/intuos4-12x19.tablet   | 2 +-
 data/intuos4-4x6.tablet | 2 +-
 data/intuos4-6x9-wl.tablet  | 2 +-
 data/intuos4-6x9.tablet | 2 +-
 data/intuos4-8x13.tablet| 2 +-
 data/intuos5-m.tablet   | 2 +-
 data/intuos5-s.tablet   | 2 +-
 data/intuos5-touch-l.tablet | 2 +-
 data/intuos5-touch-m.tablet | 2 +-
 data/intuos5-touch-s.tablet | 2 +-
 21 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/data/cintiq-13hd.tablet b/data/cintiq-13hd.tablet
index d9fadae..9986cf7 100644
--- a/data/cintiq-13hd.tablet
+++ b/data/cintiq-13hd.tablet
@@ -28,7 +28,7 @@ DeviceMatch=usb:056a:0304
 Width=12
 Height=7
 Layout=cintiq-13hd.svg
-Styli=0x913;0x91b;0x813;0x81b;0x823;0x82b;0x801;0x885;0x120802;0x100804;0x10080c;0x140802;0x14080a;0x100902;0x10090a;0x160802;0x16080a;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
 IntegratedIn=Display
 
 [Features]
diff --git a/data/cintiq-21ux2.tablet b/data/cintiq-21ux2.tablet
index d09461e..ca3a0d2 100644
--- a/data/cintiq-21ux2.tablet
+++ b/data/cintiq-21ux2.tablet
@@ -49,7 +49,7 @@ Class=Cintiq
 Width=17
 Height=13
 Layout=cintiq-21ux2.svg
-Styli=0x802;0x80c;0x804;0x80a;0x140802;0x14080a;0x902;0x90a;0x120802;0x40802;0x4080a;0x20802;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
 IntegratedIn=Display
 
 [Features]
diff --git a/data/cintiq-22hd.tablet b/data/cintiq-22hd.tablet
index 9068985..54f3219 100644
--- a/data/cintiq-22hd.tablet
+++ b/data/cintiq-22hd.tablet
@@ -37,7 +37,7 @@ Class=Cintiq
 Width=19
 Height=11
 Layout=cintiq-22hd.svg
-Styli=0x802;0x80c;0x804;0x80a;0x140802;0x14080a;0x902;0x90a;0x120802;0x40802;0x4080a;0x20802;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
 IntegratedIn=Display
 
 [Features]
diff --git a/data/cintiq-22hdt.tablet b/data/cintiq-22hdt.tablet
index 5dbb03c..c79f274 100644
--- a/data/cintiq-22hdt.tablet
+++ b/data/cintiq-22hdt.tablet
@@ -38,7 +38,7 @@ Class=Cintiq
 Width=19
 Height=11
 Layout=cintiq-22hd.svg
-Styli=0x802;0x80c;0x804;0x80a;0x140802;0x14080a;0x902;0x90a;0x120802;0x40802;0x4080a;0x20802;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
 IntegratedIn=Display
 
 [Features]
diff --git a/data/cintiq-24hd-touch.tablet b/data/cintiq-24hd-touch.tablet
index 97a7b6b..ca6a9ae 100644
--- a/data/cintiq-24hd-touch.tablet
+++ b/data/cintiq-24hd-touch.tablet
@@ -46,7 +46,7 @@ Class=Cintiq
 Width=21
 Height=13
 Layout=cintiq-24hd.svg
-Styli=0x802;0x80c;0x804;0x80a;0x140802;0x14080a;0x902;0x90a;0x120802;0x40802;0x4080a;0x20802;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
 IntegratedIn=Display
 
 [Features]
diff --git a/data/cintiq-24hd.tablet b/data/cintiq-24hd.tablet
index 0ba8fd4..7c464a7 100644
--- a/data/cintiq-24hd.tablet
+++ b/data/cintiq-24hd.tablet
@@ -45,7 +45,7 @@ Class=Cintiq
 Width=21
 Height=13
 Layout=cintiq-24hd.svg
-Styli=0x802;0x80c;0x804;0x80a;0x140802;0x14080a;0x902;0x90a;0x120802;0x40802;0x4080a;0x20802;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c;0x902;0x90a;0x100802;0x100804;0x10080a;0x10080c;0x100902;0x10090a;0x120802;0x140802;0x14080a;0x160802;0x16080a;
 IntegratedIn=Display
 
 [Features]
diff --git a/data/cintiq-companion-hybrid.tablet 
b/data/cintiq-companion-hybrid.tablet
index 817be0f..ea36d87 100644
--- a/data/cintiq-companion-hybrid.tablet
+++ b/data/cintiq-companion-hybrid.tablet
@@ -31,7 +31,7 @@ DeviceMatch=usb:056a:0307
 Width=12
 Height=7
 Layout=cintiq-companion-hybrid.svg
-Styli=0x913;0x91b;0x813;0x81b;0x823;0x82b;0x801;0x885;0x120802;0x100804;0x10080c;0x140802;0x14080a;0x100902;0x10090a;0x160802;0x16080a;0x100802;0x10080a;
+Styli=0x802;0x804;0x80a;0x80c

[Linuxwacom-devel] [PATCH 1/2] Add data file for DTU 1031X

2014-12-10 Thread Ping Cheng
layout is unnecessary since there is no extra feature on the tablet.

Signed-off-by: Ping Cheng pi...@wacom.com
---
 data/dtu-1031x.tablet | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100644 data/dtu-1031x.tablet

diff --git a/data/dtu-1031x.tablet b/data/dtu-1031x.tablet
new file mode 100644
index 000..5fd4064
--- /dev/null
+++ b/data/dtu-1031x.tablet
@@ -0,0 +1,22 @@
+# Wacom
+# DTU-1031X Interactive Pen Display
+#
+
+[Device]
+Name=Wacom DTU1031X
+DeviceMatch=usb:056a:032f
+Class=PenDisplay
+Width=9
+Height=5
+IntegratedIn=Display
+
+[Features]
+# This tablet supports two stylus models:
+# a pen without eraser and a pen with eraser
+Stylus=true
+Reversible=false
+Touch=false
+Ring=false
+Ring2=false
+NumStrips=0
+Buttons=0
-- 
1.9.1


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] add svg files for more Intuos tablets

2014-12-10 Thread Ping Cheng
On Tue, Dec 9, 2014 at 4:14 PM, Aaron Armstrong Skomra sko...@gmail.com wrote:
 I thought about the side switch, but because the existing the .svg files in
 the
 project only only have 2 dimensions (and lack a border), I can't see moving
 into the 3rd dimension to represent the touch switch with the way things
 are setup now.

 Also I don't see the GNOME control panel having to map/configure the
 touch-switch because it should really only turn off touch.

Ok, that sounds sensible. Let's merge this patch and update it when
Gnome considers touch configurable features. The patch is

Reviewed-by: Ping Cheng pi...@wacom.com

Thank you Aaron,

Ping


 On Tue, Dec 9, 2014 at 1:53 PM, Ping Cheng pingli...@gmail.com wrote:

 On Tue, Dec 9, 2014 at 12:17 PM, Aaron Skomra sko...@gmail.com wrote:
 
  Signed-off-by: Aaron Skomra sko...@gmail.com
  ---
  Please note the buttons on these tablets do not associate correctly when
  using the button mapping interface in GNOME, see my previous commit.
 
   data/intuos-m-pt.tablet  |  5 +++--
   data/intuos-s-p.tablet   |  5 +++--
   data/intuos-s-pt.tablet  |  5 +++--
   data/layouts/intuos-m-p.svg  |  2 +-
   data/layouts/intuos-m-pt.svg | 35 +++
   data/layouts/intuos-s-p.svg  | 35 +++
   data/layouts/intuos-s-pt.svg | 35 +++
   7 files changed, 115 insertions(+), 7 deletions(-)
   create mode 100644 data/layouts/intuos-m-pt.svg
   create mode 100644 data/layouts/intuos-s-p.svg
   create mode 100644 data/layouts/intuos-s-pt.svg
 
  diff --git a/data/intuos-m-pt.tablet b/data/intuos-m-pt.tablet
  index 0d5d75c..95beb00 100644
  --- a/data/intuos-m-pt.tablet
  +++ b/data/intuos-m-pt.tablet
  @@ -39,7 +39,7 @@ DeviceMatch=usb:056a:0303
   Class=Bamboo
   Width=9
   Height=5
  -#Layout=intuos-m-pt.svg
  +Layout=intuos-m-pt.svg
   IntegratedIn=
 
   [Features]
  @@ -50,4 +50,5 @@ Buttons=4
   TouchSwitch=true

 We defined TouchSwitch in the data file. It also has a layout in its
 comment area:

 # Touch Switch Map:
 # (on the edge of top right corner; switch to right: touch off; switch
 to left: touch on)
 #
 #   S
 #*---*
 #||
 #||
 #|TABLET   |
 #||
 #||
 #*---*

 But I don't see it defined in .svg. Should we add it there as well?

   [Buttons]
  -Top=A;B;C;D
  +Left=A;B
  +Right=C;D
  diff --git a/data/intuos-s-p.tablet b/data/intuos-s-p.tablet
  index 373b50d..60ce3e2 100644
  --- a/data/intuos-s-p.tablet
  +++ b/data/intuos-s-p.tablet
  @@ -24,7 +24,7 @@ DeviceMatch=usb:056a:030e
   Class=Bamboo
   Width=6
   Height=4
  -#Layout=intuos-s-p.svg
  +Layout=intuos-s-p.svg
   IntegratedIn=
 
   [Features]
  @@ -33,4 +33,5 @@ Reversible=true
   Buttons=4
 
   [Buttons]
  -Top=A;B;C;D
  +Left=A;B
  +Right=C;D
  diff --git a/data/intuos-s-pt.tablet b/data/intuos-s-pt.tablet
  index 0585ed2..f8e691f 100644
  --- a/data/intuos-s-pt.tablet
  +++ b/data/intuos-s-pt.tablet
  @@ -39,7 +39,7 @@ DeviceMatch=usb:056a:0302
   Class=Bamboo
   Width=6
   Height=4
  -#Layout=intuos-s-pt.svg
  +Layout=intuos-s-pt.svg
   IntegratedIn=
 
   [Features]
  @@ -50,4 +50,5 @@ Buttons=4
   TouchSwitch=true

 Same here.

   [Buttons]
  -Top=A;B;C;D
  +Left=A;B
  +Right=C;D
  diff --git a/data/layouts/intuos-m-p.svg b/data/layouts/intuos-m-p.svg
  index f5495eb..3cf1f9b 100644
  --- a/data/layouts/intuos-m-p.svg
  +++ b/data/layouts/intuos-m-p.svg
  @@ -2,7 +2,7 @@
   !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN
  http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;
   !--
--
  -svg xmlns=http://www.w3.org/2000/svg; version=1.1
  style=color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8
  id=intuos-s-p width=275 height=222
  +svg xmlns=http://www.w3.org/2000/svg; version=1.1
  style=color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8
  id=intuos-m-p width=275 height=222
 title id=titleWacom Intuos Pen Medium (CTL-680)/title
 g
   path id=ButtonA class=A Button d=M 35 35   a 8  8   0
  0   1  9 -9   l 14 0   l 0 20   l -23 0   z/
  diff --git a/data/layouts/intuos-m-pt.svg b/data/layouts/intuos-m-pt.svg
  new file mode 100644
  index 000..7951e44
  --- /dev/null
  +++ b/data/layouts/intuos-m-pt.svg
  @@ -0,0 +1,35 @@
  +?xml version=1.0 encoding=UTF-8 standalone=no?
  +!DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN
  http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;
  +!--
  + --
  +svg xmlns=http://www.w3.org/2000/svg; version=1.1
  style=color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8
  id=intuos-m-pt width=275 height=222
  +  title id=titleWacom Intuos Pen and Touch Medium (CTH-680)/title
  +  g
  +path id=ButtonA class=A Button d=M 35 35   a 8  8   0
  0   1  9 -9   l 14 0

Re: [Linuxwacom-devel] [PATCH libwacom] add svg files for more Intuos tablets

2014-12-09 Thread Ping Cheng
On Tue, Dec 9, 2014 at 12:17 PM, Aaron Skomra sko...@gmail.com wrote:

 Signed-off-by: Aaron Skomra sko...@gmail.com
 ---
 Please note the buttons on these tablets do not associate correctly when
 using the button mapping interface in GNOME, see my previous commit.

  data/intuos-m-pt.tablet  |  5 +++--
  data/intuos-s-p.tablet   |  5 +++--
  data/intuos-s-pt.tablet  |  5 +++--
  data/layouts/intuos-m-p.svg  |  2 +-
  data/layouts/intuos-m-pt.svg | 35 +++
  data/layouts/intuos-s-p.svg  | 35 +++
  data/layouts/intuos-s-pt.svg | 35 +++
  7 files changed, 115 insertions(+), 7 deletions(-)
  create mode 100644 data/layouts/intuos-m-pt.svg
  create mode 100644 data/layouts/intuos-s-p.svg
  create mode 100644 data/layouts/intuos-s-pt.svg

 diff --git a/data/intuos-m-pt.tablet b/data/intuos-m-pt.tablet
 index 0d5d75c..95beb00 100644
 --- a/data/intuos-m-pt.tablet
 +++ b/data/intuos-m-pt.tablet
 @@ -39,7 +39,7 @@ DeviceMatch=usb:056a:0303
  Class=Bamboo
  Width=9
  Height=5
 -#Layout=intuos-m-pt.svg
 +Layout=intuos-m-pt.svg
  IntegratedIn=

  [Features]
 @@ -50,4 +50,5 @@ Buttons=4
  TouchSwitch=true

We defined TouchSwitch in the data file. It also has a layout in its
comment area:

# Touch Switch Map:
# (on the edge of top right corner; switch to right: touch off; switch
to left: touch on)
#
#   S
#*---*
#||
#||
#|TABLET   |
#||
#||
#*---*

But I don't see it defined in .svg. Should we add it there as well?

  [Buttons]
 -Top=A;B;C;D
 +Left=A;B
 +Right=C;D
 diff --git a/data/intuos-s-p.tablet b/data/intuos-s-p.tablet
 index 373b50d..60ce3e2 100644
 --- a/data/intuos-s-p.tablet
 +++ b/data/intuos-s-p.tablet
 @@ -24,7 +24,7 @@ DeviceMatch=usb:056a:030e
  Class=Bamboo
  Width=6
  Height=4
 -#Layout=intuos-s-p.svg
 +Layout=intuos-s-p.svg
  IntegratedIn=

  [Features]
 @@ -33,4 +33,5 @@ Reversible=true
  Buttons=4

  [Buttons]
 -Top=A;B;C;D
 +Left=A;B
 +Right=C;D
 diff --git a/data/intuos-s-pt.tablet b/data/intuos-s-pt.tablet
 index 0585ed2..f8e691f 100644
 --- a/data/intuos-s-pt.tablet
 +++ b/data/intuos-s-pt.tablet
 @@ -39,7 +39,7 @@ DeviceMatch=usb:056a:0302
  Class=Bamboo
  Width=6
  Height=4
 -#Layout=intuos-s-pt.svg
 +Layout=intuos-s-pt.svg
  IntegratedIn=

  [Features]
 @@ -50,4 +50,5 @@ Buttons=4
  TouchSwitch=true

Same here.

  [Buttons]
 -Top=A;B;C;D
 +Left=A;B
 +Right=C;D
 diff --git a/data/layouts/intuos-m-p.svg b/data/layouts/intuos-m-p.svg
 index f5495eb..3cf1f9b 100644
 --- a/data/layouts/intuos-m-p.svg
 +++ b/data/layouts/intuos-m-p.svg
 @@ -2,7 +2,7 @@
  !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN 
 http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;
  !--
   --
 -svg xmlns=http://www.w3.org/2000/svg; version=1.1 
 style=color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8 
 id=intuos-s-p width=275 height=222
 +svg xmlns=http://www.w3.org/2000/svg; version=1.1 
 style=color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8 
 id=intuos-m-p width=275 height=222
title id=titleWacom Intuos Pen Medium (CTL-680)/title
g
  path id=ButtonA class=A Button d=M 35 35   a 8  8   0  
   0   1  9 -9   l 14 0   l 0 20   l -23 0   z/
 diff --git a/data/layouts/intuos-m-pt.svg b/data/layouts/intuos-m-pt.svg
 new file mode 100644
 index 000..7951e44
 --- /dev/null
 +++ b/data/layouts/intuos-m-pt.svg
 @@ -0,0 +1,35 @@
 +?xml version=1.0 encoding=UTF-8 standalone=no?
 +!DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN 
 http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;
 +!--
 + --
 +svg xmlns=http://www.w3.org/2000/svg; version=1.1 
 style=color:#00;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8 
 id=intuos-m-pt width=275 height=222
 +  title id=titleWacom Intuos Pen and Touch Medium (CTH-680)/title
 +  g
 +path id=ButtonA class=A Button d=M 35 35   a 8  8   0  
   0   1  9 -9   l 14 0   l 0 20   l -23 0   z/
 +circle id=DotA cx=47 cy=36 r=.5/
 +path id=LeaderA class=A Leader d=M 65 35 l 20 0/
 +text id=LabelA class=A Label x=87 y=40 
 style=text-anchor:start;A/text
 +  /g
 +
 +  g
 +path id=ButtonB class=B Button d=M 35 47.5   l 23 0   l 0 20   l 
 -23 0   z/
 +circle id=DotB cx=47 cy=57.5 r=.5/
 +path id=LeaderB class=B Leader d=M 65 59 l 20 0/
 +text id=LabelB class=B Label x=87 y=64 
 style=text-anchor:start;B/text
 +  /g
 +
 +  g
 +path id=ButtonC class=C Button d=M 185 26   l 14 0   a 8  -8   
 00   1  9 9l 0 11   l -23 0   z/
 +circle id=DotC cx=197 cy=36 r=.5/
 +path id=LeaderC class=C Leader d=M 160 35 l 20 0/
 +text id=LabelC class=C Label x=145 y=40 
 style=text-anchor:start;C/text
 +  /g
 +
 +  g
 +

Re: [Linuxwacom-devel] [PATCH libwacom] Remove 'System' from IntegratedIn values for dt displays

2014-11-21 Thread Ping Cheng
On Fri, Nov 21, 2014 at 11:53 AM, Aaron Armstrong Skomra
sko...@gmail.com wrote:
 Corrects the fact that most of the dt displays are identified as being
 integrated in a system.

 Signed-off-by: Aaron Skomra aaron.sko...@wacom.com

Reviewed-by: Ping Cheng pi...@wacom.com

Thank you Aaron for the patch,

Ping

 ---
  data/dtf-720.tablet  | 2 +-
  data/dth-2242.tablet | 2 +-
  data/dti-520.tablet  | 2 +-
  data/dtk-2241.tablet | 2 +-
  data/dtu-1031.tablet | 2 +-
  data/dtu-1631.tablet | 2 +-
  data/dtu-2231.tablet | 2 +-
  7 files changed, 7 insertions(+), 7 deletions(-)

 diff --git a/data/dtf-720.tablet b/data/dtf-720.tablet
 index e724fa7..078d499 100644
 --- a/data/dtf-720.tablet
 +++ b/data/dtf-720.tablet
 @@ -9,7 +9,7 @@ DeviceMatch=usb:056a:00c0
  Width=13
  Height=11
  Class=PenDisplay
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  Stylus=true
 diff --git a/data/dth-2242.tablet b/data/dth-2242.tablet
 index 776066a..2eb5d09 100644
 --- a/data/dth-2242.tablet
 +++ b/data/dth-2242.tablet
 @@ -21,7 +21,7 @@ Width=19
  Height=11
  Layout=dth-2242.svg
  Styli=0x180802;0x18080a;
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  # This tablet supports two stylus models:
 diff --git a/data/dti-520.tablet b/data/dti-520.tablet
 index 0aecd54..d5dee3d 100644
 --- a/data/dti-520.tablet
 +++ b/data/dti-520.tablet
 @@ -23,7 +23,7 @@ Height=12
  Layout=dti-520.svg
  # FIXME does the stylus have an eraser?
  # Styli=0xf;
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  # This tablet does not appear to support erasers on styli
 diff --git a/data/dtk-2241.tablet b/data/dtk-2241.tablet
 index 5e6a966..599ee9b 100644
 --- a/data/dtk-2241.tablet
 +++ b/data/dtk-2241.tablet
 @@ -20,7 +20,7 @@ Width=19
  Height=11
  Layout=dth-2242.svg
  Styli=0x180802;0x18080a;
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  # This tablet supports two stylus models:
 diff --git a/data/dtu-1031.tablet b/data/dtu-1031.tablet
 index 236383e..efe1a78 100644
 --- a/data/dtu-1031.tablet
 +++ b/data/dtu-1031.tablet
 @@ -20,7 +20,7 @@ Class=PenDisplay
  Width=9
  Height=5
  #Layout=dtu-1031.svg
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  # This tablet supports two stylus models:
 diff --git a/data/dtu-1631.tablet b/data/dtu-1631.tablet
 index 201a251..b291f7f 100644
 --- a/data/dtu-1631.tablet
 +++ b/data/dtu-1631.tablet
 @@ -9,7 +9,7 @@ DeviceMatch=usb:056a:00f0
  Width=14
  Height=8
  Class=PenDisplay
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  Stylus=true
 diff --git a/data/dtu-2231.tablet b/data/dtu-2231.tablet
 index 034c8f0..11506fb 100644
 --- a/data/dtu-2231.tablet
 +++ b/data/dtu-2231.tablet
 @@ -8,7 +8,7 @@ DeviceMatch=usb:056a:00ce
  Class=PenDisplay
  Width=19
  Height=11
 -IntegratedIn=Display;System
 +IntegratedIn=Display

  [Features]
  Stylus=true
 --
 1.9.3


 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Allow PAD only interface without setting up EV_ABS and/or EV_X/Y

2014-11-20 Thread Ping Cheng
On Thursday, November 20, 2014, Peter Hutterer peter.hutte...@who-t.net
wrote:

 On Tue, Nov 18, 2014 at 04:42:22PM -0800, Ping Cheng wrote:
  Wacom kernel driver has been merged to HID subsystem. As a bonus,
  we also allow PAD to report its data on its own interface. To declare
  the exact event types, we should not set EV_ABS or EV_X/Y for PADs
  on most tablets.
 
  However, xf86-input-wacom is not designed to handle this case. This
  patch makes future PAD-only, or even expresskey-only, tablets work
  properly.
 
  Signed-off-by: Ping Cheng pi...@wacom.com javascript:;
  ---
   src/wcmUSB.c | 13 +++--
   1 file changed, 11 insertions(+), 2 deletions(-)
 
  diff --git a/src/wcmUSB.c b/src/wcmUSB.c
  index 638ffb8..bac3c66 100644
  --- a/src/wcmUSB.c
  +++ b/src/wcmUSB.c
  @@ -546,6 +546,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (!ISBITSET(ev,EV_ABS))
{
  + /* may be an expresskey only interface */
  + if (ISBITSET(common-wcmKeys, BTN_FORWARD) ||
  + ISBITSET(common-wcmKeys, BTN_0))
  + return Success;
  +
xf86Msg(X_ERROR, %s: no abs bits.\n, pInfo-name);
return !Success;
}
  @@ -560,6 +565,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
/* max x */
if (ioctl(pInfo-fd, EVIOCGABS(ABS_X), absinfo)  0)
{
  + /* may be a PAD only interface */
  + if (ISBITSET(common-wcmKeys, BTN_FORWARD) ||
  + ISBITSET(common-wcmKeys, BTN_0))
  + return Success;
  +
xf86Msg(X_ERROR, %s: unable to ioctl xmax value.\n,
 pInfo-name);
return !Success;
}

 Reviewed-by: Peter Hutterer peter.hutte...@who-t.net javascript:;
 for this bit


  @@ -755,8 +765,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (ioctl(pInfo-fd, EVIOCGBIT(EV_SW, sizeof(sw)), sw)  0)
{
  - xf86Msg(X_ERROR, %s: usbProbeKeys unable to ioctl 
  - sw bits.\n, pInfo-name);
  + xf86Msg(X_ERROR, %s: unable to ioctl sw bits.\n,
 pInfo-name);
return 0;
}
else if (ISBITSET(sw, SW_MUTE_DEVICE))

 Reviewed-by: Peter Hutterer peter.hutte...@who-t.net javascript:;, if
 it's split to a
 separate patch.


Thank you for the review. I'll split the patch and post them here.


 fwiw, in the future we should use __func__ instead of harcoding function
 names.


When does your future start, from this patch or sometime later?

;-)

Ping
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Allow PAD only interface without setting up EV_ABS and/or EV_X/Y

2014-11-18 Thread Ping Cheng
Wacom kernel driver has been merged to HID subsystem. As a bonus,
we also allow PAD to report its data on its own interface. To declare
the exact event types, we should not set EV_ABS or EV_X/Y for PADs
on most tablets.

However, xf86-input-wacom is not designed to handle this case. This
patch makes future PAD-only, or even expresskey-only, tablets work
properly.

Signed-off-by: Ping Cheng pi...@wacom.com
---
 src/wcmUSB.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 638ffb8..bac3c66 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -546,6 +546,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (!ISBITSET(ev,EV_ABS))
{
+   /* may be an expresskey only interface */
+   if (ISBITSET(common-wcmKeys, BTN_FORWARD) ||
+   ISBITSET(common-wcmKeys, BTN_0))
+   return Success;
+
xf86Msg(X_ERROR, %s: no abs bits.\n, pInfo-name);
return !Success;
}
@@ -560,6 +565,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
/* max x */
if (ioctl(pInfo-fd, EVIOCGABS(ABS_X), absinfo)  0)
{
+   /* may be a PAD only interface */
+   if (ISBITSET(common-wcmKeys, BTN_FORWARD) ||
+   ISBITSET(common-wcmKeys, BTN_0))
+   return Success;
+
xf86Msg(X_ERROR, %s: unable to ioctl xmax value.\n, 
pInfo-name);
return !Success;
}
@@ -755,8 +765,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (ioctl(pInfo-fd, EVIOCGBIT(EV_SW, sizeof(sw)), sw)  0)
{
-   xf86Msg(X_ERROR, %s: usbProbeKeys unable to ioctl 
-   sw bits.\n, pInfo-name);
+   xf86Msg(X_ERROR, %s: unable to ioctl sw bits.\n, pInfo-name);
return 0;
}
else if (ISBITSET(sw, SW_MUTE_DEVICE))
-- 
1.9.1


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Add data file for Intuos Pen Medium

2014-11-11 Thread Ping Cheng
Signed-off-by: Ping Cheng pi...@wacom.com
---
 data/intuos-m-p.tablet | 38 ++
 1 file changed, 38 insertions(+)
 create mode 100644 data/intuos-m-p.tablet

diff --git a/data/intuos-m-p.tablet b/data/intuos-m-p.tablet
new file mode 100644
index 000..7d41204
--- /dev/null
+++ b/data/intuos-m-p.tablet
@@ -0,0 +1,38 @@
+# Wacom
+# Intuos Pen Medium
+# CTL-680
+#
+# Successor of Bamboo3 series
+#
+# stylus with two buttons and eraser
+# Pen active area: 8.5 x 5.3in
+#
+# Button Map:
+# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
+#
+# A C
+# B D
+#*---*
+#|   |
+#|   |
+#|TABLET |
+#|   |
+#|   |
+#*---*
+
+[Device]
+Name=Intuos Pen Medium
+DeviceMatch=usb:056a:0323
+Class=Bamboo
+Width=9
+Height=5
+#Layout=intuos-m-p.svg
+IntegratedIn=
+
+[Features]
+Stylus=true
+Reversible=true
+Buttons=4
+
+[Buttons]
+Top=A;B;C;D
-- 
1.9.1


--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/5] Input - wacom: create a separate input device for pads

2014-06-23 Thread Ping Cheng
Hi Benjamin,

On Mon, Jun 23, 2014 at 1:57 PM, Benjamin Tissoires
benjamin.tissoi...@redhat.com wrote:
 Currently, the pad events are sent through the stylus input device
 for the Intuos/Cintiqs, and through the touch input device for the
 Bamboos.

 To differentiate the buttons pressed on the pad from the ones pressed
 on the stylus, the Intuos/Cintiq uses MISC_SERIAL and ABS_MISC. This
 lead to a multiplexing of the events into one device, which are then
 splitted out in xf86-input-wacom. Bamboos are not using MISC events
 because the pad is attached to the touch interface, and only BTN_TOUCH
 is used for the finger (and DOUBLE_TAP, etc...). However, the user space
 driver still splits out the pad from the touch interface in the same
 way it does for the pro line devices.

 The other problem we can see with this fact is that some of the Intuos
 and Cintiq have a wheel, and the effective range of the reported values
 is [0..71]. Unfortunately, the airbrush stylus also sends wheel events
 (there is a small wheel on it), but in the range [0..1023]. From the user
 space point of view it is kind of difficult to understand that because
 the wheel on the pad are quite common, while the airbrush tool is not.

 A solution to fix all of these problems is to split out the pad device
 from the stylus/touch. This decision makes more sense because the pad is
 not linked to the absolute position of the finger or pen, and usually, the
 events from the pad are filtered out by the compositor, which then convert
 them into actions or keyboard shortcuts.

This is a very good solution. I like it.

 For backward compatibility with current xf86-input-wacom, the pad devices
 still present the ABS_X, ABS_Y and ABS_MISC events, but they can be
 completely ignored in the new implementation.

I do not think we need to keep ABS_X and ABS_Y for pad. We've already
supported a tablet (Intuos pen small, a pen only tablet with buttons
reported on touch interface) that does not set ABS_X and ABS_Y for
pad.

Unless you plan to use other means to tell userland those events are
from PAD tool, ABS_MISC is necessary and is a reasonable way to group
PAD events. So, I do not think it is for backward compatibility. It is
there to stay. With that said, the whole patchset is

 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@redhat.com

Reviewed-by: Ping Cheng pi...@wacom.com

Thank you, Benjamin, for your support.

Ping

 ---
  drivers/input/tablet/wacom.h |  2 ++
  drivers/input/tablet/wacom_sys.c | 63 
 +++-
  drivers/input/tablet/wacom_wac.c | 27 -
  drivers/input/tablet/wacom_wac.h |  2 ++
  4 files changed, 85 insertions(+), 9 deletions(-)

 diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
 index 9ebf0ed..caa59ca 100644
 --- a/drivers/input/tablet/wacom.h
 +++ b/drivers/input/tablet/wacom.h
 @@ -136,4 +136,6 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
 len);
  void wacom_setup_device_quirks(struct wacom_features *features);
  int wacom_setup_input_capabilities(struct input_dev *input_dev,
struct wacom_wac *wacom_wac);
 +int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
 +  struct wacom_wac *wacom_wac);
  #endif
 diff --git a/drivers/input/tablet/wacom_sys.c 
 b/drivers/input/tablet/wacom_sys.c
 index c993eee..b9bf37e 100644
 --- a/drivers/input/tablet/wacom_sys.c
 +++ b/drivers/input/tablet/wacom_sys.c
 @@ -135,6 +135,9 @@ static int wacom_open(struct input_dev *dev)

 mutex_lock(wacom-lock);

 +   if (wacom-open)
 +   goto out;
 +
 if (usb_submit_urb(wacom-irq, GFP_KERNEL)) {
 retval = -EIO;
 goto out;
 @@ -157,9 +160,14 @@ static void wacom_close(struct input_dev *dev)
 autopm_error = usb_autopm_get_interface(wacom-intf);

 mutex_lock(wacom-lock);
 +   if (!wacom-open)
 +   goto out;
 +
 usb_kill_urb(wacom-irq);
 wacom-open = false;
 wacom-intf-needs_remote_wakeup = 0;
 +
 +out:
 mutex_unlock(wacom-lock);

 if (!autopm_error)
 @@ -1109,19 +1117,16 @@ static void wacom_destroy_battery(struct wacom *wacom)
 }
  }

 -static int wacom_register_input(struct wacom *wacom)
 +static struct input_dev *wacom_allocate_input(struct wacom *wacom)
  {
 struct input_dev *input_dev;
 struct usb_interface *intf = wacom-intf;
 struct usb_device *dev = interface_to_usbdev(intf);
 struct wacom_wac *wacom_wac = (wacom-wacom_wac);
 -   int error;

 input_dev = input_allocate_device();
 -   if (!input_dev) {
 -   error = -ENOMEM;
 -   goto fail1;
 -   }
 +   if (!input_dev)
 +   return NULL;

 input_dev-name = wacom_wac-name;
 input_dev-phys = wacom-phys;
 @@ -1131,21 +1136,59 @@ static int wacom_register_input(struct wacom

Re: [Linuxwacom-devel] [PATCH v2] Don't assume tablet (x, y) always starts from (0, 0)

2014-06-17 Thread Ping Cheng
On Tue, Jun 17, 2014 at 4:03 PM, Peter Hutterer
peter.hutte...@who-t.net wrote:
 On Tue, Jun 10, 2014 at 12:49:55PM -0700, Ping Cheng wrote:
 Newer Cintiqs have an outbound of 200 tablet count outside of screen
 area. This causes absinfo.minimum to be 200 for some tablets instead
 of always 0 for all tablets. Update struct _WacomDeviceRec and
 _WacomCommonRec to process this change.

 Signed-off-by: Ping Cheng pi...@wacom.com
 Reviewed-by: Jason Gerecke killert...@gmail.com

 I'm surprised this is all it takes. I would've expected more calculations
 needing to be adjusted but grepping around for a bit I can't find any. so:

Brainstorming and testing took more time than actually implementing it.

 Reviewed-by: Peter Hutterer peter.hutte...@who-t.net

Thank you for your time.

Ping


 ---
 v2: updated with Jason's comments
 ---
  src/wcmUSB.c| 2 ++
  src/wcmXCommand.c   | 4 ++--
  src/xf86Wacom.c | 6 ++
  src/xf86WacomDefs.h | 8 ++--
  4 files changed, 16 insertions(+), 4 deletions(-)

 diff --git a/src/wcmUSB.c b/src/wcmUSB.c
 index 1bdaf3c..2e4d39e 100644
 --- a/src/wcmUSB.c
 +++ b/src/wcmUSB.c
 @@ -572,6 +572,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)

   if (!is_touch)
   {
 + common-wcmMinX = absinfo.minimum;
   common-wcmMaxX = absinfo.maximum;

  #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
 @@ -605,6 +606,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)

   if (!is_touch)
   {
 + common-wcmMinY = absinfo.minimum;
   common-wcmMaxY = absinfo.maximum;

  #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
 diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
 index 563f600..6c159ac 100644
 --- a/src/wcmXCommand.c
 +++ b/src/wcmXCommand.c
 @@ -708,8 +708,8 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
 XIPropertyValuePtr prop,
   if ((values[0] == -1)  (values[1] == -1) 
   (values[2] == -1)  (values[3] == -1))
   {
 - values[0] = 0;
 - values[1] = 0;
 + values[0] = priv-minX;
 + values[1] = priv-minX;
   values[2] = priv-maxX;
   values[3] = priv-maxY;
   }
 diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
 index 7b565a0..de0438f 100644
 --- a/src/xf86Wacom.c
 +++ b/src/xf86Wacom.c
 @@ -111,12 +111,18 @@ wcmInitialToolSize(InputInfoPtr pInfo)
   }
   else
   {
 + priv-minX = common-wcmMinX;
 + priv-minY = common-wcmMinY;
   priv-maxX = common-wcmMaxX;
   priv-maxY = common-wcmMaxY;
   priv-resolX = common-wcmResolX;
   priv-resolY = common-wcmResolY;
   }

 + if (!priv-topX)
 + priv-topX = priv-minX;
 + if (!priv-topY)
 + priv-topY = priv-minY;
   if (!priv-bottomX)
   priv-bottomX = priv-maxX;
   if (!priv-bottomY)
 diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
 index 1f6f43a..9b81fe0 100644
 --- a/src/xf86WacomDefs.h
 +++ b/src/xf86WacomDefs.h
 @@ -253,8 +253,10 @@ struct _WacomDeviceRec
   int bottomY;/* Y bottom in device coordinates */
   int resolX; /* X resolution */
   int resolY; /* Y resolution */
 - int maxX;   /* tool physical maxX in device coordinates*/
 - int maxY;   /* tool physical maxY in device coordinates*/
 + int minX;   /* tool physical minX in device coordinates */
 + int minY;   /* tool physical minY in device coordinates */
 + int maxX;   /* tool physical maxX in device coordinates */
 + int maxY;   /* tool physical maxY in device coordinates */
   unsigned int serial;/* device serial number this device takes (if 
 0, any serial is ok) */
   unsigned int cur_serial; /* current serial in prox */
   int cur_device_id;  /* current device ID in prox */
 @@ -396,6 +398,8 @@ struct _WacomCommonRec
   int wcmHWTouchSwitchState;   /* touch event disable/enabled by 
 hardware switch */

   /* These values are in tablet coordinates */
 + int wcmMinX; /* tablet min X value */
 + int wcmMinY; /* tablet min Y value */
   int wcmMaxX; /* tablet max X value */
   int wcmMaxY; /* tablet max Y value */
   int wcmMaxZ; /* tablet max Z value */
 --
 1.9.1

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems

[Linuxwacom-devel] [PATCH v2] Don't assume tablet (x, y) always starts from (0, 0)

2014-06-10 Thread Ping Cheng
Newer Cintiqs have an outbound of 200 tablet count outside of screen
area. This causes absinfo.minimum to be 200 for some tablets instead
of always 0 for all tablets. Update struct _WacomDeviceRec and
_WacomCommonRec to process this change.

Signed-off-by: Ping Cheng pi...@wacom.com
Reviewed-by: Jason Gerecke killert...@gmail.com
---
v2: updated with Jason's comments
---
 src/wcmUSB.c| 2 ++
 src/wcmXCommand.c   | 4 ++--
 src/xf86Wacom.c | 6 ++
 src/xf86WacomDefs.h | 8 ++--
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 1bdaf3c..2e4d39e 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -572,6 +572,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (!is_touch)
{
+   common-wcmMinX = absinfo.minimum;
common-wcmMaxX = absinfo.maximum;
 
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
@@ -605,6 +606,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (!is_touch)
{
+   common-wcmMinY = absinfo.minimum;
common-wcmMaxY = absinfo.maximum;
 
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 563f600..6c159ac 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -708,8 +708,8 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
if ((values[0] == -1)  (values[1] == -1) 
(values[2] == -1)  (values[3] == -1))
{
-   values[0] = 0;
-   values[1] = 0;
+   values[0] = priv-minX;
+   values[1] = priv-minX;
values[2] = priv-maxX;
values[3] = priv-maxY;
}
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 7b565a0..de0438f 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -111,12 +111,18 @@ wcmInitialToolSize(InputInfoPtr pInfo)
}
else
{
+   priv-minX = common-wcmMinX;
+   priv-minY = common-wcmMinY;
priv-maxX = common-wcmMaxX;
priv-maxY = common-wcmMaxY;
priv-resolX = common-wcmResolX;
priv-resolY = common-wcmResolY;
}
 
+   if (!priv-topX)
+   priv-topX = priv-minX;
+   if (!priv-topY)
+   priv-topY = priv-minY;
if (!priv-bottomX)
priv-bottomX = priv-maxX;
if (!priv-bottomY)
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 1f6f43a..9b81fe0 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -253,8 +253,10 @@ struct _WacomDeviceRec
int bottomY;/* Y bottom in device coordinates */
int resolX; /* X resolution */
int resolY; /* Y resolution */
-   int maxX;   /* tool physical maxX in device coordinates*/
-   int maxY;   /* tool physical maxY in device coordinates*/
+   int minX;   /* tool physical minX in device coordinates */
+   int minY;   /* tool physical minY in device coordinates */
+   int maxX;   /* tool physical maxX in device coordinates */
+   int maxY;   /* tool physical maxY in device coordinates */
unsigned int serial;/* device serial number this device takes (if 
0, any serial is ok) */
unsigned int cur_serial; /* current serial in prox */
int cur_device_id;  /* current device ID in prox */
@@ -396,6 +398,8 @@ struct _WacomCommonRec
int wcmHWTouchSwitchState;   /* touch event disable/enabled by hardware 
switch */
 
/* These values are in tablet coordinates */
+   int wcmMinX; /* tablet min X value */
+   int wcmMinY; /* tablet min Y value */
int wcmMaxX; /* tablet max X value */
int wcmMaxY; /* tablet max Y value */
int wcmMaxZ; /* tablet max Z value */
-- 
1.9.1


--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Don't assume tablet (x, y) always starts from (0, 0)

2014-06-06 Thread Ping Cheng
Newer Cintiqs have an outbound of 200 tablet count outside of screen
area. This causes absinfo.minimum to be 200 for some tablets instead
of always 0 for all tablets. Update struct _WacomDeviceRec and
_WacomCommonRec to process this change.

Signed-off-by: Ping Cheng pi...@wacom.com
---
 src/wcmUSB.c| 2 ++
 src/xf86Wacom.c | 2 ++
 src/xf86WacomDefs.h | 8 ++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 1bdaf3c..2e4d39e 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -572,6 +572,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (!is_touch)
{
+   common-wcmMinX = absinfo.minimum;
common-wcmMaxX = absinfo.maximum;
 
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
@@ -605,6 +606,7 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
 
if (!is_touch)
{
+   common-wcmMinY = absinfo.minimum;
common-wcmMaxY = absinfo.maximum;
 
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 7b565a0..a20a129 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -111,6 +111,8 @@ wcmInitialToolSize(InputInfoPtr pInfo)
}
else
{
+   priv-minX = common-wcmMinX;
+   priv-minY = common-wcmMinY;
priv-maxX = common-wcmMaxX;
priv-maxY = common-wcmMaxY;
priv-resolX = common-wcmResolX;
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 1f6f43a..9b81fe0 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -253,8 +253,10 @@ struct _WacomDeviceRec
int bottomY;/* Y bottom in device coordinates */
int resolX; /* X resolution */
int resolY; /* Y resolution */
-   int maxX;   /* tool physical maxX in device coordinates*/
-   int maxY;   /* tool physical maxY in device coordinates*/
+   int minX;   /* tool physical minX in device coordinates */
+   int minY;   /* tool physical minY in device coordinates */
+   int maxX;   /* tool physical maxX in device coordinates */
+   int maxY;   /* tool physical maxY in device coordinates */
unsigned int serial;/* device serial number this device takes (if 
0, any serial is ok) */
unsigned int cur_serial; /* current serial in prox */
int cur_device_id;  /* current device ID in prox */
@@ -396,6 +398,8 @@ struct _WacomCommonRec
int wcmHWTouchSwitchState;   /* touch event disable/enabled by hardware 
switch */
 
/* These values are in tablet coordinates */
+   int wcmMinX; /* tablet min X value */
+   int wcmMinY; /* tablet min Y value */
int wcmMaxX; /* tablet max X value */
int wcmMaxY; /* tablet max Y value */
int wcmMaxZ; /* tablet max Z value */
-- 
1.9.1


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Fix enter-prox detection

2014-05-30 Thread Ping Cheng
On Fri, May 30, 2014 at 2:23 PM, Jason Gerecke killert...@gmail.com wrote:
 Prior to commit 61f6a7c, the value of oldState.proximity
 was not set by wcmUpdateOldState. Rather, when a tool
 entered proximity, the proximity flag would be explicitly
 set only after the call to wcmSend(Non)PadEvents was
 complete. This ensured that the condition where the pen
 has just entered prox would be properly detected.

 Since the aforementioned commit copies the value of ds
 (whose proximity flag is set) to oldState, issues related
 to the enter-prox condition have appeared. This is most
 noticable in GIMP, which has trouble switching tools.

 To resolve this issue, we remove the explicit setting of
 oldState.proximity (which is now implicitly handled by
 the call to wcmUpdateOldState after wcmSend(Non)PadEvents
 finishes) and add in an explicit clearing of the same
 prior to the call. In this way, it acts the same as
 oldState.buttons which must also be cleared upon entering
 prox to properly detect presses.

 Signed-off-by: Jason Gerecke killert...@gmail.com
 ---
  src/wcmCommon.c | 7 +--
  1 file changed, 5 insertions(+), 2 deletions(-)

 diff --git a/src/wcmCommon.c b/src/wcmCommon.c
 index 65b0fe4..6dfcba4 100644
 --- a/src/wcmCommon.c
 +++ b/src/wcmCommon.c
 @@ -685,10 +685,14 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
 WacomDeviceState* ds)
 x, y, z, v3, v4, v5, v6, id, serial,
 is_button ? true : false, ds-buttons);

 -   /* update the old records */
 +   /* when entering prox, replace the zeroed-out oldState with a copy of
 +* the current state to prevent jumps. reset the prox and button state
 +* to zero to properly detect changes.

It is sensible to me. For all three patches,

Reviewed-by: Ping Cheng pi...@wacom.com

Cheers,

Ping

 +*/
 if(!priv-oldState.proximity)
 {
 wcmUpdateOldState(pInfo, ds, x, y);
 +   priv-oldState.proximity = 0;
 priv-oldState.buttons = 0;
 }

 @@ -708,7 +712,6 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
 WacomDeviceState* ds)
 wcmSendNonPadEvents(pInfo, ds, 0, priv-naxes, 
 valuators);
 }

 -   priv-oldState.proximity = ds-proximity;
 if (ds-proximity)
 wcmUpdateOldState(pInfo, ds, x, y);
 else
 --
 1.9.3


 --
 Time is money. Stop wasting it! Get your web API in 5 minutes.
 www.restlet.com/download
 http://p.sf.net/sfu/restlet
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/4] Do not store a second copy of old touchstrip values in oldTilt[XY]

2014-05-07 Thread Ping Cheng
On Wed, May 7, 2014 at 2:29 PM, Jason Gerecke killert...@gmail.com wrote:
 The touchstrip values are already stored in oldStrip[XY], and appear to
 also be stored in oldTilt[XY] as a quirk of history. The value of oldTilt[XY]
 itself is only read in wcmSendNonPadEvents (which is not called for the pad
 device for obvious reasons ;)). At this point in time, there is absolutely
 no reason to store a second copy of the strip values in oldTilt[XY].

 Signed-off-by: Jason Gerecke killert...@gmail.com

Nice cleanup, especially the third one!

Reviewed-by: Ping Cheng pi...@wacom.com for the whole set.

Ping

 ---
  src/wcmCommon.c | 15 ++-
  1 file changed, 2 insertions(+), 13 deletions(-)

 diff --git a/src/wcmCommon.c b/src/wcmCommon.c
 index 7f78d0c..d27ad6d 100644
 --- a/src/wcmCommon.c
 +++ b/src/wcmCommon.c
 @@ -488,27 +488,16 @@ static void wcmUpdateOldState(const InputInfoPtr pInfo,
   const WacomDeviceState *ds)
  {
 const WacomDevicePtr priv = (WacomDevicePtr) pInfo-private;
 -   int tx, ty;

 priv-oldWheel = ds-abswheel;
 priv-oldWheel2 = ds-abswheel2;
 priv-oldButtons = ds-buttons;

 -   if (IsPad(priv))
 -   {
 -   tx = ds-stripx;
 -   ty = ds-stripy;
 -   } else
 -   {
 -   tx = ds-tiltx;
 -   ty = ds-tilty;
 -   }
 -
 priv-oldX = priv-currentX;
 priv-oldY = priv-currentY;
 priv-oldZ = ds-pressure;
 -   priv-oldTiltX = tx;
 -   priv-oldTiltY = ty;
 +   priv-oldTiltX = ds-tiltx;
 +   priv-oldTiltY = ds-tilty;
 priv-oldStripX = ds-stripx;
 priv-oldStripY = ds-stripy;
 priv-oldRot = ds-rotation;
 --
 1.9.2


 --
 Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; Expert tips and advice for migrating your SCM now
 http://p.sf.net/sfu/perforce
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Kernel panic (null ptr) with 3.14.1 + CTH-480

2014-04-18 Thread Ping Cheng
On Thu, Apr 17, 2014 at 9:22 AM, Przemo Firszt prz...@firszt.eu wrote:
  Quoting Ping Cheng pingli...@gmail.com:

 Please follow the steps

 here:
 http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Input-Wacom
 to up date your kernel driver to see what
 happens.


 http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Input-wacom

 W - w

 Regards,
 Przemo


Thank you Przemo! I have no idea why w turned into W. I guess Elv1313
followed the right direction.

Ping

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Kernel panic (null ptr) with 3.14.1 + CTH-480

2014-04-17 Thread Ping Cheng
Please follow the steps here:
http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Input-Wacomto
up date your kernel driver to see what happens.

Ping

On Thursday, April 17, 2014, Elv1313 . elv1...@gmail.com wrote:

 Any idea what I can do about it. I don't mind patching the kernel or
 adding a few printk() to help debug this.

 Thanks


 On 16 April 2014 01:34, Elv1313 . 
 elv1...@gmail.comjavascript:_e(%7B%7D,'cvml','elv1...@gmail.com');
  wrote:

 Thanks for replying,

 Only wacom cause a KP, the other 2 load fine, but don't create any
 /dev/input devices (no big surprise here, they are not supposed to). The
 kernel was built the old fashioned way
 tar -xpvf linux-3.14.1*
 rm linux
 ln -s $PWD/linux3.14* linux
 cd linux
 cp ../linux*3.13*/.config ./
 make menuconfig #Select wacom as module
 make -j5  make modules_install
 cp arch/x86* tab tab tab /boot
 #edit grub, reboot
 depmod -a
 modprobe wacom

 boom!


 On 15 April 2014 18:41, Ping Cheng 
 pingli...@gmail.comjavascript:_e(%7B%7D,'cvml','pingli...@gmail.com');
  wrote:

 On Tue, Apr 15, 2014 at 3:30 PM, Elv1313 . 
 elv1...@gmail.comjavascript:_e(%7B%7D,'cvml','elv1...@gmail.com');
 wrote:
  Hello,
 
  I recently bought a Wacom CTH-480 to use it with Linux. I had no luck
 so
  far, but I read on this list that 3.14 should support it. However, all
 I get
  is a KP when modprobing the wacom driver.

 Did you build the driver on your system? If yes, what steps did you
 follow?

 
  uname -a
  Linux localhost 3.14.1 #1 SMP Tue Apr 15 11:52:03 EDT 2014 x86_64
 Intel(R)
  Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
 
  grep WACOM .config
  CONFIG_TABLET_USB_WACOM=m
  # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
  CONFIG_TOUCHSCREEN_WACOM_I2C=m
  CONFIG_HID_WACOM=m
 
  lsusb
  Bus 001 Device 004: ID 18d1:4e12 Google Inc. Nexus One (debug)
  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  Bus 005 Device 061: ID 056a:0302 Wacom Co., Ltd
  Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 002 Device 003: ID 046d:c043 Logitech, Inc. MX320/MX400 Laser Mouse
  Bus 002 Device 002: ID 046d:c22d Logitech, Inc. G510 Gaming Keyboard
  Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
  modprobe wacom:
  http://i.imgur.com/U9tSNdg.jpg
 
  I also tried to modprobe wacom_i2c and hid-wacom before wacom, same
  result.

 Intuos is an USB device. You only need wacom.ko. I wonder why the
 other two cause panic though.

  The tablet work fine on my Mac

 Yeah, it means we are most likely facing a driver issue.

 Ping




--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Kernel panic (null ptr) with 3.14.1 + CTH-480

2014-04-15 Thread Ping Cheng
On Tue, Apr 15, 2014 at 3:30 PM, Elv1313 . elv1...@gmail.com wrote:
 Hello,

 I recently bought a Wacom CTH-480 to use it with Linux. I had no luck so
 far, but I read on this list that 3.14 should support it. However, all I get
 is a KP when modprobing the wacom driver.

Did you build the driver on your system? If yes, what steps did you follow?


 uname -a
 Linux localhost 3.14.1 #1 SMP Tue Apr 15 11:52:03 EDT 2014 x86_64 Intel(R)
 Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux

 grep WACOM .config
 CONFIG_TABLET_USB_WACOM=m
 # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
 CONFIG_TOUCHSCREEN_WACOM_I2C=m
 CONFIG_HID_WACOM=m

 lsusb
 Bus 001 Device 004: ID 18d1:4e12 Google Inc. Nexus One (debug)
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 005 Device 061: ID 056a:0302 Wacom Co., Ltd
 Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 002 Device 003: ID 046d:c043 Logitech, Inc. MX320/MX400 Laser Mouse
 Bus 002 Device 002: ID 046d:c22d Logitech, Inc. G510 Gaming Keyboard
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

 modprobe wacom:
 http://i.imgur.com/U9tSNdg.jpg

 I also tried to modprobe wacom_i2c and hid-wacom before wacom, same
 result.

Intuos is an USB device. You only need wacom.ko. I wonder why the
other two cause panic though.

 The tablet work fine on my Mac

Yeah, it means we are most likely facing a driver issue.

Ping

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


  1   2   3   4   5   6   7   8   >