From: Andrew Duggan Date: Thu, 15 May 2014 20:52:29 +0000 (-0700) Subject: HID: rmi: fix masks for x and w_x data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=876e7a8a111a4277ea35e5314a5fafc18346d3ca;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- 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, input_mt_report_slot_state(hdata->input, MT_TOOL_FINGER, finger_state == 0x01); if (finger_state == 0x01) { - x = (touch_data[0] << 4) | (touch_data[2] & 0x07); + x = (touch_data[0] << 4) | (touch_data[2] & 0x0F); y = (touch_data[1] << 4) | (touch_data[2] >> 4); - wx = touch_data[3] & 0x07; + wx = touch_data[3] & 0x0F; wy = touch_data[3] >> 4; wide = (wx > wy); major = max(wx, wy);