Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17894205ybl; Thu, 2 Jan 2020 14:15:33 -0800 (PST) X-Google-Smtp-Source: APXvYqy7P8If8JuE5RvCJbsBBUYJIJeNC0uZj23fSAoSEtvvZHAToNTj939fwlCNQVw6xGa+MfOm X-Received: by 2002:a05:6830:145:: with SMTP id j5mr90969651otp.242.1578003333164; Thu, 02 Jan 2020 14:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003333; cv=none; d=google.com; s=arc-20160816; b=V+uaExFtZ/DebZi7a+xpUZpeMfuHl55kPVxcAanteQGbQqteTX9hKzGYkUkuGpEWRB B1UiVoDz5jiINirsqFSvTwbI12X9mahosB02c7J7VxUxwFf1XkJmRiZrc3fLVI2UXThF epH/2R1HjzehwiCK1uzzKyMgWlw6aKf4jg/9I8trmK+UdP0uwAR0iLY228H7vUsx+awE gsn9ALiuuXhDw1fsohRSeNCY1c0kWXoU17bb21pL7h8Jy9ukCWBFSpFP66mHQ3V55Xnb kKAjvhOtrJMhEqCbMb0Ddym3AbJ34zd+3WWOZDt2Fbx+YzyYop4CYxm0He5GBITgm4j4 R7tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iEbjEq4JOGg3nN6fMuXHp/ZjueZHROUX6ymzF2oSe/M=; b=UtSoiY5uuV9D3F3faLHtgIS+s35zshV4DTTTJKtc9DCuit1nk3v6Cuz/0iBNxXeD7v ITKm+U5ssmY8ioVT3at71DhruWphgoWAWM27JLL14ZKtvRonPP+7HR9Cg9oCjzkNM4HM 2Ts8uQ/dY96bNZCv3oXhqXLoYfp/8v3h/Wta41CLZEeA9APUbVPfnx1kniDyvR6L6UwS /R9nThJolVBZa0Wj6DuHJx8gKYPWZwBnCNWrac72TuFTb1VIhySD7Ed53sKd528W9oq6 2hJTAZ0oXtvSExySOnMvTRqfHC6xvmn9dsCVlxAQFWwxeg5lTMystLOtJuxxq0M5G4T5 xr+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I47J7YfR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25si24762368oij.175.2020.01.02.14.15.21; Thu, 02 Jan 2020 14:15:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I47J7YfR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbgABWOM (ORCPT + 99 others); Thu, 2 Jan 2020 17:14:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:54316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbgABWOJ (ORCPT ); Thu, 2 Jan 2020 17:14:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC24721D7D; Thu, 2 Jan 2020 22:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003249; bh=bsY3+57MQY04MgAMVlcxdWYcdhiuZlVcMnl6sNsU96E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I47J7YfRI3tj+uifXXZVZ97QVxHvTNUuvcSeL2S6KfkCELHOewf7TUWx7/knvg+mG /TzjrYGduuq9lKQekcsWSFV3weLIv5IkijrGkNAym+7TPdrFJ9fEZspy6CbgHBsUuT EaprSJYF1RVKOGaLBtvXwmWRjExYHFP1V0kCJebQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Bla=C5=BE=20Hrastnik?= , Benjamin Tissoires , Sasha Levin Subject: [PATCH 5.4 081/191] HID: Improve Windows Precision Touchpad detection. Date: Thu, 2 Jan 2020 23:06:03 +0100 Message-Id: <20200102215838.592071110@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Blaž Hrastnik [ Upstream commit 2dbc6f113acd74c66b04bf49fb027efd830b1c5a ] Per Microsoft spec, usage 0xC5 (page 0xFF) returns a blob containing data used to verify the touchpad as a Windows Precision Touchpad. 0x85, REPORTID_PTPHQA, // REPORT_ID (PTPHQA) 0x09, 0xC5, // USAGE (Vendor Usage 0xC5) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (0xff) 0x75, 0x08, // REPORT_SIZE (8) 0x96, 0x00, 0x01, // REPORT_COUNT (0x100 (256)) 0xb1, 0x02, // FEATURE (Data,Var,Abs) However, some devices, namely Microsoft's Surface line of products instead implement a "segmented device certification report" (usage 0xC6) which returns the same report, but in smaller chunks. 0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined) 0x85, REPORTID_PTPHQA, // REPORT_ID (PTPHQA) 0x09, 0xC6, // USAGE (Vendor usage for segment #) 0x25, 0x08, // LOGICAL_MAXIMUM (8) 0x75, 0x08, // REPORT_SIZE (8) 0x95, 0x01, // REPORT_COUNT (1) 0xb1, 0x02, // FEATURE (Data,Var,Abs) 0x09, 0xC7, // USAGE (Vendor Usage) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (0xff) 0x95, 0x20, // REPORT_COUNT (32) 0xb1, 0x02, // FEATURE (Data,Var,Abs) By expanding Win8 touchpad detection to also look for the segmented report, all Surface touchpads are now properly recognized by hid-multitouch. Signed-off-by: Blaž Hrastnik Signed-off-by: Benjamin Tissoires Signed-off-by: Sasha Levin --- drivers/hid/hid-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 2fa3587d974f..e0b241bd3070 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -781,6 +781,10 @@ static void hid_scan_feature_usage(struct hid_parser *parser, u32 usage) if (usage == 0xff0000c5 && parser->global.report_count == 256 && parser->global.report_size == 8) parser->scan_flags |= HID_SCAN_FLAG_MT_WIN_8; + + if (usage == 0xff0000c6 && parser->global.report_count == 1 && + parser->global.report_size == 8) + parser->scan_flags |= HID_SCAN_FLAG_MT_WIN_8; } static void hid_scan_collection(struct hid_parser *parser, unsigned type) -- 2.20.1