From patchwork Thu Oct 17 00:06:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 3058251 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 48559BF924 for ; Thu, 17 Oct 2013 00:06:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8172E2047C for ; Thu, 17 Oct 2013 00:06:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F0F820464 for ; Thu, 17 Oct 2013 00:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760690Ab3JQAGs (ORCPT ); Wed, 16 Oct 2013 20:06:48 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:64489 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760618Ab3JQAGs (ORCPT ); Wed, 16 Oct 2013 20:06:48 -0400 Received: by mail-pb0-f44.google.com with SMTP id xa7so1520979pbc.31 for ; Wed, 16 Oct 2013 17:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wVNJhG3+QvX/epcr4PV78bneFNAByhdbSMPbBP643FY=; b=XG4KwNodwtfEcEbj3IJ2nvetofJ6179R7p6o9H8huXFzrfdbSkUP+tzeZVowvWK0JW O0KLv8HMwFxV4hNtYsSkeWs2rrCm31f34YzmovEFti1eo3tgJO65QnmWK6YT7Oa7TxxF HA3dA8tmZCyceOq2VWT+SbpbiXfLyBf2e3HxguH6jy6AFQv8wdfhS7HqScBWIfvXmQIy 1WIkUmJ/C4mz/w7TeIsYupM3vvf9mXhzpLIE1gh9Q7MRzgLJdtAPdYRNWey8aNCSIHUS dNWtoANuK0e5ytzfUpJoqDDgBf9Ui+j4TL7a4sT+fDuqzv2BcYsbi9QMtAxd1V1WnEQo p5cw== X-Received: by 10.68.255.229 with SMTP id at5mr5487756pbd.130.1381968407837; Wed, 16 Oct 2013 17:06:47 -0700 (PDT) Received: from wacom-XPS-8500.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id go4sm93724098pbb.15.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 17:06:46 -0700 (PDT) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, killertofu@gmail.com, Ping Cheng Subject: [PATCH] input: wacom - make sure touch_max is set for touch devices Date: Wed, 16 Oct 2013 17:06:39 -0700 Message-Id: <1381968399-18075-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Old single touch Tablet PCs do not have touch_max set at wacom_features. Since touch device at lease supports one finger, assign touch_max to 1 when touch usage is defined in its HID Descriptor and touch_max is not pre-defined. Signed-off-by: Ping Cheng --- This patch is based on last posted (unmerged) patch: "add support for three new Intuos devices" --- drivers/input/tablet/wacom_sys.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 81d5910..28066bc 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct usb_device *dev = interface_to_usbdev(intf); char limit = 0; /* result has to be defined as int for some devices */ - int result = 0; + int result = 0, touch_max = 0; int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; unsigned char *report; @@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf, if (usage == WCM_DESKTOP) { if (finger) { features->device_type = BTN_TOOL_FINGER; - + /* touch device at least supports one touch point */ + touch_max = 1; switch (features->type) { case TABLETPC2FG: features->pktlen = WACOM_PKGLEN_TPC2FG; @@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf, } out: + if (!features->touch_max && touch_max) + features->touch_max = touch_max; result = 0; kfree(report); return result;