Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1639215rwb; Sun, 14 Aug 2022 08:29:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5CDGTFSOUyRre1R8wWg0+BeM9XTDacIiO+DJHwTe85kiiPaAluGrnJZWvkLFluYwKXnG7a X-Received: by 2002:a17:90b:354c:b0:1f7:aea5:a915 with SMTP id lt12-20020a17090b354c00b001f7aea5a915mr23996372pjb.159.1660490980503; Sun, 14 Aug 2022 08:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660490980; cv=none; d=google.com; s=arc-20160816; b=iBhsZdX70x15JZnx6KPZnG3XHt3HdBFmP1s2IKyh9jKNVkVKO2OYqA8j1vlTFZlLPi qUnGgzGjuHoq++RqPi7VOyR9D3Zpqn6zJAVzLRI2dlXsz0r6DUcKrm/dZSOb4eilhZ+2 Rm11KYrTfzdVj2QYDWbBaxVAgKGylpXZQOUgQbad8alPNXbPDNsB6NGv4svVJhz71OOb JGrLqO8pZpEm5wgwBsD4SygsXJDe68ym0/W7yhwlv2EsN8EFKWNZD6AZkoNxjvBsSs/7 E6OLGr5V7ry4zcNEFo/Qh03h4cEhM4ummRnTg/SNQYYwjmgGcHb/ZRIlyIRrolbzUWTU hk2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G08OuEo9CImwPUBAXJeaQuBCZWo2g+UB7ZcGsD3yuao=; b=PZ7FJOr9MMUT5dbtFZr1XS8sxwz/ZUNTrdptxz0XSPxbRN+E+i/G7WUUc0WcuM3z9K QjgLl4HXFYWSCSPPDCa3pEFyYrDK1owowdEpyfsR8HZBAWBwpNPTP8FrrN+9wjDvv0hA VThPQO1VkRdzX6Lj6hpCd69wRWaWkmGCdT5kq8QVkyawEFfdz/3C1HdlQ9O5YlyAzOiv u2w6yQV3XT4Buc3d+ZKWijdLf916wlEKgSQY2D5XpRMEvwB+31kl45ntImuko6Al+p2J entm1pSAlVXoG3OPmdm939wsgX4f+LI34P1kidzCxWq/Qul/k8vyZep6xYlhbue8Fz3G 2omg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=suSfbhv3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc8-20020a170902930800b0016d31bb7d11si7645364plb.473.2022.08.14.08.29.30; Sun, 14 Aug 2022 08:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=suSfbhv3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbiHNPYs (ORCPT + 99 others); Sun, 14 Aug 2022 11:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbiHNPYn (ORCPT ); Sun, 14 Aug 2022 11:24:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D066D65ED; Sun, 14 Aug 2022 08:24:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6A85660B90; Sun, 14 Aug 2022 15:24:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED1E4C433D7; Sun, 14 Aug 2022 15:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660490681; bh=opRpwBXuIqKfJEKdV/gdL/Q2qqUENx7dxO38eYQHJZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=suSfbhv3gBI3+CXyAMxrz/OjfQfHxBWMdSVgLpern7+1L9oNtbwF6gJhsdj8hjvlv OaR4YIsI5FCwiih/1m0JJ7iyNUEyoIcJF9TwdzXngsNPz5gaA1hBtVmdFLzAxxgrzz UExlNvWgC9A9xynsWR3wsyFhLAiDhAUD1viab0bfwcGbqHcv5ELhexP5FNE4VTLzs6 XUyCfSjs2wdapCUgfHnYznMkJFG8aS2THU7DXESoeW7m76TiK3+kyqWhS1xUJWcGrs lwnyOQ+8aolfbltc1+YK5Du9RX04XqbF5/bRJj6C1ery64NpP+pNwbES0wAOimdEY2 QHZD7HY7PEA+A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tao Jin , Jiri Kosina , Sasha Levin , jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 02/64] HID: multitouch: new device class fix Lenovo X12 trackpad sticky Date: Sun, 14 Aug 2022 11:23:35 -0400 Message-Id: <20220814152437.2374207-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814152437.2374207-1-sashal@kernel.org> References: <20220814152437.2374207-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tao Jin [ Upstream commit 54eed5c7b938dc4ef6b14d4ee048bbdafdbce352 ] The trackpad of the given device sends continuous report of pointers status as per wxn8 spec. However, the spec did not clarify when the fingers are lifted so fast that between the interval of two report frames fingers on pad reduced from >=2 to 0. The second last report contains >=2 fingers with tip state 1 and the last report contains only 1 finger with tip state 0. Although this can happen unfrequently, a quick fix will be improve the consistency to 100%. A quick fix is to disable MT_QUIRK_ALWAYS_VALID and enable MT_QUIRK_NOT_SEEN_MEANS_UP. Test for hid-tools is added in [1] In addition to this, I2C device 04CA:00B1 may also need similar class but with MT_QUIRK_FORCE_MULTI_INPUT disabled (but it does not harm to enable it on non-multi-input device either). The respective owner has been notified and a patch may coming soon after test. [1]: https://gitlab.freedesktop.org/libevdev/hid-tools/-/merge_requests/130 Signed-off-by: Tao Jin Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-multitouch.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 6bb3890b0f2c..2e72922e36f5 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -194,6 +194,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app); #define MT_CLS_WIN_8_FORCE_MULTI_INPUT 0x0015 #define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016 #define MT_CLS_WIN_8_NO_STICKY_FINGERS 0x0017 +#define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU 0x0018 /* vendor specific classes */ #define MT_CLS_3M 0x0101 @@ -286,6 +287,15 @@ static const struct mt_class mt_classes[] = { MT_QUIRK_WIN8_PTP_BUTTONS | MT_QUIRK_FORCE_MULTI_INPUT, .export_all_inputs = true }, + { .name = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU, + .quirks = MT_QUIRK_IGNORE_DUPLICATES | + MT_QUIRK_HOVERING | + MT_QUIRK_CONTACT_CNT_ACCURATE | + MT_QUIRK_STICKY_FINGERS | + MT_QUIRK_WIN8_PTP_BUTTONS | + MT_QUIRK_FORCE_MULTI_INPUT | + MT_QUIRK_NOT_SEEN_MEANS_UP, + .export_all_inputs = true }, { .name = MT_CLS_WIN_8_DISABLE_WAKEUP, .quirks = MT_QUIRK_ALWAYS_VALID | MT_QUIRK_IGNORE_DUPLICATES | @@ -783,6 +793,7 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, case HID_DG_CONFIDENCE: if ((cls->name == MT_CLS_WIN_8 || cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT || + cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU || cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP) && (field->application == HID_DG_TOUCHPAD || field->application == HID_DG_TOUCHSCREEN)) @@ -2035,7 +2046,7 @@ static const struct hid_device_id mt_devices[] = { USB_DEVICE_ID_LENOVO_X1_TAB3) }, /* Lenovo X12 TAB Gen 1 */ - { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU, HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8, USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X12_TAB) }, -- 2.35.1