From patchwork Sat Jun 25 00:16:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 917872 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5P0EaXq023419 for ; Sat, 25 Jun 2011 00:14:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751497Ab1FYAOe (ORCPT ); Fri, 24 Jun 2011 20:14:34 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:37399 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799Ab1FYAOd (ORCPT ); Fri, 24 Jun 2011 20:14:33 -0400 Received: by pzk9 with SMTP id 9so2057650pzk.19 for ; Fri, 24 Jun 2011 17:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=tf5p4DXaCBS7rO1L2DL3BVgHGzJ1y/LPKyEIi2O4Xew=; b=FA5LuAUeQGsZ8hdiHhumReYQvD852qnwWx+5xeChBzsXp9xjZC3mZVUJiGq66YC2l+ BsLohKJvrBKKb/fT0mGoli1L4q6xiSOYlzxnGUVe8eikYzZKE93mCU1bjUiQjF7/hOo1 d8lJ4j741M4FPDq5QP5a7+wIQpLwFyOjFKuSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=A0ILLeqHqvETGdVqGSgMcLTg0tcUggP/5SlYXjujffRTNVvw3VsyyKPNBL8ccjkTvj 0ULpGyWr74K9KTJvoaG/41OVhmepFlAoVjZer93XsGGCm66c1f+3J4o9gecU+tEAnau5 Z4VcTE427bETHLkVReEKJkbALG3uyz0vT3fQw= Received: by 10.142.5.35 with SMTP id 35mr736227wfe.376.1308960872321; Fri, 24 Jun 2011 17:14:32 -0700 (PDT) Received: from localhost.localdomain ([67.51.163.10]) by mx.google.com with ESMTPS id z20sm247801wff.7.2011.06.24.17.14.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 17:14:31 -0700 (PDT) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, Ping Cheng , Ping Cheng Subject: [PATCH 4/4] input : wacom - Update Graphire and old Bamboo tablet buttons Date: Fri, 24 Jun 2011 17:16:02 -0700 Message-Id: <1308960962-20547-1-git-send-email-pinglinux@gmail.com> X-Mailer: git-send-email 1.7.5.4 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 (demeter2.kernel.org [140.211.167.43]); Sat, 25 Jun 2011 00:14:36 +0000 (UTC) With the removal of BTN_TOOL_FINGER for tablet buttons and expresskeys, serial number is needed to distingush if the events were from a regular tool (stylus, eraser, or mouse) or the attribures (buttons, strips, or wheels) on the tablet since there are overlapped events between the tools and the tablet attributes. Signed-off-by: Ping Cheng --- drivers/input/tablet/wacom_wac.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 7ce1294..03ebcc8 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -265,6 +265,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom) wacom->id[0] = 0; input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ input_report_key(input, wacom->tool[0], prox); + input_event(input, EV_MSC, MSC_SERIAL, 1); input_sync(input); /* sync last event */ } @@ -274,8 +275,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom) prox = data[7] & 0xf8; if (prox || wacom->id[1]) { wacom->id[1] = PAD_DEVICE_ID; - input_report_key(input, BTN_0, (data[7] & 0x40)); - input_report_key(input, BTN_4, (data[7] & 0x80)); + input_report_key(input, BTN_BACK, (data[7] & 0x40)); + input_report_key(input, BTN_FORWARD, (data[7] & 0x80)); rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); input_report_rel(input, REL_WHEEL, rw); if (!prox) @@ -290,17 +291,17 @@ static int wacom_graphire_irq(struct wacom_wac *wacom) prox = (data[7] & 0xf8) || data[8]; if (prox || wacom->id[1]) { wacom->id[1] = PAD_DEVICE_ID; - input_report_key(input, BTN_0, (data[7] & 0x08)); - input_report_key(input, BTN_1, (data[7] & 0x20)); - input_report_key(input, BTN_4, (data[7] & 0x10)); - input_report_key(input, BTN_5, (data[7] & 0x40)); + input_report_key(input, BTN_BACK, (data[7] & 0x08)); + input_report_key(input, BTN_LEFT, (data[7] & 0x20)); + input_report_key(input, BTN_FORWARD, (data[7] & 0x10)); + input_report_key(input, BTN_RIGHT, (data[7] & 0x40)); input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f)); if (!prox) wacom->id[1] = 0; input_report_abs(input, ABS_MISC, wacom->id[1]); input_event(input, EV_MSC, MSC_SERIAL, 0xf0); + retval = 1; } - retval = 1; break; } exit: @@ -1075,17 +1076,14 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, switch (wacom_wac->features.type) { case WACOM_MO: - __set_bit(BTN_1, input_dev->keybit); - __set_bit(BTN_5, input_dev->keybit); - input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); /* fall through */ case WACOM_G4: input_set_capability(input_dev, EV_MSC, MSC_SERIAL); - __set_bit(BTN_0, input_dev->keybit); - __set_bit(BTN_4, input_dev->keybit); + __set_bit(BTN_BACK, input_dev->keybit); + __set_bit(BTN_FORWARD, input_dev->keybit); /* fall through */ case GRAPHIRE: