From patchwork Fri Nov 15 19:59:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 3189591 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 335BFC045B for ; Fri, 15 Nov 2013 19:59:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52A952095C for ; Fri, 15 Nov 2013 19:59:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72B032094A for ; Fri, 15 Nov 2013 19:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015Ab3KOT7Z (ORCPT ); Fri, 15 Nov 2013 14:59:25 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:38190 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996Ab3KOT7Z (ORCPT ); Fri, 15 Nov 2013 14:59:25 -0500 Received: by mail-pa0-f42.google.com with SMTP id kx10so3300531pab.29 for ; Fri, 15 Nov 2013 11:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=P/O409pb+2emh2Fi+EjUXsnD+CsUdZDw0pmibw4293s=; b=g3NaKfcvsiV9nbazIJa2V3ZW6l8I7+hTnseCiPbYOjbr5DSm5s++jq/3ggKCrcwSqE 1qzq91+KKF1RhQ/C2KpQaJ+rYVfx2z+EbulEJ99RjNLdslko3oNtRWlc9dieQDfXTleM PD/rIGx6aDa8NSmer0anwnknMRpZqjEA25x5idQziaDJmh84Gq8xCmODzsEgG3j5M4L0 FsfHfHZnUDAotxpBsAWCUTTZZAWmWZYvMrrouxtYXFhSNBHcP+Z8axss4iZbWbIO6FYS pvTYh03aedz4wW//PaBJINoqei8YAa5wPpnZDYmnhnFxbtTknsUf83Py33TJvFLKo0qC nQPQ== X-Received: by 10.68.136.101 with SMTP id pz5mr853793pbb.186.1384545565052; Fri, 15 Nov 2013 11:59:25 -0800 (PST) Received: from wacom-XPS-8500.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id py4sm6322153pbb.33.2013.11.15.11.59.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Nov 2013 11:59:24 -0800 (PST) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, killertofu@gmail.com, chris@cnpbagwell.com, peter.hutterer@who-t.net, Ping Cheng Subject: [PATCH 2/4 v3] input: wacom - make sure touch_max is set for touch devices Date: Fri, 15 Nov 2013 11:59:14 -0800 Message-Id: <1384545554-15472-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.8.3.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=-6.8 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. Tested-by: Jason Gerecke Signed-off-by: Ping Cheng Reviewed-by: Chris Bagwell --- 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 8a90da1..3d71b60 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;