From patchwork Wed Nov 14 15:59:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 1742131 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6119D40E03 for ; Wed, 14 Nov 2012 15:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423012Ab2KNP7z (ORCPT ); Wed, 14 Nov 2012 10:59:55 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:62102 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422999Ab2KNP7x (ORCPT ); Wed, 14 Nov 2012 10:59:53 -0500 Received: by mail-wi0-f178.google.com with SMTP id hm14so362824wib.1 for ; Wed, 14 Nov 2012 07:59:51 -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=JKCtOayHq9qtj2pO8w6W+SwH80MPP3j69yuqEon+GlA=; b=T8K0/Su/lTMy8t+nmgnPV5rZuLHA9yycWo/tk4uAnfr2UqVNqyZsNm7g99I8mz3tHB wtj10cMZJxL9TtFAdDdxGafbzc4SQU1Ayidn+tAmQry63N7C9liIqtP8ZBI//vp/b4Wi XaX/vjQkULwrt5Q2F8rUvV40epMy+auHZWUCHGk+YMIt1f6v7klOcyAE8uXlZUkUCMBj 2xrJHMXvhBuKoMZwTxt1sD+AbFdkT/5txBsZuMlGZUHk7ZINgp2XSTwjGk2aw4vb66Kl dJOqNny2ykOHZVR8ZhIWkSPnNhnZxITlPskg8q0s4qGf7hbTbYWmTnbroEPMnHOio1uc /Fvg== Received: by 10.216.204.72 with SMTP id g50mr1790234weo.160.1352908791786; Wed, 14 Nov 2012 07:59:51 -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.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Nov 2012 07:59:51 -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 08/14] HID: hid-multitouch: move ALWAYS_VALID quirk check Date: Wed, 14 Nov 2012 16:59:20 +0100 Message-Id: <1352908766-4492-9-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 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 Reviewed-by: Henrik Rydberg --- 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 54367f4..2352770 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -503,7 +503,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; @@ -554,9 +554,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: