From patchwork Wed Nov 14 15:59:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 1742211 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 09DDADF264 for ; Wed, 14 Nov 2012 16:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423072Ab2KNQAo (ORCPT ); Wed, 14 Nov 2012 11:00:44 -0500 Received: from mail-wg0-f44.google.com ([74.125.82.44]:38389 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422874Ab2KNQAB (ORCPT ); Wed, 14 Nov 2012 11:00:01 -0500 Received: by mail-wg0-f44.google.com with SMTP id dr13so307340wgb.1 for ; Wed, 14 Nov 2012 08:00:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=a+1pl4AdU4E2Hek47KOb+tMbh2DJ/qh1BlFHXh5SI5E=; b=ufhKv0gtn+9h69AsGkdbyT8tjQUugOvaTkwy7UMKOBY/JvXTIflKjjSiS9YCz2Nqwx XVRNYorzeTLQs03H7OqO1cHBAyRZPOCIABVdZlOZycQFbCoct60ojDPTr1jFeG8MkApH sqnrymU8lt1dyBMPsaOPL0wofJE8kPm4ruPnFBu95MtXq2c9xlkf+cEwBwG+qSs9cZQJ LkLfXAYE0elr5Ef+GIjVWZL4NK8uyV33t9023iwaBnNkJrpD9M02iwPko5dl5uQzdGO7 g0LlAwjs9q2ySBYIk0cxUeGaTG9mQvlp6cspjDd7x0r7+zMK1HDCEwatep/4704hmwG7 H4yA== Received: by 10.216.136.157 with SMTP id w29mr1857725wei.148.1352908800150; Wed, 14 Nov 2012 08:00:00 -0800 (PST) Received: from localhost.localdomain.com (lan31-8-82-247-176-67.fbx.proxad.net. [82.247.176.67]) by mx.google.com with ESMTPS id r10sm3050116wiz.0.2012.11.14.07.59.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Nov 2012 07:59:59 -0800 (PST) From: Benjamin Tissoires To: "benjamin.tissoires" , Dmitry Torokhov , Henrik Rydberg , Jiri Kosina , Stephane Chatty , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 13/14] HID: hid-multitouch: fix Win 8 protocol Date: Wed, 14 Nov 2012 16:59:25 +0100 Message-Id: <1352908766-4492-14-git-send-email-benjamin.tissoires@gmail.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1352908766-4492-1-git-send-email-benjamin.tissoires@gmail.com> References: <1352908766-4492-1-git-send-email-benjamin.tissoires@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The Win 8 protocol specify the fact that each valid touch must be reported within a frame until it is released. We can therefore use the always_valid quirk and dismiss reports when we see duplicate contacts ID. We recognize Win8 certified devices from their vendor feature 0xff0000c5 where Microsoft put a signed blob in the report to check if the device passed the certification. Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-multitouch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 5f26b2f..efae60c 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -295,6 +295,18 @@ static void mt_feature_mapping(struct hid_device *hdev, td->maxcontacts = td->mtclass.maxcontacts; break; + case 0xff0000c5: + if (field->report_count == 256 && field->report_size == 8) { + /* Win 8 devices need special quirks */ + __s32 *quirks = &td->mtclass.quirks; + *quirks |= MT_QUIRK_ALWAYS_VALID; + *quirks |= MT_QUIRK_IGNORE_DUPLICATES; + *quirks |= MT_QUIRK_HOVERING; + *quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP; + *quirks &= ~MT_QUIRK_VALID_IS_INRANGE; + *quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE; + } + break; } }