aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJD Cole <jd@jdc.me>2014-10-31 20:34:42 -0400
committerJiri Kosina <jkosina@suse.cz>2014-11-03 08:18:49 -0500
commit1a3f83f6493f9d78aa0fe31401fd530b0fe296da (patch)
treeaa225e5c3a11750eb702ee85f261000a387c44bd /drivers
parent7f474df0a7b7dadfc01ba778460a91f554ca1481 (diff)
HID: plantronics: fix errant mouse events
This version of the driver prevents Telephony pages which are not mapped as Consumer Control applications AND are not on the Consumer Page from being registered by the hid-input driver. Signed-off-by: JD Cole <jd.cole@plantronics.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/Kconfig7
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-ids.h2
-rw-r--r--drivers/hid/hid-plantronics.c78
5 files changed, 89 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index f42df4dd58d2..bf1c74e19c75 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -613,6 +613,13 @@ config HID_PICOLCD_CIR
613 ---help--- 613 ---help---
614 Provide access to PicoLCD's CIR interface via remote control (LIRC). 614 Provide access to PicoLCD's CIR interface via remote control (LIRC).
615 615
616config HID_PLANTRONICS
617 tristate "Plantronics USB HID Driver"
618 default !EXPERT
619 depends on HID
620 ---help---
621 Provides HID support for Plantronics telephony devices.
622
616config HID_PRIMAX 623config HID_PRIMAX
617 tristate "Primax non-fully HID-compliant devices" 624 tristate "Primax non-fully HID-compliant devices"
618 depends on HID 625 depends on HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index e2850d8af9ca..5e7ac59447d8 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -94,6 +94,7 @@ ifdef CONFIG_DEBUG_FS
94hid-picolcd-y += hid-picolcd_debugfs.o 94hid-picolcd-y += hid-picolcd_debugfs.o
95endif 95endif
96 96
97obj-$(CONFIG_HID_PLANTRONICS) += hid-plantronics.o
97obj-$(CONFIG_HID_PRIMAX) += hid-primax.o 98obj-$(CONFIG_HID_PRIMAX) += hid-primax.o
98obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \ 99obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \
99 hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \ 100 hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 73bd9e2e42bc..d50313ca64a6 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1886,6 +1886,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1886 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, 1886 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
1887 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) }, 1887 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
1888 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, 1888 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
1889 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
1889 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, 1890 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
1890#if IS_ENABLED(CONFIG_HID_ROCCAT) 1891#if IS_ENABLED(CONFIG_HID_ROCCAT)
1891 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) }, 1892 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index e23ab8b30626..f9f476db671c 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -715,6 +715,8 @@
715#define USB_DEVICE_ID_ORTEK_PKB1700 0x1700 715#define USB_DEVICE_ID_ORTEK_PKB1700 0x1700
716#define USB_DEVICE_ID_ORTEK_WKB2000 0x2000 716#define USB_DEVICE_ID_ORTEK_WKB2000 0x2000
717 717
718#define USB_VENDOR_ID_PLANTRONICS 0x047f
719
718#define USB_VENDOR_ID_PANASONIC 0x04da 720#define USB_VENDOR_ID_PANASONIC 0x04da
719#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044 721#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044
720#define USB_DEVICE_ID_PANABOARD_UBT880 0x104d 722#define USB_DEVICE_ID_PANABOARD_UBT880 0x104d
diff --git a/drivers/hid/hid-plantronics.c b/drivers/hid/hid-plantronics.c
new file mode 100644
index 000000000000..215cdbd10dea
--- /dev/null
+++ b/drivers/hid/hid-plantronics.c
@@ -0,0 +1,78 @@
1/*
2 * Plantronics USB HID Driver
3 *
4 * Copyright (c) 2014 JD Cole <jd.cole@plantronics.com>
5 * Copyright (c) 2014 Terry Junge <terry.junge@plantronics.com>
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 */
14
15#include "hid-ids.h"
16
17#include <linux/hid.h>
18#include <linux/module.h>
19
20static int plantronics_input_mapping(struct hid_device *hdev,
21 struct hid_input *hi,
22 struct hid_field *field,
23 struct hid_usage *usage,
24 unsigned long **bit, int *max)
25{
26 if (field->application == HID_CP_CONSUMERCONTROL
27 && (usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER) {
28 hid_dbg(hdev, "usage: %08x (appl: %08x) - defaulted\n",
29 usage->hid, field->application);
30 return 0;
31 }
32
33 hid_dbg(hdev, "usage: %08x (appl: %08x) - ignored\n",
34 usage->hid, field->application);
35
36 return -1;
37}
38
39static int plantronics_probe(struct hid_device *hdev,
40 const struct hid_device_id *id)
41{
42 int ret;
43
44 ret = hid_parse(hdev);
45 if (ret) {
46 hid_err(hdev, "parse failed\n");
47 goto err;
48 }
49
50 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
51 if (ret) {
52 hid_err(hdev, "hw start failed\n");
53 goto err;
54 }
55
56 return 0;
57 err:
58 return ret;
59}
60
61static const struct hid_device_id plantronics_devices[] = {
62 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
63 { }
64};
65MODULE_DEVICE_TABLE(hid, plantronics_devices);
66
67static struct hid_driver plantronics_driver = {
68 .name = "plantronics",
69 .id_table = plantronics_devices,
70 .input_mapping = plantronics_input_mapping,
71 .probe = plantronics_probe,
72};
73module_hid_driver(plantronics_driver);
74
75MODULE_AUTHOR("JD Cole <jd.cole@plantronics.com>");
76MODULE_AUTHOR("Terry Junge <terry.junge@plantronics.com>");
77MODULE_DESCRIPTION("Plantronics USB HID Driver");
78MODULE_LICENSE("GPL");