From patchwork Thu Oct 25 14:09:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 1644351 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 5D3E0DF2AB for ; Thu, 25 Oct 2012 14:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756331Ab2JYOLM (ORCPT ); Thu, 25 Oct 2012 10:11:12 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:62566 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946075Ab2JYOLK (ORCPT ); Thu, 25 Oct 2012 10:11:10 -0400 Received: by mail-we0-f174.google.com with SMTP id t9so859354wey.19 for ; Thu, 25 Oct 2012 07:11:09 -0700 (PDT) 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=PxJAgFTi5vE1iZFf2HcgPR5bGUb/039jCvpx4CY+a5k=; b=Zx7pflJHaBzHaGWTpTSk9YINjEdSdSwUHsrHm0QTF4wkd7NvUXDLDe+X+4K/zi7ttg Xxfw4BX4J8FU2kJFyicSwzhAh7DPrr3U7NUSXBBkuKEfLsZa4iSZFHU72Nh+3vo0iHVB RQ7rs3M3xq74fi4+6R6Qikd0t38yggQHlwKog20YZW6WyLj69KTPm36Kx58WYafceFlW wzuOb4qoduq7R0X63GcmfSRH4euw5GOgdLgwhL95VjUaOF31/eNveWhPjAiQASM2IbNU qwi8sBu/NlfgnGQptbLhhMTtzVA+wpB9r5/ZPJP4FK3L4Jjv7vV2JI3HQtbRk5GtiF1+ 49PA== Received: by 10.180.102.131 with SMTP id fo3mr10814623wib.1.1351174269035; Thu, 25 Oct 2012 07:11:09 -0700 (PDT) Received: from miniplouf.lan (lan31-8-82-247-176-67.fbx.proxad.net. [82.247.176.67]) by mx.google.com with ESMTPS id bn7sm11429654wib.8.2012.10.25.07.11.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 07:11:08 -0700 (PDT) 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 06/10] HID: hid-multitouch: move ALWAYS_VALID quirk check Date: Thu, 25 Oct 2012 16:09:45 +0200 Message-Id: <1351174189-24719-7-git-send-email-benjamin.tissoires@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351174189-24719-1-git-send-email-benjamin.tissoires@gmail.com> References: <1351174189-24719-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 Win 8 device specification changed the requirements for the hid usages of the multitouch devices. Now InRange is optional and must be only used when the device supports hovering. This ensures that the quirk ALWAYS_VALID is taken into account and also ensures its precedence over the other VALID* quirks. Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-multitouch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index ff2354c..c8290e2 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -506,7 +506,7 @@ static int mt_compute_slot(struct mt_device *td, struct input_dev *input) */ static void mt_complete_slot(struct mt_device *td, struct input_dev *input) { - if (td->curvalid) { + if (td->curvalid || td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID) { int slotnum = mt_compute_slot(td, input); struct mt_slot *s = &td->curdata; @@ -561,9 +561,7 @@ static int mt_event(struct hid_device *hid, struct hid_field *field, if (hid->claimed & HID_CLAIMED_INPUT) { switch (usage->hid) { case HID_DG_INRANGE: - if (quirks & MT_QUIRK_ALWAYS_VALID) - td->curvalid = true; - else if (quirks & MT_QUIRK_VALID_IS_INRANGE) + if (quirks & MT_QUIRK_VALID_IS_INRANGE) td->curvalid = value; break; case HID_DG_TIPSWITCH: