From patchwork Wed Nov 7 16:37:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 1711651 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 C26A5DFB7A for ; Wed, 7 Nov 2012 16:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753804Ab2KGQjv (ORCPT ); Wed, 7 Nov 2012 11:39:51 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:56660 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910Ab2KGQiF (ORCPT ); Wed, 7 Nov 2012 11:38:05 -0500 Received: by mail-ea0-f174.google.com with SMTP id c13so686587eaa.19 for ; Wed, 07 Nov 2012 08:38:05 -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=LMJtapPstrbyKRs73ela6uPveLhplsM/sMB+Akmuvos=; b=Dk2MHnWI9JLTfDQuvBDe5Gh2FEIJrMlEh/sCsMAJORHFy25vU9ko8KFiMX9XVET1y+ WEQYNAtBIpMJqyY3RXAaWnSKPEHmTjewxvlAw/oFH/ecjRbcbSzxw+588Mi1PJRBoPy2 /2XcrFtPlDyAu0GrZb3fzdvfsUP6DipWCPrfFZeaJQbQiQIdl/Mfer+gMdBCaOJC2m4R uneajtyw57Eid2coPTfD0Q5yI5YUWCLoRLlq8a5u2qjPsY0Go7ZcBdY/YW99P1p91Mfa l+jXI1maVelh7pISxQcGJZgv4/j1l9kKdeL0Bd5G2AXrZrAZAwml/SP6hym0OCZxc4RG F6NA== Received: by 10.14.203.69 with SMTP id e45mr17116796eeo.38.1352306284951; Wed, 07 Nov 2012 08:38:04 -0800 (PST) Received: from miniplouf.banquise.com (lan31-8-82-247-176-67.fbx.proxad.net. [82.247.176.67]) by mx.google.com with ESMTPS id a44sm64766844eeo.7.2012.11.07.08.38.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Nov 2012 08:38:04 -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 v3 08/13] HID: hid-multitouch: move ALWAYS_VALID quirk check Date: Wed, 7 Nov 2012 17:37:31 +0100 Message-Id: <1352306256-12180-9-git-send-email-benjamin.tissoires@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1352306256-12180-1-git-send-email-benjamin.tissoires@gmail.com> References: <1352306256-12180-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 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: