lkml.org 
[lkml]   [2014]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] Input: wacom - Don't discard bits from upper byte of pressure value
Date
The mask here previously discarded all but one bit of data from the
upper byte of the pressure value. That would be correct for a tablet
with at most 512 pressure values, but is incorrect for a tablet with
1024 or more pressure values.

We can support as many tablets as possible by simply not discarding
any of the bits from this byte.

Signed-off-by: Carl Worth <cworth@cworth.org>
---
drivers/input/tablet/wacom_wac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 4958081..563f197 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1037,7 +1037,7 @@ static int wacom_tpc_pen(struct wacom_wac *wacom)
input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
- pressure = ((data[7] & 0x01) << 8) | data[6];
+ pressure = (data[7] << 8) | data[6];
if (pressure < 0)
pressure = features->pressure_max + pressure + 1;
input_report_abs(input, ABS_PRESSURE, pressure);
--
1.9.0


\
 
 \ /
  Last update: 2014-02-27 00:21    [W:0.087 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site