# Re: \[PATCH 2/4\] Input: wacom: Override 'pressure\_max' with value from HID\_USAGE\_PRESSURE

- From: Aaron Armstrong Skomra \<hidden\>
- Date: 2014-02-27 18:27:53 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2014/02/8923279
- Thread: https://ratatoskr.run/linux-input/2014/02/8923279/t.md

```text
Tested-by: Aaron Skomra <redacted>


On Thu, Jan 30, 2014 at 10:48 AM, Jason Gerecke [ref]wrote:

> The 0xEC sensor is used in multiple tablet PCs and curiously has
> versions that report 256 levels of pressure (Samsung Slate 7)
> as well as versions that report 1024 levels (Lenovo Thinkpad Yoga).
> To allow both versions to work properly, we allow the value of
> HID_USAGE_PRESSURE reported to override pressure_max.
>
> Signed-off-by: Jason Gerecke <redacted>
> ---
>  drivers/input/tablet/wacom_sys.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/input/tablet/wacom_sys.c
> b/drivers/input/tablet/wacom_sys.c
> index 5be6177..611fc39 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -24,6 +24,7 @@
>  #define HID_USAGE                      0x09
>  #define HID_USAGE_X                    ((HID_USAGE_PAGE_DESKTOP << 16) |
> 0x30)
>  #define HID_USAGE_Y                    ((HID_USAGE_PAGE_DESKTOP << 16) |
> 0x31)
> +#define HID_USAGE_PRESSURE             ((HID_USAGE_PAGE_DIGITIZER << 16)
> | 0x30)
>  #define HID_USAGE_X_TILT               ((HID_USAGE_PAGE_DIGITIZER << 16)
> | 0x3d)
>  #define HID_USAGE_Y_TILT               ((HID_USAGE_PAGE_DIGITIZER << 16)
> | 0x3e)
>  #define HID_USAGE_FINGER               ((HID_USAGE_PAGE_DIGITIZER << 16)
> | 0x22)
> @@ -465,6 +466,14 @@ static int wacom_parse_hid(struct usb_interface *intf,
>                                         wacom_retrieve_report_data(intf,
> features);
>                                 i++;
>                                 break;
> +
> +                       case HID_USAGE_PRESSURE:
> +                               if (pen) {
> +                                       features->pressure_max =
> +
> get_unaligned_le16(&report[i + 3]);
> +                                       i += 4;
> +                               }
> +                               break;
>                         }
>                         break;
>
> --
> 1.8.5.3
>
>


-- 
Aaron Skomra
skomra-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
503-208-5430
```

## Attachments

- [(unnamed)](https://ratatoskr.run/linux-input/2014/02/8923279/attachment/0) (text/plain, 0 bytes)
