From patchwork Thu Mar 1 17:22:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Kramkowski X-Patchwork-Id: 10252061 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 403BE60365 for ; Thu, 1 Mar 2018 17:23:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30F7A27F60 for ; Thu, 1 Mar 2018 17:23:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2593127F98; Thu, 1 Mar 2018 17:23:24 +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_SIGNED, 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 E3F0027F60 for ; Thu, 1 Mar 2018 17:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033418AbeCARXU (ORCPT ); Thu, 1 Mar 2018 12:23:20 -0500 Received: from erebus.the-tk.com ([109.74.205.187]:57580 "EHLO erebus.the-tk.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033238AbeCARXR (ORCPT ); Thu, 1 Mar 2018 12:23:17 -0500 Received: from erebus.the-tk.com (localhost [127.0.0.1]) by erebus.the-tk.com (OpenSMTPD) with ESMTP id a88f140e; Thu, 1 Mar 2018 17:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=the-tk.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=sel0; bh=C5Qq ruO2/hvfLAJ3xiDm34ZuYJo=; b=wbP06RCbBQbk7tvQLlL8ZWQKgeoCy0xi5Kk4 S/DSmZPhIqYYGhmwsVAtICjfmiaeI015KcAXeWM+jt+3DR5TYi/Ktex9j2t9OElY z1rhEZqi+2GQIWnwAzdgsyc+jPT41cgPOFgFPC5YAHtoY3qf0Qz4xdX8F0veUsmd FCKO7Tg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=the-tk.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; q=dns; s=sel0; b= gF4o74o1JFRCPMNEN6ny0j8TKSg7nUo4Trsg2g1fHWPv2y6yWhUQVg9ZBZyeeSWS K/pJZbXoA9jgLGGkGB9qsMaQcMU1zbOaJQrK/FwGAMLKMQN0ey5tkBRwCbDS5oAl RS5w+py8CHjWT4L/YSCi9slgN2jLCApKm3C2SQoujAM= Received: from localhost (cpc1-nott20-2-0-cust508.12-2.cable.virginm.net [82.4.129.253]) by erebus.the-tk.com (OpenSMTPD) with ESMTPSA id 2f1187b1 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 1 Mar 2018 17:23:15 +0000 (UTC) From: Tomasz Kramkowski To: Jiri Kosina Cc: Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Tomasz Kramkowski , Mark Morgan Lloyd Subject: [PATCH 2/2] HID: elecom: add support for EX-G M-XT4DRBK trackball Date: Thu, 1 Mar 2018 17:22:24 +0000 Message-Id: <20180301172224.1276-2-tk@the-tk.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180301172224.1276-1-tk@the-tk.com> References: <20180301172224.1276-1-tk@the-tk.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 This patch enables the 6th button on the ELECOM EX-G M-XT4DRBK trackball mouse. This is a left handed EX-G variant which only comes in a wireless (D) model. It has a total of 6 buttons but one of these is not available because of how the HID descriptor is configured. Signed-off-by: Tomasz Kramkowski --- This patch depends on patch 1 in this series. This was requested on the list [1] and on reddit [2]. There's no "Requested-by:" field but the requesters might qualify for a "Suggested-by:". I've notified both in case they qualify and would like their names to be included. I do not have the hardware to test this patch but I have been informed that an equivalent change was tested and worked. I have asked both requesters for their help testing the patch which means that they might be able to vouch for its functionality. However, it's unlikely for there to be a problem. [1]: https://marc.info/?l=linux-input&m=151915950727292 [2]: https://www.reddit.com/r/Trackballs/comments/7ut6ht/ --- drivers/hid/hid-elecom.c | 4 +++- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-quirks.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c index 21e15dc91aac..ae8e9413c79d 100644 --- a/drivers/hid/hid-elecom.c +++ b/drivers/hid/hid-elecom.c @@ -1,7 +1,7 @@ /* * HID driver for ELECOM devices: * - BM084 Bluetooth Mouse - * - EX-G Trackballs (M-XT3DRBK, M-XT3URBK) + * - EX-G Trackballs (M-XT3DRBK, M-XT3URBK, M-XT4DRBK) * - DEFT Trackballs (M-DT1DRBK, M-DT1URBK, M-DT2DRBK, M-DT2URBK) * - HUGE Trackballs (M-HT1DRBK, M-HT1URBK) * @@ -67,6 +67,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, break; case USB_DEVICE_ID_ELECOM_M_XT3URBK: case USB_DEVICE_ID_ELECOM_M_XT3DRBK: + case USB_DEVICE_ID_ELECOM_M_XT4DRBK: mouse_button_fixup(hdev, rdesc, *rsize, 6); break; case USB_DEVICE_ID_ELECOM_M_DT1URBK: @@ -83,6 +84,7 @@ static const struct hid_device_id elecom_devices[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 830c022c3624..c8902f2f0e23 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -373,6 +373,7 @@ #define USB_DEVICE_ID_ELECOM_BM084 0x0061 #define USB_DEVICE_ID_ELECOM_M_XT3URBK 0x00fb #define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc +#define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe #define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff #define USB_DEVICE_ID_ELECOM_M_HT1URBK 0x010c diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index 9675cd500776..91049dff301f 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -337,6 +337,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) },