From patchwork Thu Oct 6 21:22:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9365355 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 2B96F6077E for ; Thu, 6 Oct 2016 21:23:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 156A929253 for ; Thu, 6 Oct 2016 21:23:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A05C29256; Thu, 6 Oct 2016 21:23:10 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 9965B29253 for ; Thu, 6 Oct 2016 21:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935258AbcJFVXJ (ORCPT ); Thu, 6 Oct 2016 17:23:09 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36519 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935088AbcJFVXI (ORCPT ); Thu, 6 Oct 2016 17:23:08 -0400 Received: by mail-qk0-f195.google.com with SMTP id z190so1660936qkc.3 for ; Thu, 06 Oct 2016 14:23:08 -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=ZLToIc1tLYJc1Fr909X5/5wEGjLEeY7wNV3BkkYNXsA=; b=qaXhnAWRFi/2GA14TMRDS8OenPbwfZ2ntd4jPU+UA1xValKVLwuJchg/zNke3Q+h9y 9j7ju/PdjW+GVatskI+3pFXULgYXdTdQWY1IspVIqYWmeCLFdiTMk6ur6i6IFXI2K1Iq ALOjk0g+J3yyOPp0xsbfnxM5FfDee8w6sVUArDLM2et2gHC+FAbYx0Y1yJJp6rl5LDL8 PhXSrkAPRQq41eJxNxYtjyFJ+65WidhBcLJojSDw/Y5WZ44x9CmSYVWyEZY57qq82ZhP qSJNZE5eYeB2kQ8RuNKYuXv8aL3ltTs/UsQbb8FlWQ9k7AvuPKVcsxurAAbr22q099NK 7FQw== 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=ZLToIc1tLYJc1Fr909X5/5wEGjLEeY7wNV3BkkYNXsA=; b=jEnsgbJ4GaKw+5zvy5uuq7FrlblAJuQBZbo3A874ihM7UVHtvbir8lrPFV0v05Inq5 dbE/O+6tg9h33KX/SWDWEA9QXXXr0DNiTvxK4tDQBmt12JbydRW0rCP7rw30m7WOSW5v UxcgXjxCTEmdoS2YbtSLGVNuyCH8xDa1OU0Mm/NjZfj9LNEZpbFiWqamIzUMSz/xRHzC 9/veFD4AqTsQeGSFw3PJaluStpeWSzpiofF50oQnIaGOfeZrKonnGa7DAus8109UnZct ZrEyE93I8EPqVPFp/FQ6zdzMSC9TsR+JWWIxCei2F4+k6GtXH0JV+uULOrzaXFKXPPn5 O20g== X-Gm-Message-State: AA6/9RkmpKEF86FaqD5ULSN9HBfNHOzVqeIvARMlWZFzHu85e/8OvGLo9wSGdiKDAUPO6g== X-Received: by 10.55.5.15 with SMTP id 15mr5645134qkf.49.1475788987531; Thu, 06 Oct 2016 14:23:07 -0700 (PDT) Received: from wacom-arch2.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id m4sm5773714qkf.29.2016.10.06.14.23.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Oct 2016 14:23:07 -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 18/19] HID: wacom: generic: Extend pad support Date: Thu, 6 Oct 2016 14:22:30 -0700 Message-Id: <20161006212231.31440-19-killertofu@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161006212231.31440-1-killertofu@gmail.com> References: <20161006212231.31440-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 --- 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 f75ffae..4f449a0 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; @@ -1513,6 +1515,9 @@ static void wacom_map_usage(struct input_dev *input, struct hid_device *hdev, case EV_MSC: input_set_capability(input, EV_MSC, code); break; + case EV_SW: + input_set_capability(input, EV_SW, code); + break; } } @@ -1547,11 +1552,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, hdev, 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, hdev, usage, field, EV_SW, SW_MUTE_DEVICE, 0); + break; + case WACOM_HID_WD_TOUCHSTRIP: + wacom_map_usage(input, hdev, usage, field, EV_ABS, ABS_RX, 0); + break; + case WACOM_HID_WD_TOUCHSTRIP2: + wacom_map_usage(input, hdev, usage, field, EV_ABS, ABS_RY, 0); + break; case WACOM_HID_WD_TOUCHRING: wacom_map_usage(input, hdev, usage, field, EV_ABS, ABS_WHEEL, 0); break; diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index fa5b772..f70f7fd 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)