From patchwork Thu Mar 1 17:22:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Kramkowski X-Patchwork-Id: 10252059 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 47B6560365 for ; Thu, 1 Mar 2018 17:23:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3785A27F60 for ; Thu, 1 Mar 2018 17:23:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BB0327F94; Thu, 1 Mar 2018 17:23:15 +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, UPPERCASE_50_75 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 D866627F60 for ; Thu, 1 Mar 2018 17:23:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033351AbeCARXM (ORCPT ); Thu, 1 Mar 2018 12:23:12 -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 S1033021AbeCARXL (ORCPT ); Thu, 1 Mar 2018 12:23:11 -0500 Received: from erebus.the-tk.com (localhost [127.0.0.1]) by erebus.the-tk.com (OpenSMTPD) with ESMTP id 93cde02a; Thu, 1 Mar 2018 17:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=the-tk.com; h=from:to:cc :subject:date:message-id; s=sel0; bh=E4HPsaVo2bn0C4zPfggdDF37NUI =; b=ENvuY1f9xHL0tsvjgxCknjp698iVhPwqvRmEPHBbdOsnPA1z3m6FicLlQcm 0PnyR11QcKxZurALOatOyZC9IgystTtHhdkQWwDd9gTJWtsolkGQ4ZHmRCNQ/d0+ HDK2df9WIEaiqZjHYSscJ4jCWzft1a7A/Z9iDVz2JG47mxD4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=the-tk.com; h=from:to:cc :subject:date:message-id; q=dns; s=sel0; b=dYI/Rwn8DbhZimkfzamHz tc0KSuGHhxo6OfFhia0q8iRSk4SDlzGxwsSvPwziRfEVQjUQkDjfV2D/j4Q8Tv1Z N9qUwApmO9I4gqiS64nmLy2rASfu5HMVTBJVULoESKemDhGHF7/SCQc5cbOqhjV1 1122bPwSPvvevu+FfZOEJU= 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 f71e0f4c (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 1 Mar 2018 17:23:08 +0000 (UTC) From: Tomasz Kramkowski To: Jiri Kosina Cc: Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Tomasz Kramkowski Subject: [PATCH 1/2] HID: elecom: refer to trackballs by model name instead of series Date: Thu, 1 Mar 2018 17:22:23 +0000 Message-Id: <20180301172224.1276-1-tk@the-tk.com> X-Mailer: git-send-email 2.16.2 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 changes all references to ELECOM trackballs using their series name to refer to them by their model name. ELECOM provides multiple series of mice such as EX-G, HUGE, and DEFT. Although it has not caused conflicts in the driver, there can be more than one iteration of mice in each series. For example, there are 7 variants of EX-G trackballs but only three (M-XT3URBK, M-XT3DRBK, and M-XT4DRBK) need a driver to work correctly. There are also 4 DEFT series trackballs but two of them have the same VID:PID as the other two. I picked the earlier model for the naming of the PID macros. Signed-off-by: Tomasz Kramkowski --- If this patch is too trivial to bother then feel free to ask and I'll amend the second patch to use a different naming scheme. I did a survey of mouse model names and VID:PID values here: https://www.reddit.com/r/Trackballs/comments/7vqraz/ --- drivers/hid/Kconfig | 6 +++--- drivers/hid/hid-elecom.c | 30 +++++++++++++++--------------- drivers/hid/hid-ids.h | 12 ++++++------ drivers/hid/hid-quirks.c | 12 ++++++------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 19c499f5623d..4989ec4028bf 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -280,9 +280,9 @@ config HID_ELECOM ---help--- Support for ELECOM devices: - BM084 Bluetooth Mouse - - EX-G Trackball (Wired and wireless) - - DEFT Trackball (Wired and wireless) - - HUGE Trackball (Wired and wireless) + - EX-G Trackballs (M-XT3DRBK, M-XT3URBK) + - DEFT Trackballs (M-DT1DRBK, M-DT1URBK, M-DT2DRBK, M-DT2URBK) + - HUGE Trackballs (M-HT1DRBK, M-HT1URBK) config HID_ELO tristate "ELO USB 4000/4500 touchscreen" diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c index 1a1ecc491c02..21e15dc91aac 100644 --- a/drivers/hid/hid-elecom.c +++ b/drivers/hid/hid-elecom.c @@ -1,9 +1,9 @@ /* * HID driver for ELECOM devices: * - BM084 Bluetooth Mouse - * - EX-G Trackball (Wired and wireless) - * - DEFT Trackball (Wired and wireless) - * - HUGE Trackball (Wired and wireless) + * - EX-G Trackballs (M-XT3DRBK, M-XT3URBK) + * - DEFT Trackballs (M-DT1DRBK, M-DT1URBK, M-DT2DRBK, M-DT2URBK) + * - HUGE Trackballs (M-HT1DRBK, M-HT1URBK) * * Copyright (c) 2010 Richard Nauber * Copyright (c) 2016 Yuxuan Shui @@ -65,14 +65,14 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, rdesc[47] = 0x00; } break; - case USB_DEVICE_ID_ELECOM_EX_G_WIRED: - case USB_DEVICE_ID_ELECOM_EX_G_WIRELESS: + case USB_DEVICE_ID_ELECOM_M_XT3URBK: + case USB_DEVICE_ID_ELECOM_M_XT3DRBK: mouse_button_fixup(hdev, rdesc, *rsize, 6); break; - case USB_DEVICE_ID_ELECOM_DEFT_WIRED: - case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS: - case USB_DEVICE_ID_ELECOM_HUGE_WIRED: - case USB_DEVICE_ID_ELECOM_HUGE_WIRELESS: + case USB_DEVICE_ID_ELECOM_M_DT1URBK: + case USB_DEVICE_ID_ELECOM_M_DT1DRBK: + case USB_DEVICE_ID_ELECOM_M_HT1URBK: + case USB_DEVICE_ID_ELECOM_M_HT1DRBK: mouse_button_fixup(hdev, rdesc, *rsize, 8); break; } @@ -81,12 +81,12 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, 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_EX_G_WIRED) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_EX_G_WIRELESS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) }, + { 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_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) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) }, { } }; MODULE_DEVICE_TABLE(hid, elecom_devices); diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 43ddcdfbd0da..830c022c3624 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -371,12 +371,12 @@ #define USB_VENDOR_ID_ELECOM 0x056e #define USB_DEVICE_ID_ELECOM_BM084 0x0061 -#define USB_DEVICE_ID_ELECOM_EX_G_WIRED 0x00fb -#define USB_DEVICE_ID_ELECOM_EX_G_WIRELESS 0x00fc -#define USB_DEVICE_ID_ELECOM_DEFT_WIRED 0x00fe -#define USB_DEVICE_ID_ELECOM_DEFT_WIRELESS 0x00ff -#define USB_DEVICE_ID_ELECOM_HUGE_WIRED 0x010c -#define USB_DEVICE_ID_ELECOM_HUGE_WIRELESS 0x010d +#define USB_DEVICE_ID_ELECOM_M_XT3URBK 0x00fb +#define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc +#define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe +#define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff +#define USB_DEVICE_ID_ELECOM_M_HT1URBK 0x010c +#define USB_DEVICE_ID_ELECOM_M_HT1DRBK 0x010d #define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34 #define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004 diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index 5f6035a5ce36..9675cd500776 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -335,12 +335,12 @@ static const struct hid_device_id hid_have_special_driver[] = { #endif #if IS_ENABLED(CONFIG_HID_ELECOM) { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_EX_G_WIRED) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_EX_G_WIRELESS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) }, - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) }, + { 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_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) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) }, #endif #if IS_ENABLED(CONFIG_HID_ELO) { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },