On Thursday, October 26, 2017, Jason Gerecke 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 >
Reviewed-by: Ping Cheng
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