Skip to content

Commit 5cf6571

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (30 commits) Revert "HID: add support for the Wacom Intuos 4 wireless" HID: fix up Kconfig entry for ACRUX driver HID: add ACRUX game controller force feedback support HID: Force input registration for "VEC footpedal" HID: add HID_QUIRK_HIDINPUT_FORCE HID: hid-input.c: indentation fixes HID: hiddev: use usb_find_interface, get rid of BKL HID: ignore digitizer usage Undefined (0x00) HID: Add support for Conceptronic CLLRCMCE HID: hid-ids.h: Whitespace fixup, align using TABs HID: picolcd: implement refcounting of framebuffer HID: picolcd: do not reallocate memory on depth change HID: picolcd: Add minimal palette required by fbcon on 8bpp HID: magicmouse: Correct parsing of large X and Y motions. HID: magicmouse: report last touch up HID: picolcd: fix deferred_io init/cleanup to fb ordering HID: hid-ids.h: keep vendor ids in alphabetical order HID: add proper support for Elecom BM084 bluetooth mouse HID: magicmouse: enable horizontal scrolling HID: magicmouse: add param for scroll speed ...
2 parents b7c8e55 + 9f17d51 commit 5cf6571

20 files changed

Lines changed: 586 additions & 196 deletions

‎Documentation/ABI/testing/sysfs-driver-hid-roccat-kone‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,6 @@ Description: When read, this file returns the raw integer version number of the
3333
left. E.g. a returned value of 138 means 1.38
3434
This file is readonly.
3535

36-
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/kone_driver_version
37-
Date: March 2010
38-
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
39-
Description: When read, this file returns the driver version.
40-
The format of the string is "v<major>.<minor>.<patchlevel>".
41-
This attribute is used by the userland tools to find the sysfs-
42-
paths of installed kone-mice and determine the capabilites of
43-
the driver. Versions of this driver for old kernels replace
44-
usbhid instead of generic-usb. The way to scan for this file
45-
has been chosen to provide a consistent way for all supported
46-
kernel versions.
47-
This file is readonly.
48-
4936
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile[1-5]
5037
Date: March 2010
5138
Contact: Stefan Achatz <erazor_de@users.sourceforge.net>

‎drivers/hid/Kconfig‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ config HID_A4TECH
6868
---help---
6969
Support for A4 tech X5 and WOP-35 / Trust 450L mice.
7070

71+
config HID_ACRUX_FF
72+
tristate "ACRUX force feedback support"
73+
depends on USB_HID
74+
select INPUT_FF_MEMLESS
75+
---help---
76+
Say Y here if you want to enable force feedback support for ACRUX
77+
game controllers.
78+
7179
config HID_APPLE
7280
tristate "Apple" if EMBEDDED
7381
depends on (USB_HID || BT_HIDP)
@@ -148,6 +156,12 @@ config HID_EGALAX
148156
---help---
149157
Support for the eGalax dual-touch panel.
150158

159+
config HID_ELECOM
160+
tristate "ELECOM"
161+
depends on BT_HIDP
162+
---help---
163+
Support for the ELECOM BM084 (bluetooth mouse).
164+
151165
config HID_EZKEY
152166
tristate "Ezkey" if EMBEDDED
153167
depends on USB_HID
@@ -417,10 +431,11 @@ config SMARTJOYPLUS_FF
417431
enable force feedback support for it.
418432

419433
config HID_TOPSEED
420-
tristate "TopSeed Cyberlink remote control support"
434+
tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support"
421435
depends on USB_HID
422436
---help---
423-
Say Y if you have a TopSeed Cyberlink or BTC Emprex remote control.
437+
Say Y if you have a TopSeed Cyberlink or BTC Emprex or Conceptronic
438+
CLLRCMCE remote control.
424439

425440
config HID_THRUSTMASTER
426441
tristate "ThrustMaster devices support"

‎drivers/hid/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ endif
2424

2525
obj-$(CONFIG_HID_3M_PCT) += hid-3m-pct.o
2626
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
27+
obj-$(CONFIG_HID_ACRUX_FF) += hid-axff.o
2728
obj-$(CONFIG_HID_APPLE) += hid-apple.o
2829
obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
2930
obj-$(CONFIG_HID_CANDO) += hid-cando.o
@@ -32,6 +33,7 @@ obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
3233
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
3334
obj-$(CONFIG_HID_DRAGONRISE) += hid-drff.o
3435
obj-$(CONFIG_HID_EGALAX) += hid-egalax.o
36+
obj-$(CONFIG_HID_ELECOM) += hid-elecom.o
3537
obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
3638
obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
3739
obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o

‎drivers/hid/hid-axff.c‎

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
/*
2+
* Force feedback support for ACRUX game controllers
3+
*
4+
* From what I have gathered, these devices are mass produced in China
5+
* by several vendors. They often share the same design as the original
6+
* Xbox 360 controller.
7+
*
8+
* 1a34:0802 "ACRUX USB GAMEPAD 8116"
9+
* - tested with a EXEQ EQ-PCU-02090 game controller.
10+
*
11+
* Copyright (c) 2010 Sergei Kolzun <x0r@dv-life.ru>
12+
*/
13+
14+
/*
15+
* This program is free software; you can redistribute it and/or modify
16+
* it under the terms of the GNU General Public License as published by
17+
* the Free Software Foundation; either version 2 of the License, or
18+
* (at your option) any later version.
19+
*
20+
* This program is distributed in the hope that it will be useful,
21+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
* GNU General Public License for more details.
24+
*
25+
* You should have received a copy of the GNU General Public License
26+
* along with this program; if not, write to the Free Software
27+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28+
*/
29+
30+
#include <linux/input.h>
31+
#include <linux/slab.h>
32+
#include <linux/usb.h>
33+
#include <linux/hid.h>
34+
35+
#include "hid-ids.h"
36+
#include "usbhid/usbhid.h"
37+
38+
struct axff_device {
39+
struct hid_report *report;
40+
};
41+
42+
static int axff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
43+
{
44+
struct hid_device *hid = input_get_drvdata(dev);
45+
struct axff_device *axff = data;
46+
int left, right;
47+
48+
left = effect->u.rumble.strong_magnitude;
49+
right = effect->u.rumble.weak_magnitude;
50+
51+
dbg_hid("called with 0x%04x 0x%04x", left, right);
52+
53+
left = left * 0xff / 0xffff;
54+
right = right * 0xff / 0xffff;
55+
56+
axff->report->field[0]->value[0] = left;
57+
axff->report->field[1]->value[0] = right;
58+
axff->report->field[2]->value[0] = left;
59+
axff->report->field[3]->value[0] = right;
60+
dbg_hid("running with 0x%02x 0x%02x", left, right);
61+
usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
62+
63+
return 0;
64+
}
65+
66+
static int axff_init(struct hid_device *hid)
67+
{
68+
struct axff_device *axff;
69+
struct hid_report *report;
70+
struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
71+
struct list_head *report_list =&hid->report_enum[HID_OUTPUT_REPORT].report_list;
72+
struct input_dev *dev = hidinput->input;
73+
int error;
74+
75+
if (list_empty(report_list)) {
76+
dev_err(&hid->dev, "no output reports found\n");
77+
return -ENODEV;
78+
}
79+
80+
report = list_first_entry(report_list, struct hid_report, list);
81+
82+
if (report->maxfield < 4) {
83+
dev_err(&hid->dev, "no fields in the report: %d\n", report->maxfield);
84+
return -ENODEV;
85+
}
86+
87+
axff = kzalloc(sizeof(struct axff_device), GFP_KERNEL);
88+
if (!axff)
89+
return -ENOMEM;
90+
91+
set_bit(FF_RUMBLE, dev->ffbit);
92+
93+
error = input_ff_create_memless(dev, axff, axff_play);
94+
if (error)
95+
goto err_free_mem;
96+
97+
axff->report = report;
98+
axff->report->field[0]->value[0] = 0x00;
99+
axff->report->field[1]->value[0] = 0x00;
100+
axff->report->field[2]->value[0] = 0x00;
101+
axff->report->field[3]->value[0] = 0x00;
102+
usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
103+
104+
dev_info(&hid->dev, "Force Feedback for ACRUX game controllers by Sergei Kolzun<x0r@dv-life.ru>\n");
105+
106+
return 0;
107+
108+
err_free_mem:
109+
kfree(axff);
110+
return error;
111+
}
112+
113+
static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
114+
{
115+
int error;
116+
117+
dev_dbg(&hdev->dev, "ACRUX HID hardware probe...");
118+
119+
error = hid_parse(hdev);
120+
if (error) {
121+
dev_err(&hdev->dev, "parse failed\n");
122+
return error;
123+
}
124+
125+
error = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
126+
if (error) {
127+
dev_err(&hdev->dev, "hw start failed\n");
128+
return error;
129+
}
130+
131+
error = axff_init(hdev);
132+
if (error) {
133+
/*
134+
* Do not fail device initialization completely as device
135+
* may still be partially operable, just warn.
136+
*/
137+
dev_warn(&hdev->dev,
138+
"Failed to enable force feedback support, error: %d\n",
139+
error);
140+
}
141+
142+
return 0;
143+
}
144+
145+
static const struct hid_device_id ax_devices[] = {
146+
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802), },
147+
{ }
148+
};
149+
MODULE_DEVICE_TABLE(hid, ax_devices);
150+
151+
static struct hid_driver ax_driver = {
152+
.name = "acrux",
153+
.id_table = ax_devices,
154+
.probe = ax_probe,
155+
};
156+
157+
static int __init ax_init(void)
158+
{
159+
return hid_register_driver(&ax_driver);
160+
}
161+
162+
static void __exit ax_exit(void)
163+
{
164+
hid_unregister_driver(&ax_driver);
165+
}
166+
167+
module_init(ax_init);
168+
module_exit(ax_exit);
169+
170+
MODULE_AUTHOR("Sergei Kolzun");
171+
MODULE_DESCRIPTION("Force feedback support for ACRUX game controllers");
172+
MODULE_LICENSE("GPL");

