From patchwork Thu Oct 19 08:23:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Martin X-Patchwork-Id: 10016175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22DCB60215 for ; Thu, 19 Oct 2017 08:23:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1247F28708 for ; Thu, 19 Oct 2017 08:23:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 056CF28B29; Thu, 19 Oct 2017 08:23:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9388528708 for ; Thu, 19 Oct 2017 08:23:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277AbdJSIXP (ORCPT ); Thu, 19 Oct 2017 04:23:15 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:56517 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752225AbdJSIXM (ORCPT ); Thu, 19 Oct 2017 04:23:12 -0400 Received: by mail-wr0-f195.google.com with SMTP id r79so7412066wrb.13 for ; Thu, 19 Oct 2017 01:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:reply-to; bh=WmuI+YnYB25mUJHFzHevE1j6A86ctuafdamtQA1DArc=; b=J7nBcD8HhCkRW7hPeoRknLUPrvg3oaawQTcoCjX1kMSlrjAPHKCILibXYBUHY3umEy RpAuI4ofNpOhu3svfZwQc8SV+HapMh6Yf2RVczqPhIg0mrTjjbqIYqoiMKWlAol6xome Fwn7j5IFLOFnzyeJgaXMGbbh1UN5SSBAlcQ7BQ0IoU59irRgrilzcYtpb4NC0og4bqPY tUwW7KYgzO1bbQ6KCdZem6ivYnpS0+THmSiMy7Wq+0JWwdkrWFp/GpHLo0UD1d3JBS0Z fnJ11ICc+aSrhoOmsvkjvMsMlv1i4hD31PvdJNSY1toGeeS6kZjne364tW85/WMdMdhO BAAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:reply-to; bh=WmuI+YnYB25mUJHFzHevE1j6A86ctuafdamtQA1DArc=; b=Ti82oRX5AernMfTT7WbYIAEmkN/5jZopdhSxQfCQF3r0A7jND9kPqS6mzH2KPZLHY3 YtVNJz65ASOfr7ysmynZCZRTCLR3h6sBbiiNqxHRpRim+RbrE39yAMl/ssWGMOADD63f JvtMYWP7XlhQDT+AgCmbqtauPVjLAMW4xf0yhZZP/mrmK2VNLCQ2ehJD4TGSiZjWkdE/ oQjhVRSz/qtZi9Q80e5or/jcSJknehKGrkJKBMQzyvuN0DCufsukn//oAzYkcG5KETgZ LThw7nrhJyM6CYKpDo7sDeiPw1nRJ9JlRe+8X0N9GC5ZiVNL7TvWY/hciYcBPb22dOhU GDXg== X-Gm-Message-State: AMCzsaWc1Xk4oTcqGsmt7lh85h5212rHZBZTaXleZXz7CaT16cB2yD6k oq4RLecKND2oUtMomAw2+TBdAkx2 X-Google-Smtp-Source: ABhQp+Q48PO9S8r0cnc0MXBZ4S06frV9mDnQjnc/GPwsf9O+kSVrZM7xb66c0gqxIm4LSKfUStH++Q== X-Received: by 10.223.157.45 with SMTP id k45mr822428wre.94.1508401391500; Thu, 19 Oct 2017 01:23:11 -0700 (PDT) Received: from lucifer.local.ld-linux.so (natty.ld-linux.so. [144.76.125.213]) by smtp.gmail.com with ESMTPSA id n42sm15794091wrn.56.2017.10.19.01.23.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 01:23:10 -0700 (PDT) From: Daniel Martin To: linux-input@vger.kernel.org Subject: [PATCH] HID: rmi: Lenovo X1 Cover touchpad is a buttonpad Date: Thu, 19 Oct 2017 10:23:10 +0200 Message-Id: <20171019082310.8778-1-consume.noise@gmail.com> X-Mailer: git-send-email 2.11.0 Reply-To: Daniel Martin Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Atm. the touchpad is not tagged as buttonpad. Due to the lack of it, RMI F30 adds 3 buttons (BTN_LEFT, BTN_RIGHT and BTN_MIDDLE). On the very first click after a boot one can see with evemu-record: ... E: 0.084899 0001 0110 0001 # EV_KEY / BTN_LEFT 1 E: 0.084899 0001 0111 0001 # EV_KEY / BTN_RIGHT 1 ... Then BTN_LEFT gets released, but there's no release of BTN_RIGHT. With this stuck button further clicks don't work until you switch the VT and back (X-Server, xf86-input-synaptics). There're no occurences of BTN_RIGHT after a VT switch. Fix this by tagging the device as buttonpad. The changed report looks like: Tested-by: Hendrik Langer --- evemu-record-tm3203-003-wrong.log +++ evemu-record-tm3203-003-fixed.log @@ -22,8 +22,6 @@ # Event code 14 ((null)) # Event type 1 (EV_KEY) # Event code 272 (BTN_LEFT) -# Event code 273 (BTN_RIGHT) -# Event code 274 (BTN_MIDDLE) # Event code 325 (BTN_TOOL_FINGER) # Event code 330 (BTN_TOUCH) # Event code 333 (BTN_TOOL_DOUBLETAP) @@ -116,15 +114,16 @@ # Resolution 0 # Properties: # Property type 0 (INPUT_PROP_POINTER) +# Property type 2 (INPUT_PROP_BUTTONPAD) N: Synaptics TM3203-003 I: 0003 17ef 6085 0111 -P: 01 00 00 00 00 00 00 00 +P: 05 00 00 00 00 00 00 00 B: 00 0b 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 -B: 01 00 00 07 00 00 00 00 00 +B: 01 00 00 01 00 00 00 00 00 B: 01 20 e4 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 B: 01 00 00 00 00 00 00 00 00 Signed-off-by: Daniel Martin --- drivers/hid/hid-rmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index ef241d66562e..e4937deef723 100644 --- a/drivers/hid/hid-rmi.c +++ b/drivers/hid/hid-rmi.c @@ -39,6 +39,7 @@ /* device flags */ #define RMI_DEVICE BIT(0) #define RMI_DEVICE_HAS_PHYS_BUTTONS BIT(1) +#define RMI_DEVICE_IS_BUTTONPAD BIT(2) /* * retrieve the ctrl registers @@ -692,6 +693,9 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id) if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS) rmi_hid_pdata.f30_data.disable = true; + else + if (data->device_flags & RMI_DEVICE_IS_BUTTONPAD) + rmi_hid_pdata.f30_data.buttonpad = true; data->xport.dev = hdev->dev.parent; data->xport.pdata = rmi_hid_pdata; @@ -723,7 +727,8 @@ static void rmi_remove(struct hid_device *hdev) static const struct hid_device_id rmi_id[] = { { HID_USB_DEVICE(USB_VENDOR_ID_RAZER, USB_DEVICE_ID_RAZER_BLADE_14), .driver_data = RMI_DEVICE_HAS_PHYS_BUTTONS }, - { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER), + .driver_data = RMI_DEVICE_IS_BUTTONPAD }, { HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) }, { } };