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  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 >


Acked-by: Ping Cheng 

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


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

2017-11-03 Thread Jason Gerecke
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 
---
 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