‎drivers/hid/hid-core.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,8 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
11571157

11581158
if (hdev->quirks & HID_QUIRK_HIDDEV_FORCE)
11591159
connect_mask |= (HID_CONNECT_HIDDEV_FORCE | HID_CONNECT_HIDDEV);
1160+
if (hdev->quirks & HID_QUIRK_HIDINPUT_FORCE)
1161+
connect_mask |= HID_CONNECT_HIDINPUT_FORCE;
11601162
if (hdev->bus != BUS_USB)
11611163
connect_mask &= ~HID_CONNECT_HIDDEV;
11621164
if (hid_hiddev(hdev))
@@ -1239,6 +1241,9 @@ static const struct hid_device_id hid_blacklist[] = {
12391241
{ HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M2256) },
12401242
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
12411243
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
1244+
#if defined(CONFIG_HID_ACRUX_FF) || defined(CONFIG_HID_ACRUX_FF_MODULE)
1245+
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },
1246+
#endif
12421247
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
12431248
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
12441249
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
@@ -1294,6 +1299,7 @@ static const struct hid_device_id hid_blacklist[] = {
12941299
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
12951300
{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
12961301
{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
1302+
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
12971303
{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
12981304
{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
12991305
{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
@@ -1375,10 +1381,10 @@ static const struct hid_device_id hid_blacklist[] = {
13751381
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },
13761382
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
13771383
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
1384+
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
13781385
{ HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
13791386
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
13801387
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) },
1381-
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) },
13821388
{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
13831389
{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
13841390
{ HID_USB_DEVICE(USB_VENDOR_ID_ZYDACRON, USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL) },

‎drivers/hid/hid-elecom.c‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* HID driver for Elecom BM084 (bluetooth mouse).
3+
* Removes a non-existing horizontal wheel from
4+
* the HID descriptor.
5+
* (This module is based on "hid-ortek".)
6+
*
7+
* Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
8+
*/
9+
10+
/*
11+
* This program is free software; you can redistribute it and/or modify it
12+
* under the terms of the GNU General Public License as published by the Free
13+
* Software Foundation; either version 2 of the License, or (at your option)
14+
* any later version.
15+
*/
16+
17+
#include <linux/device.h>
18+
#include <linux/hid.h>
19+
#include <linux/module.h>
20+
21+
#include "hid-ids.h"
22+
23+
static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
24+
unsigned int rsize)
25+
{
26+
if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
27+
dev_info(&hdev->dev, "Fixing up Elecom BM084 "
28+
"report descriptor.\n");
29+
rdesc[47] = 0x00;
30+
}
31+
}
32+
33+
static const struct hid_device_id elecom_devices[] = {
34+
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
35+
{ }
36+
};
37+
MODULE_DEVICE_TABLE(hid, elecom_devices);
38+
39+
static struct hid_driver elecom_driver = {
40+
.name = "elecom",
41+
.id_table = elecom_devices,
42+
.report_fixup = elecom_report_fixup
43+
};
44+
45+
static int __init elecom_init(void)
46+
{
47+
return hid_register_driver(&elecom_driver);
48+
}
49+
50+
static void __exit elecom_exit(void)
51+
{
52+
hid_unregister_driver(&elecom_driver);
53+
}
54+
55+
module_init(elecom_init);
56+
module_exit(elecom_exit);
57+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)