summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-09-05 13:15:33 +0200
committerPeter Wu <lekensteyn@gmail.com>2013-09-05 13:15:33 +0200
commit51bf8e01087685b4bd1b5e8f6154812842f222e0 (patch)
tree8785e775c58012e7e14693b9ef5d03a999710106
parent18f25c05b2919f705ba0d251c8674b3e13f2c080 (diff)
downloadlinux-51bf8e01087685b4bd1b5e8f6154812842f222e0.tar.gz
HID: logitech-wtp: fix pressure level for TPRXY
This T650 always reports pressure level 0, even if I sit with my full body on it (ok, not my full body, but I pushed it pretty hard with my fingers). As a result, the pointer does not move! Let's fake some high value for now... raw[5] is the area, if you put a big hand on the touchpad then obviously you will get the pointer moving. raw[4] (Force) is the correct field here. Signed-off-by: Peter Wu <lekensteyn@gmail.com>
-rw-r--r--drivers/hid/hid-logitech-wtp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hid/hid-logitech-wtp.c b/drivers/hid/hid-logitech-wtp.c
index d46fa8afbd52..16e24a68e2a7 100644
--- a/drivers/hid/hid-logitech-wtp.c
+++ b/drivers/hid/hid-logitech-wtp.c
@@ -355,7 +355,7 @@ static int tprxy_parse_feature_event(struct wtp_data *wtp,
event->fingers[i].status = (raw[2] >> 6) & 3;
event->fingers[i].abs_x = make_u16(raw[0] & 0x3f, raw[1]);
event->fingers[i].abs_y = make_u16(raw[2] & 0x3f, raw[3]);
- event->fingers[i].pressure = raw[5];
+ event->fingers[i].pressure = raw[4];
event->fingers[i].id = high_nib(raw[6]);
}
event->buttons = get_bit(buf[8], 2);
@@ -627,7 +627,11 @@ static void wtp_process_event_finger(struct wtp_data *fd,
input_event(fd->input, EV_ABS, ABS_MT_POSITION_Y,
ORIGIN_IS_HIGH(fd->info.origin) ?
finger->abs_y : fd->info.abs_max_y - finger->abs_y);
- input_event(fd->input, EV_ABS, ABS_MT_PRESSURE, finger->pressure);
+ if (finger->pressure == 0) {
+ /* fake pressure because firmware always reports 0?! */
+ input_event(fd->input, EV_ABS, ABS_MT_PRESSURE, 100);
+ } else
+ input_event(fd->input, EV_ABS, ABS_MT_PRESSURE, finger->pressure);
}
/* Report an event as input_events */