From: Nikolai Kondrashov <spbnick@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org,
DIGImend-devel <DIGImend-devel@lists.sourceforge.net>,
Nikolai Kondrashov <spbnick@gmail.com>
Subject: [PATCH 1/4] hid: huion: Use "tablet" instead of specific model
Date: Wed, 23 Jul 2014 19:31:54 +0300 [thread overview]
Message-ID: <1406133117-29243-2-git-send-email-spbnick@gmail.com> (raw)
In-Reply-To: <1406133117-29243-1-git-send-email-spbnick@gmail.com>
Use word "tablet" in identifiers and comments instead of referring to specific
Huion tablet model name, as the product ID is used by at least several tablet
models.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
---
drivers/hid/hid-core.c | 2 +-
drivers/hid/hid-huion.c | 25 +++++++++++++------------
drivers/hid/hid-ids.h | 2 +-
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8ed66fd..84ed7d4 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1782,7 +1782,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070) },
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
- { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
{ HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
diff --git a/drivers/hid/hid-huion.c b/drivers/hid/hid-huion.c
index cbf4da4..25d01cd 100644
--- a/drivers/hid/hid-huion.c
+++ b/drivers/hid/hid-huion.c
@@ -2,6 +2,7 @@
* HID driver for Huion devices not fully compliant with HID standard
*
* Copyright (c) 2013 Martin Rusko
+ * Copyright (c) 2014 Nikolai Kondrashov
*/
/*
@@ -19,11 +20,11 @@
#include "hid-ids.h"
-/* Original Huion 580 report descriptor size */
-#define HUION_580_RDESC_ORIG_SIZE 177
+/* Original tablet report descriptor size */
+#define HUION_TABLET_RDESC_ORIG_SIZE 177
-/* Fixed Huion 580 report descriptor */
-static __u8 huion_580_rdesc_fixed[] = {
+/* Fixed tablet report descriptor */
+static __u8 huion_tablet_rdesc_fixed[] = {
0x05, 0x0D, /* Usage Page (Digitizer), */
0x09, 0x02, /* Usage (Pen), */
0xA1, 0x01, /* Collection (Application), */
@@ -72,10 +73,10 @@ static __u8 *huion_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
switch (hdev->product) {
- case USB_DEVICE_ID_HUION_580:
- if (*rsize == HUION_580_RDESC_ORIG_SIZE) {
- rdesc = huion_580_rdesc_fixed;
- *rsize = sizeof(huion_580_rdesc_fixed);
+ case USB_DEVICE_ID_HUION_TABLET:
+ if (*rsize == HUION_TABLET_RDESC_ORIG_SIZE) {
+ rdesc = huion_tablet_rdesc_fixed;
+ *rsize = sizeof(huion_tablet_rdesc_fixed);
}
break;
}
@@ -108,11 +109,11 @@ static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id)
int ret;
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
- /* Ignore interfaces 1 (mouse) and 2 (keyboard) for Huion 580 tablet,
+ /* Ignore interfaces 1 (mouse) and 2 (keyboard) for tablet,
* as they are not used
*/
switch (id->product) {
- case USB_DEVICE_ID_HUION_580:
+ case USB_DEVICE_ID_HUION_TABLET:
if (intf->cur_altsetting->desc.bInterfaceNumber != 0x00)
return -ENODEV;
break;
@@ -131,7 +132,7 @@ static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id)
}
switch (id->product) {
- case USB_DEVICE_ID_HUION_580:
+ case USB_DEVICE_ID_HUION_TABLET:
ret = huion_tablet_enable(hdev);
if (ret) {
hid_err(hdev, "tablet enabling failed\n");
@@ -158,7 +159,7 @@ static int huion_raw_event(struct hid_device *hdev, struct hid_report *report,
}
static const struct hid_device_id huion_devices[] = {
- { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
{ }
};
MODULE_DEVICE_TABLE(hid, huion_devices);
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 48b66bb..fe2f163 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -448,7 +448,7 @@
#define USB_DEVICE_ID_UGCI_FIGHTING 0x0030
#define USB_VENDOR_ID_HUION 0x256c
-#define USB_DEVICE_ID_HUION_580 0x006e
+#define USB_DEVICE_ID_HUION_TABLET 0x006e
#define USB_VENDOR_ID_IDEACOM 0x1cb6
#define USB_DEVICE_ID_IDEACOM_IDC6650 0x6650
--
2.0.1
next prev parent reply other threads:[~2014-07-23 16:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 12:42 [PATCHES] hid: Add support for more Huion tablets Nikolai Kondrashov
2014-07-23 12:42 ` [PATCH 1/5] hid: huion: Use "tablet" instead of specific model Nikolai Kondrashov
2014-07-23 14:30 ` Benjamin Tissoires
2014-07-23 12:42 ` [PATCH 2/5] hid: huion: Invert in-range on specific product Nikolai Kondrashov
2014-07-23 14:34 ` Benjamin Tissoires
2014-07-23 14:40 ` Nikolai Kondrashov
2014-07-23 16:31 ` [PATCHES v2] Add support for more Huion tablets Nikolai Kondrashov
2014-07-23 16:31 ` Nikolai Kondrashov [this message]
2014-07-23 16:31 ` [PATCH 2/4] hid: huion: Don't ignore other interfaces Nikolai Kondrashov
2014-07-23 16:31 ` [PATCH 3/4] hid: huion: Switch to generating report descriptor Nikolai Kondrashov
2014-07-23 16:31 ` [PATCH 4/4] hid: huion: Handle tablets with UC-Logic vendor ID Nikolai Kondrashov
2014-07-28 15:33 ` [PATCHES v2] Add support for more Huion tablets Benjamin Tissoires
2014-07-29 9:22 ` Jiri Kosina
2014-07-29 12:50 ` [PATCH] hid: huion: Fix sparse warnings Nikolai Kondrashov
2014-07-29 13:06 ` Jiri Kosina
2014-07-29 13:24 ` Nikolai Kondrashov
2014-07-23 12:42 ` [PATCH 3/5] hid: huion: Don't ignore other interfaces Nikolai Kondrashov
2014-07-23 14:43 ` Benjamin Tissoires
2014-07-23 12:42 ` [PATCH 4/5] hid: huion: Switch to generating report descriptor Nikolai Kondrashov
2014-07-23 14:42 ` Benjamin Tissoires
2014-07-23 14:59 ` Nikolai Kondrashov
2014-07-23 12:42 ` [PATCH 5/5] hid: huion: Handle tablets with UC-Logic vendor ID Nikolai Kondrashov
2014-07-23 14:43 ` Benjamin Tissoires
2014-07-23 13:39 ` [PATCHES] hid: Add support for more Huion tablets Nikolai Kondrashov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406133117-29243-2-git-send-email-spbnick@gmail.com \
--to=spbnick@gmail.com \
--cc=DIGImend-devel@lists.sourceforge.net \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).