From patchwork Thu Oct 20 01:03:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9385715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62B27607D0 for ; Thu, 20 Oct 2016 01:05:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5085E28A07 for ; Thu, 20 Oct 2016 01:05:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 445EE296E3; Thu, 20 Oct 2016 01:05:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD01F28A07 for ; Thu, 20 Oct 2016 01:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756086AbcJTBFT (ORCPT ); Wed, 19 Oct 2016 21:05:19 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36772 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755704AbcJTBFS (ORCPT ); Wed, 19 Oct 2016 21:05:18 -0400 Received: by mail-pf0-f194.google.com with SMTP id r16so3827106pfg.3 for ; Wed, 19 Oct 2016 18:05:18 -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:in-reply-to:references; bh=p1iIcpBESvn+hdD+q/xymd9UlsfEG8cBgbh5dYL9hak=; b=jGldixTBJCPcrvgUnZnmDsokKfOoXI7DY7qLeRdLQ7uPYm08Q1zHhisNET6OcdXhTa rqzlKvNxzZ+DJ1iDjKAHp+pWHodtxMwA410o364idbdWPz02/gXdBofiYU91SjgPgAyo UY+bSdPQXcvAh4RiBtAwD7olnBI6j41bcipPn/LHQecesc/QcQdg5DB2IPTxpbIIqDO9 P19hRR3ASnaGC03Z2q65MuNsX+d1jRq1jxtEALltXxs08CP//bSReSXIxQJINrIShbrP n6pl1IaoQCyPwIDIwhgByW8kdKykVTzXtSjGC2Irbagc7DxCK70AhKYgRavHV7cQUZiS Md8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p1iIcpBESvn+hdD+q/xymd9UlsfEG8cBgbh5dYL9hak=; b=N8PSHLF+ShDigPfaKW8uLmub/2lovmli498nZphSa+ypcj8FxgDrqiznzJxCr1hLLX 124Jo1GObSuNMIjYw098P4/sb2S4wYl1DyD2ZnaIzfra/f94rplKVUm/v8KrByifnJiB IrVpGjbCuy0c0K/Rp5uqeSNwdDhGgBHgR1a+RGPcOA38LS/PWWJ1u6CXUS9SyEXjeUW8 /TfyZ1V3oRRT3Ji+XVjZs5t1Ri9I61IiGKezEy1k8MN1dr3kl6UJDEbLTuXAitGTFKmi RDXe3D5V1jndvvU2wKiJ852eh8zj6tjzROKoYXCWi7RzEEnD9EAm22oeMkdt82oOvcex 4C8Q== X-Gm-Message-State: AA6/9Rm+9YbIcFNa9dL9fLn7Hjm7pzcXgA6+eZ998vpcwc2tap+kH4kbGty8SxQUHr7+KA== X-Received: by 10.99.141.76 with SMTP id z73mr13571662pgd.100.1476925517890; Wed, 19 Oct 2016 18:05:17 -0700 (PDT) Received: from wtc005007.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id d15sm877372pfl.90.2016.10.19.18.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 18:05:17 -0700 (PDT) From: Jason Gerecke To: linux-input@vger.kernel.org, Jiri Kosina Cc: Benjamin Tissoires , Ping Cheng , Ping Cheng , Aaron Skomra , Jason Gerecke , Jason Gerecke Subject: [PATCH v3 17/18] HID: wacom: generic: Extend pad support Date: Wed, 19 Oct 2016 18:03:53 -0700 Message-Id: <20161020010354.4049-17-killertofu@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161020010354.4049-1-killertofu@gmail.com> References: <20161006212231.31440-1-killertofu@gmail.com> <20161020010354.4049-1-killertofu@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The HID specification that the MobileStudio Pro follows includes usages for several values that would be good to support so that future devices "just work" out of the box. Extend the HID_GENERIC pad codepath to handle these usages. Signed-off-by: Jason Gerecke Reviewed-by: Benjamin Tissoires --- drivers/hid/wacom_wac.c | 15 +++++++++++++++ drivers/hid/wacom_wac.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index f3edecf..0723ba8 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1457,6 +1457,8 @@ static int wacom_equivalent_usage(int usage) usage == WACOM_HID_WD_SERIALHI || usage == WACOM_HID_WD_TOOLTYPE || usage == WACOM_HID_WD_DISTANCE || + usage == WACOM_HID_WD_TOUCHSTRIP || + usage == WACOM_HID_WD_TOUCHSTRIP2 || usage == WACOM_HID_WD_TOUCHRING || usage == WACOM_HID_WD_TOUCHRINGSTATUS) { return usage; @@ -1512,6 +1514,9 @@ static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage, case EV_MSC: input_set_capability(input, EV_MSC, code); break; + case EV_SW: + input_set_capability(input, EV_SW, code); + break; } } @@ -1546,11 +1551,21 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, case WACOM_HID_WD_BUTTONDOWN: case WACOM_HID_WD_BUTTONLEFT: case WACOM_HID_WD_BUTTONRIGHT: + case WACOM_HID_WD_BUTTONCENTER: wacom_map_usage(input, usage, field, EV_KEY, wacom_numbered_button_to_key(features->numbered_buttons), 0); features->numbered_buttons++; break; + case WACOM_HID_WD_TOUCHONOFF: + wacom_map_usage(input, usage, field, EV_SW, SW_MUTE_DEVICE, 0); + break; + case WACOM_HID_WD_TOUCHSTRIP: + wacom_map_usage(input, usage, field, EV_ABS, ABS_RX, 0); + break; + case WACOM_HID_WD_TOUCHSTRIP2: + wacom_map_usage(input, usage, field, EV_ABS, ABS_RY, 0); + break; case WACOM_HID_WD_TOUCHRING: wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0); break; diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 7418c97..a54a301 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -96,6 +96,8 @@ #define WACOM_HID_WD_SERIALHI (WACOM_HID_UP_WACOMDIGITIZER | 0x5c) #define WACOM_HID_WD_TOOLTYPE (WACOM_HID_UP_WACOMDIGITIZER | 0x77) #define WACOM_HID_WD_DISTANCE (WACOM_HID_UP_WACOMDIGITIZER | 0x0132) +#define WACOM_HID_WD_TOUCHSTRIP (WACOM_HID_UP_WACOMDIGITIZER | 0x0136) +#define WACOM_HID_WD_TOUCHSTRIP2 (WACOM_HID_UP_WACOMDIGITIZER | 0x0137) #define WACOM_HID_WD_TOUCHRING (WACOM_HID_UP_WACOMDIGITIZER | 0x0138) #define WACOM_HID_WD_TOUCHRINGSTATUS (WACOM_HID_UP_WACOMDIGITIZER | 0x0139) #define WACOM_HID_WD_ACCELEROMETER_X (WACOM_HID_UP_WACOMDIGITIZER | 0x0401) @@ -104,11 +106,14 @@ #define WACOM_HID_WD_BATTERY_CHARGING (WACOM_HID_UP_WACOMDIGITIZER | 0x0404) #define WACOM_HID_WD_BATTERY_LEVEL (WACOM_HID_UP_WACOMDIGITIZER | 0x043b) #define WACOM_HID_WD_EXPRESSKEY00 (WACOM_HID_UP_WACOMDIGITIZER | 0x0910) +#define WACOM_HID_WD_EXPRESSKEYCAP00 (WACOM_HID_UP_WACOMDIGITIZER | 0x0950) #define WACOM_HID_WD_BUTTONHOME (WACOM_HID_UP_WACOMDIGITIZER | 0x0990) #define WACOM_HID_WD_BUTTONUP (WACOM_HID_UP_WACOMDIGITIZER | 0x0991) #define WACOM_HID_WD_BUTTONDOWN (WACOM_HID_UP_WACOMDIGITIZER | 0x0992) #define WACOM_HID_WD_BUTTONLEFT (WACOM_HID_UP_WACOMDIGITIZER | 0x0993) #define WACOM_HID_WD_BUTTONRIGHT (WACOM_HID_UP_WACOMDIGITIZER | 0x0994) +#define WACOM_HID_WD_BUTTONCENTER (WACOM_HID_UP_WACOMDIGITIZER | 0x0995) +#define WACOM_HID_WD_TOUCHONOFF (WACOM_HID_UP_WACOMDIGITIZER | 0x0996) #define WACOM_HID_WD_FINGERWHEEL (WACOM_HID_UP_WACOMDIGITIZER | 0x0d03) #define WACOM_HID_WD_OFFSETLEFT (WACOM_HID_UP_WACOMDIGITIZER | 0x0d30) #define WACOM_HID_WD_OFFSETTOP (WACOM_HID_UP_WACOMDIGITIZER | 0x0d31)