summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kempin <denniskempin@chromium.org>2013-05-31 16:37:21 -0700
committerPeter Wu <lekensteyn@gmail.com>2013-08-26 15:45:33 +0200
commit00e4e5cdc593cfae27779b9013bc6701d9da9d57 (patch)
tree7b9c987d054ff084a1647eb9e182604ba330c786
parent88fdc365bd99ba67ff6dae5251cad35acb1cbe4e (diff)
downloadlinux-00e4e5cdc593cfae27779b9013bc6701d9da9d57.tar.gz
CHROMIUM: hid-logitech-wtp: Fixed button issue on WTP
The buttons on WTP do not work when a finger is present on the touchpad. This is caused by the raw event overriding the button state. WTP does not send button states in the raw events. This CL adds a new event format to distinguish between those two cases. BUG=chromium:240850 TEST=manual test on WTP device Change-Id: Ia00cf88bd0733727eecb7ea625670a26b152ecfc Signed-off-by: Dennis Kempin <denniskempin@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/57280
-rw-r--r--drivers/hid/hid-logitech-wtp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hid/hid-logitech-wtp.c b/drivers/hid/hid-logitech-wtp.c
index 01d04a1dfe98..6baa0d98f72a 100644
--- a/drivers/hid/hid-logitech-wtp.c
+++ b/drivers/hid/hid-logitech-wtp.c
@@ -235,7 +235,8 @@ static void generic_parse_mouse_rel(u8 *raw,
#define TPRXY_EVENT_TOUCHPAD_RAW_TOUCH_POINTS 0x00
#define TPRXY_FORMAT_RAW 0x01
-#define TPRXY_FORMAT_MOUSE_EXTENDED 0x02
+#define TPRXY_FORMAT_RAW_SEPARATE_BUTTON_REPORT 0x02
+#define TPRXY_FORMAT_MOUSE_EXTENDED 0x03
#define TPRXY_DEFAULT_RES 1000 /* DPI */
@@ -260,6 +261,8 @@ static int tprxy_init(struct hidpp_device *hidpp_dev)
} else {
params = 0x5; /* enhanced sensitivity + raw */
fd->feature.event_format = TPRXY_FORMAT_RAW;
+ if (hidpp_dev->hid_dev->product == UNIFYING_DEVICE_ID_WIRELESS_TOUCHPAD)
+ fd->feature.event_format = TPRXY_FORMAT_RAW_SEPARATE_BUTTON_REPORT;
}
ret = hidpp_send_fap_command_sync(hidpp_dev, fd->feature.index,
@@ -317,7 +320,8 @@ static int tprxy_parse_other_event(struct wtp_data *wtp,
if (report->report_id != GENERIC_EVENT_MOUSE)
return -1;
- generic_parse_mouse_button(raw[1], event);
+ if (wtp->feature.event_format != TPRXY_FORMAT_RAW)
+ generic_parse_mouse_button(raw[1], event);
if (wtp->feature.event_format != TPRXY_FORMAT_MOUSE_EXTENDED)
return 0;
@@ -350,7 +354,7 @@ static int tprxy_parse_feature_event(struct wtp_data *wtp,
dbg_hid("%s\n", __func__);
- if (wtp->feature.event_format != TPRXY_FORMAT_RAW)
+ if (wtp->feature.event_format == TPRXY_FORMAT_MOUSE_EXTENDED)
return -1;
for (i = 0; i < TPRXY_SLOTS_PER_FRAME; ++i) {
@@ -370,7 +374,8 @@ static int tprxy_parse_feature_event(struct wtp_data *wtp,
event->end_of_frame = true;
event->has_abs = true;
- event->has_buttons = 0x1;
+ if (wtp->feature.event_format == TPRXY_FORMAT_RAW)
+ event->has_buttons = 0x1;
return 0;
}