Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935742Ab2JYOLN (ORCPT ); Thu, 25 Oct 2012 10:11:13 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1654 Lines: 44 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: -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/