Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11810891pjo; Thu, 2 Jan 2020 14:41:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxD9IrlegIb6p8iwPGBk3H2s+O8H53Xvcu4A2CHuxpIsTLIlPP6QEMhRGZfKxgtj9EH14fw X-Received: by 2002:a9d:6f85:: with SMTP id h5mr94968508otq.19.1578004869717; Thu, 02 Jan 2020 14:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578004869; cv=none; d=google.com; s=arc-20160816; b=zBy8spev0hSz+9i1qJzydmz9pI54dIcKHC6ywu/JNLAKWdyCTeeREjfTUwzHNqIUYW UioVD+lPm9pN+wHRNqdjFEsS3r8zBdwtMYbZ+pc8N5oXjjCiD6xHClqGGT/L6rEZvsS9 pMrP8h9YT812E61ohG5xh0s6qDpvVK9ACI4LYxHgjdDkqgnq+R7ae9TaD8OXSKhUDLoG 4wBlQMJWZAOmRxPQRRnDqD+Crbunk50OU8q3EzTiqRbynX+z0H2a2RVmtt48rDm4pxCp iysmlx8s1ESRVmX07QmFsrvWDkAZz7pmJrrqrcvC2saWLERFDT0IvcdUfcD3RplDuiXI iwZg== 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=X3j0V5EIQtst4LfZFpXyvh1UpPeXXr9SuBhhOgEcou4=; b=Rcw9k62eR9W4qtlg7L0PI6NB5SdY5NSXo/CPVQ8w/cXd792DRTmFbXiHgha9y1xVLM N5IPrbC4JM5tsexmV0JgFdAJGwXBc776lcOlUxe2GVBVr9X1/ZYQa5vf8sdCDaWfJOgT tCYW78Pe8jEsXh+N6LafvpweLuTLIUvj4uOtxFHj9lu1VXMa5ohD0V0pP9UYU/GU7//w iHwxtbgWXLL2qGU2QFF8YByW+AsN8Ijj8zbxg6ppCWDfSihYMY7eNBuWKzunp4mGhNlI ar7ajgw/+RZF4YTP37XIbFLcrpbNt6cdMg2HwUBbOeGA8L3obHljzaEaXLor0UjxUCGB 9lFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2RtHH6TR; 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 u16si27807136otq.92.2020.01.02.14.40.58; Thu, 02 Jan 2020 14:41:09 -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=2RtHH6TR; 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 S1730362AbgABWjT (ORCPT + 99 others); Thu, 2 Jan 2020 17:39:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:55090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731177AbgABWjS (ORCPT ); Thu, 2 Jan 2020 17:39:18 -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 546A120866; Thu, 2 Jan 2020 22:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004757; bh=Z6uOq0PO3HCgfXMAtRf+qJM8bg/nar9HCljMC2v2tHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2RtHH6TRcpoU9IPAZYvBrCJLsVUV+VLcEy+rVchGfR/Sm/Vo3/DwLnCi0vOQ4SgRl 8cyn+fneoLLRzYgWMXMQ8lVHrIqEoBB5Y1ydqIr3s0qMdAI279P3XqPZpLiUELFrL+ eLq2CJQIN8KGelYEq1wEX7eMIYw8sm6JLvheN/FY= 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 4.4 115/137] HID: Improve Windows Precision Touchpad detection. Date: Thu, 2 Jan 2020 23:08:08 +0100 Message-Id: <20200102220602.621156753@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@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 c60bb6f8eceb..7cd945575463 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -761,6 +761,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