aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2014-05-15 16:52:29 -0400
committerJiri Kosina <jkosina@suse.cz>2014-05-16 05:12:46 -0400
commit876e7a8a111a4277ea35e5314a5fafc18346d3ca (patch)
tree1f6021197542d1b6757bf8384e5cc0af3dbbde1e /drivers/hid
parentb668fdce41858feea6052419796beb36f1c60540 (diff)
HID: rmi: fix masks for x and w_x data
The F11 data in the HID report contains four bits of data for w_x and the least significant bits of x. Currently only the first three bits are being used which is resulting in small jumps in the position data on the x axis and in the w_x data. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-rmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index 7ebdc960942b..c529b033ba9e 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -277,9 +277,9 @@ static void rmi_f11_process_touch(struct rmi_data *hdata, int slot,
277 input_mt_report_slot_state(hdata->input, MT_TOOL_FINGER, 277 input_mt_report_slot_state(hdata->input, MT_TOOL_FINGER,
278 finger_state == 0x01); 278 finger_state == 0x01);
279 if (finger_state == 0x01) { 279 if (finger_state == 0x01) {
280 x = (touch_data[0] << 4) | (touch_data[2] & 0x07); 280 x = (touch_data[0] << 4) | (touch_data[2] & 0x0F);
281 y = (touch_data[1] << 4) | (touch_data[2] >> 4); 281 y = (touch_data[1] << 4) | (touch_data[2] >> 4);
282 wx = touch_data[3] & 0x07; 282 wx = touch_data[3] & 0x0F;
283 wy = touch_data[3] >> 4; 283 wy = touch_data[3] >> 4;
284 wide = (wx > wy); 284 wide = (wx > wy);
285 major = max(wx, wy); 285 major = max(wx, wy);