From patchwork Fri Nov 23 15:31:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 1796111 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 ACCC43FCAE for ; Fri, 23 Nov 2012 15:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753796Ab2KWPcA (ORCPT ); Fri, 23 Nov 2012 10:32:00 -0500 Received: from mail-wg0-f44.google.com ([74.125.82.44]:44951 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421Ab2KWPb6 (ORCPT ); Fri, 23 Nov 2012 10:31:58 -0500 Received: by mail-wg0-f44.google.com with SMTP id dr13so682915wgb.1 for ; Fri, 23 Nov 2012 07:31:57 -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=u9aHm4tHz4zTB7/mumzSbjGc6Qj/wgk2010Z4EA2Ffw=; b=ihLFt+Gh+49Jr7aG+TzzM18zMESjDWxKavTqDbMc/3l4y29wvGhMN3SNPOqvexXoik BcrPDIpYrl6hZHVo/e6cCnc13fAnSK6RBtvwrqDStscY5fXU+7B87aJmH0Qs4/4mv6M/ ibMbtGaRfstJ/sIwwMDsDd9c+/27L6nieNRkJiJnvnbyimx7eUYsO91fKcVJbwm0ieLm OPlxtohONe+uevibiZ4RwKdsnLU3i+rCu7Lvn72QYBq8QjN1iD9Vi/aMwm1qsU/e5prQ /HycFRQc3QL72fY2W9/W9LI4FEoFRpQspRNsWWQbkrqXXbP8Tmltr439Xpgak6Lj+2sB AqvA== Received: by 10.216.143.105 with SMTP id k83mr775142wej.15.1353684717647; Fri, 23 Nov 2012 07:31:57 -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 y3sm8996809wix.6.2012.11.23.07.31.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 07:31:57 -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 09/11] HID: hid-multitouch: check if ContactCount is given for default quirk Date: Fri, 23 Nov 2012 16:31:32 +0100 Message-Id: <1353684694-5723-10-git-send-email-benjamin.tissoires@gmail.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1353684694-5723-1-git-send-email-benjamin.tissoires@gmail.com> References: <1353684694-5723-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 By testing the new MT_CLS_DEFAULT against the collection of device I have[1], I noticed that eGalax ones do not work because they don't provide the field ContactCount in their report descriptor. Removing this quirk for this kind of device allows them to work. [1] https://github.com/bentiss/hid-devices -> all these devices can be reinjected in the hid subsystem through uhid (kernel > 3.6) and hid-replay here: https://github.com/bentiss/hid-replay Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-multitouch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 36cf346..5e0a4d7 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -263,6 +263,9 @@ static ssize_t mt_set_quirks(struct device *dev, td->mtclass.quirks = val; + if (!td->contactcount) + td->mtclass.quirks &= ~MT_QUIRK_CONTACT_COUNT_ACCURATE; + return count; } @@ -856,6 +859,9 @@ static void mt_input_configured(struct hid_device *hdev, struct hid_input *hi) input_mt_init_slots(input, td->maxcontacts, td->mt_flags); + if (!td->contactcount) + cls->quirks &= ~MT_QUIRK_CONTACT_COUNT_ACCURATE; + td->mt_flags = 0; }