From patchwork Sat Aug 13 00:09:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 1062572 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7D06S0V028722 for ; Sat, 13 Aug 2011 00:08:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610Ab1HMAIH (ORCPT ); Fri, 12 Aug 2011 20:08:07 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:48570 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343Ab1HMAIG (ORCPT ); Fri, 12 Aug 2011 20:08:06 -0400 Received: by gya6 with SMTP id 6so2310671gya.19 for ; Fri, 12 Aug 2011 17:08:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=6dBblobduE4rxPUgZJs64LbdpU98Uj0oZcopRaWUC8k=; b=hcYEKiebZEqKJEUfLQl3sasI+3ZZNzWqfynJYv1itdJ/cBL/CQPdUHDP1kdesYMi/K VP8g6L7CQzU+23fKsgKwS/IewnIquq6dsttOle+8AeApvwBSZJqzjXFIM1XfiQRMNdmq 0FgxcNALSvt2GPkzP5jPh7NmPlWQEuiNZ89lY= Received: by 10.90.217.5 with SMTP id p5mr1586059agg.60.1313194085910; Fri, 12 Aug 2011 17:08:05 -0700 (PDT) Received: from localhost.localdomain ([204.119.25.44]) by mx.google.com with ESMTPS id c15sm1397056anm.20.2011.08.12.17.08.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Aug 2011 17:08:05 -0700 (PDT) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, Ping Cheng , Ping Cheng Subject: [PATCH 4/5] input: wacom - report id 3 returns 4 bytes data Date: Fri, 12 Aug 2011 17:09:44 -0700 Message-Id: <1313194184-5061-1-git-send-email-pinglinux@gmail.com> X-Mailer: git-send-email 1.7.6 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 13 Aug 2011 00:08:08 +0000 (UTC) Signed-off-by: Ping Cheng --- drivers/input/tablet/wacom_sys.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 34edaae..958b4eb 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -306,23 +306,25 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat int limit = 0, report_id = 2; int error = -ENOMEM; - rep_data = kmalloc(2, GFP_KERNEL); + rep_data = kmalloc(4, GFP_KERNEL); if (!rep_data) return error; - /* ask to report tablet data if it is 2FGT Tablet PC or + /* ask to report tablet data if it is MT Tablet PC or * not a Tablet PC */ if (features->type == TABLETPC2FG) { do { rep_data[0] = 3; rep_data[1] = 4; + rep_data[2] = 0; + rep_data[3] = 0; report_id = 3; error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, - report_id, rep_data, 2); + report_id, rep_data, 4); if (error >= 0) error = usb_get_report(intf, WAC_HID_FEATURE_REPORT, report_id, - rep_data, 3); + rep_data, 4); } while ((error < 0 || rep_data[1] != 4) && limit++ < WAC_MSG_RETRIES); } else if (features->type != TABLETPC) { do {