Skip to content

Commit 870fd0f

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: "Updates for HID code - improveements of Logitech HID++ procotol implementation, from Benjamin Tissoires - support for composite RMI devices, from Andrew Duggan - new driver for BETOP controller, from Huang Bo - fixup for conflicting mapping in HID core between PC-101/103/104 and PC-102/105 keyboards from David Herrmann - new hardware support and fixes in Wacom driver, from Ping Cheng - assorted small fixes and device ID additions all over the place" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (33 commits) HID: wacom: add support for Cintiq 27QHD and 27QHD touch HID: wacom: consolidate input capability settings for pen and touch HID: wacom: make sure touch arbitration is applied consistently HID: pidff: Fix initialisation forMicrosoft Sidewinder FF Pro 2 HID: hyperv: match wait_for_completion_timeout return type HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid HID: Use Kbuild idiom in Makefiles HID: do not bind to Microchip Pick16F1454 HID: hid-lg4ff: use DEVICE_ATTR_RW macro HID: hid-lg4ff: fix sysfs attribute permission HID: wacom: peport In Range event according to the spec HID: wacom: process invalid Cintiq and Intuos data in wacom_intuos_inout() HID: rmi: Add support for the touchpad in the Razer Blade 14 laptop HID: rmi: Support touchpads with external buttons HID: rmi: Use hid_report_len to compute the size of reports HID: logitech-hidpp: store the name of the device in struct hidpp HID: microsoft: add support for Japanese Surface Type Cover 3 HID: fixup the conflicting keyboard mappings quirk HID: apple: fix battery support for the 2009 ANSI wireless keyboard HID: fix Kconfig text ...
2 parents 06cc01a + 988b7fb commit 870fd0f

20 files changed

+643
-229
lines changed

drivers/hid/Kconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ config HID_BELKIN
147147
---help---
148148
Support for Belkin Flip KVM and Wireless keyboard.
149149

150+
config HID_BETOP_FF
151+
tristate "Betop Production Inc. force feedback support"
152+
depends on USB_HID
153+
select INPUT_FF_MEMLESS
154+
---help---
155+
Say Y here if you want to enable force feedback support for devices by
156+
BETOP Production Ltd.
157+
Currently the following devices are known to be supported:
158+
- BETOP 2185 PC & BFM MODE
159+
150160
config HID_CHERRY
151161
tristate "Cherry Cymotion keyboard" if EXPERT
152162
depends on HID
@@ -389,7 +399,7 @@ config HID_LOGITECH_HIDPP
389399
Say Y if you want support for Logitech devices relying on the HID++
390400
specification. Such devices are the various Logitech Touchpads (T650,
391401
T651, TK820), some mice (Zone Touch mouse), or even keyboards (Solar
392-
Keayboard).
402+
Keyboard).
393403

394404
config LOGITECH_FF
395405
bool "Logitech force feedback support"

drivers/hid/Makefile

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
# Makefile for the HID driver
33
#
44
hid-y := hid-core.o hid-input.o
5-
6-
ifdef CONFIG_DEBUG_FS
7-
hid-objs += hid-debug.o
8-
endif
5+
hid-$(CONFIG_DEBUG_FS) += hid-debug.o
96

107
obj-$(CONFIG_HID) += hid.o
118
obj-$(CONFIG_UHID) += uhid.o
@@ -15,30 +12,21 @@ obj-$(CONFIG_HID_GENERIC) += hid-generic.o
1512
hid-$(CONFIG_HIDRAW) += hidraw.o
1613

1714
hid-logitech-y := hid-lg.o
18-
ifdef CONFIG_LOGITECH_FF
19-
hid-logitech-y += hid-lgff.o
20-
endif
21-
ifdef CONFIG_LOGIRUMBLEPAD2_FF
22-
hid-logitech-y += hid-lg2ff.o
23-
endif
24-
ifdef CONFIG_LOGIG940_FF
25-
hid-logitech-y += hid-lg3ff.o
26-
endif
27-
ifdef CONFIG_LOGIWHEELS_FF
28-
hid-logitech-y += hid-lg4ff.o
29-
endif
15+
hid-logitech-$(CONFIG_LOGITECH_FF) += hid-lgff.o
16+
hid-logitech-$(CONFIG_LOGIRUMBLEPAD2_FF) += hid-lg2ff.o
17+
hid-logitech-$(CONFIG_LOGIG940_FF) += hid-lg3ff.o
18+
hid-logitech-$(CONFIG_LOGIWHEELS_FF) += hid-lg4ff.o
3019

3120
hid-wiimote-y := hid-wiimote-core.o hid-wiimote-modules.o
32-
ifdef CONFIG_DEBUG_FS
33-
hid-wiimote-y += hid-wiimote-debug.o
34-
endif
21+
hid-wiimote-$(CONFIG_DEBUG_FS) += hid-wiimote-debug.o
3522

3623
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
3724
obj-$(CONFIG_HID_ACRUX) += hid-axff.o
3825
obj-$(CONFIG_HID_APPLE) += hid-apple.o
3926
obj-$(CONFIG_HID_APPLEIR) += hid-appleir.o
4027
obj-$(CONFIG_HID_AUREAL) += hid-aureal.o
4128
obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
29+
obj-$(CONFIG_HID_BETOP_FF) += hid-betopff.o
4230
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
4331
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
4432
obj-$(CONFIG_HID_CP2112) += hid-cp2112.o
@@ -76,24 +64,12 @@ obj-$(CONFIG_HID_PENMOUNT) += hid-penmount.o
7664
obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o
7765
obj-$(CONFIG_HID_PICOLCD) += hid-picolcd.o
7866
hid-picolcd-y += hid-picolcd_core.o
79-
ifdef CONFIG_HID_PICOLCD_FB
80-
hid-picolcd-y += hid-picolcd_fb.o
81-
endif
82-
ifdef CONFIG_HID_PICOLCD_BACKLIGHT
83-
hid-picolcd-y += hid-picolcd_backlight.o
84-
endif
85-
ifdef CONFIG_HID_PICOLCD_LCD
86-
hid-picolcd-y += hid-picolcd_lcd.o
87-
endif
88-
ifdef CONFIG_HID_PICOLCD_LEDS
89-
hid-picolcd-y += hid-picolcd_leds.o
90-
endif
91-
ifdef CONFIG_HID_PICOLCD_CIR
92-
hid-picolcd-y += hid-picolcd_cir.o
93-
endif
94-
ifdef CONFIG_DEBUG_FS
95-
hid-picolcd-y += hid-picolcd_debugfs.o
96-
endif
67+
hid-picolcd-$(CONFIG_HID_PICOLCD_FB) += hid-picolcd_fb.o
68+
hid-picolcd-$(CONFIG_HID_PICOLCD_BACKLIGHT) += hid-picolcd_backlight.o
69+
hid-picolcd-$(CONFIG_HID_PICOLCD_LCD) += hid-picolcd_lcd.o
70+
hid-picolcd-$(CONFIG_HID_PICOLCD_LEDS) += hid-picolcd_leds.o
71+
hid-picolcd-$(CONFIG_HID_PICOLCD_CIR) += hid-picolcd_cir.o
72+
hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o
9773

9874
obj-$(CONFIG_HID_PLANTRONICS) += hid-plantronics.o
9975
obj-$(CONFIG_HID_PRIMAX) += hid-primax.o

drivers/hid/hid-betopff.c

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/*
2+
* Force feedback support for Betop based devices
3+
*
4+
* The devices are distributed under various names and the same USB device ID
5+
* can be used in both adapters and actual game controllers.
6+
*
7+
* 0x11c2:0x2208 "BTP2185 BFM mode Joystick"
8+
* - tested with BTP2185 BFM Mode.
9+
*
10+
* 0x11C0:0x5506 "BTP2185 PC mode Joystick"
11+
* - tested with BTP2185 PC Mode.
12+
*
13+
* 0x8380:0x1850 "BTP2185 V2 PC mode USB Gamepad"
14+
* - tested with BTP2185 PC Mode with another version.
15+
*
16+
* 0x20bc:0x5500 "BTP2185 V2 BFM mode Joystick"
17+
* - tested with BTP2171s.
18+
* Copyright (c) 2014 Huang Bo <[email protected]>
19+
*/
20+
21+
/*
22+
* This program is free software; you can redistribute it and/or modify it
23+
* under the terms of the GNU General Public License as published by the Free
24+
* Software Foundation; either version 2 of the License, or (at your option)
25+
* any later version.
26+
*/
27+
28+
29+
#include <linux/input.h>
30+
#include <linux/slab.h>
31+
#include <linux/module.h>
32+
#include <linux/hid.h>
33+
34+
#include "hid-ids.h"
35+
36+
struct betopff_device {
37+
struct hid_report *report;
38+
};
39+
40+
static int hid_betopff_play(struct input_dev *dev, void *data,
41+
struct ff_effect *effect)
42+
{
43+
struct hid_device *hid = input_get_drvdata(dev);
44+
struct betopff_device *betopff = data;
45+
__u16 left, right;
46+
47+
left = effect->u.rumble.strong_magnitude;
48+
right = effect->u.rumble.weak_magnitude;
49+
50+
betopff->report->field[2]->value[0] = left / 256;
51+
betopff->report->field[3]->value[0] = right / 256;
52+
53+
hid_hw_request(hid, betopff->report, HID_REQ_SET_REPORT);
54+
55+
return 0;
56+
}
57+
58+
static int betopff_init(struct hid_device *hid)
59+
{
60+
struct betopff_device *betopff;
61+
struct hid_report *report;
62+
struct hid_input *hidinput =
63+
list_first_entry(&hid->inputs, struct hid_input, list);
64+
struct list_head *report_list =
65+
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
66+
struct input_dev *dev = hidinput->input;
67+
int field_count = 0;
68+
int error;
69+
int i, j;
70+
71+
if (list_empty(report_list)) {
72+
hid_err(hid, "no output reports found\n");
73+
return -ENODEV;
74+
}
75+
76+
report = list_first_entry(report_list, struct hid_report, list);
77+
/*
78+
* Actually there are 4 fields for 4 Bytes as below:
79+
* -----------------------------------------
80+
* Byte0 Byte1 Byte2 Byte3
81+
* 0x00 0x00 left_motor right_motor
82+
* -----------------------------------------
83+
* Do init them with default value.
84+
*/
85+
for (i = 0; i < report->maxfield; i++) {
86+
for (j = 0; j < report->field[i]->report_count; j++) {
87+
report->field[i]->value[j] = 0x00;
88+
field_count++;
89+
}
90+
}
91+
92+
if (field_count < 4) {
93+
hid_err(hid, "not enough fields in the report: %d\n",
94+
field_count);
95+
return -ENODEV;
96+
}
97+
98+
betopff = kzalloc(sizeof(*betopff), GFP_KERNEL);
99+
if (!betopff)
100+
return -ENOMEM;
101+
102+
set_bit(FF_RUMBLE, dev->ffbit);
103+
104+
error = input_ff_create_memless(dev, betopff, hid_betopff_play);
105+
if (error) {
106+
kfree(betopff);
107+
return error;
108+
}
109+
110+
betopff->report = report;
111+
hid_hw_request(hid, betopff->report, HID_REQ_SET_REPORT);
112+
113+
hid_info(hid, "Force feedback for betop devices by huangbo <[email protected]>\n");
114+
115+
return 0;
116+
}
117+
118+
static int betop_probe(struct hid_device *hdev, const struct hid_device_id *id)
119+
{
120+
int ret;
121+
122+
if (id->driver_data)
123+
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
124+
125+
ret = hid_parse(hdev);
126+
if (ret) {
127+
hid_err(hdev, "parse failed\n");
128+
goto err;
129+
}
130+
131+
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
132+
if (ret) {
133+
hid_err(hdev, "hw start failed\n");
134+
goto err;
135+
}
136+
137+
betopff_init(hdev);
138+
139+
return 0;
140+
err:
141+
return ret;
142+
}
143+
144+
static const struct hid_device_id betop_devices[] = {
145+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185BFM, 0x2208) },
146+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185PC, 0x5506) },
147+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2PC, 0x1850) },
148+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2BFM, 0x5500) },
149+
{ }
150+
};
151+
MODULE_DEVICE_TABLE(hid, betop_devices);
152+
153+
static struct hid_driver betop_driver = {
154+
.name = "betop",
155+
.id_table = betop_devices,
156+
.probe = betop_probe,
157+
};
158+
module_hid_driver(betop_driver);
159+
160+
MODULE_LICENSE("GPL");

drivers/hid/hid-core.c

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,15 +698,25 @@ static void hid_scan_feature_usage(struct hid_parser *parser, u32 usage)
698698
static void hid_scan_collection(struct hid_parser *parser, unsigned type)
699699
{
700700
struct hid_device *hid = parser->device;
701+
int i;
701702

702703
if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
703704
type == HID_COLLECTION_PHYSICAL)
704705
hid->group = HID_GROUP_SENSOR_HUB;
705706

706707
if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
707-
hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 &&
708+
(hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 ||
709+
hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3_JP) &&
708710
hid->group == HID_GROUP_MULTITOUCH)
709711
hid->group = HID_GROUP_GENERIC;
712+
713+
if ((parser->global.usage_page << 16) == HID_UP_GENDESK)
714+
for (i = 0; i < parser->local.usage_index; i++)
715+
if (parser->local.usage[i] == HID_GD_POINTER)
716+
parser->scan_flags |= HID_SCAN_FLAG_GD_POINTER;
717+
718+
if ((parser->global.usage_page << 16) >= HID_UP_MSVENDOR)
719+
parser->scan_flags |= HID_SCAN_FLAG_VENDOR_SPECIFIC;
710720
}
711721

712722
static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
@@ -792,11 +802,14 @@ static int hid_scan_report(struct hid_device *hid)
792802
hid->group = HID_GROUP_WACOM;
793803
break;
794804
case USB_VENDOR_ID_SYNAPTICS:
795-
if ((hid->group == HID_GROUP_GENERIC) &&
796-
(hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE))
797-
/* hid-rmi should only bind to the mouse interface of
798-
* composite USB devices */
799-
hid->group = HID_GROUP_RMI;
805+
if (hid->group == HID_GROUP_GENERIC)
806+
if ((parser->scan_flags & HID_SCAN_FLAG_VENDOR_SPECIFIC)
807+
&& (parser->scan_flags & HID_SCAN_FLAG_GD_POINTER))
808+
/*
809+
* hid-rmi should take care of them,
810+
* not hid-generic
811+
*/
812+
hid->group = HID_GROUP_RMI;
800813
break;
801814
}
802815

@@ -1757,6 +1770,10 @@ static const struct hid_device_id hid_have_special_driver[] = {
17571770
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
17581771
{ HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
17591772
{ HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
1773+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185BFM, 0x2208) },
1774+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185PC, 0x5506) },
1775+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2PC, 0x1850) },
1776+
{ HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2BFM, 0x5500) },
17601777
{ HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
17611778
{ HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },
17621779
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
@@ -1861,6 +1878,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
18611878
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) },
18621879
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_OFFICE_KB) },
18631880
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) },
1881+
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP) },
18641882
{ HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
18651883
{ HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
18661884
{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
@@ -1971,6 +1989,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
19711989
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
19721990
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
19731991
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
1992+
{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER, USB_DEVICE_ID_RAZER_BLADE_14) },
19741993
{ }
19751994
};
19761995

@@ -2328,6 +2347,7 @@ static const struct hid_device_id hid_ignore_list[] = {
23282347
{ HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) },
23292348
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) },
23302349
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT2) },
2350+
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICK16F1454) },
23312351
{ HID_USB_DEVICE(USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR, USB_DEVICE_ID_N_S_HARMONY) },
23322352
{ HID_USB_DEVICE(USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100) },
23332353
{ HID_USB_DEVICE(USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 20) },

drivers/hid/hid-hyperv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static void mousevsc_on_channel_callback(void *context)
381381
static int mousevsc_connect_to_vsp(struct hv_device *device)
382382
{
383383
int ret = 0;
384-
int t;
384+
unsigned long t;
385385
struct mousevsc_dev *input_dev = hv_get_drvdata(device);
386386
struct mousevsc_prt_msg *request;
387387
struct mousevsc_prt_msg *response;

drivers/hid/hid-ids.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@
189189
#define USB_VENDOR_ID_BERKSHIRE 0x0c98
190190
#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
191191

192+
#define USB_VENDOR_ID_BETOP_2185BFM 0x11c2
193+
#define USB_VENDOR_ID_BETOP_2185PC 0x11c0
194+
#define USB_VENDOR_ID_BETOP_2185V2PC 0x8380
195+
#define USB_VENDOR_ID_BETOP_2185V2BFM 0x20bc
196+
192197
#define USB_VENDOR_ID_BTC 0x046e
193198
#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578
194199
#define USB_DEVICE_ID_BTC_EMPREX_REMOTE_2 0x5577
@@ -638,6 +643,7 @@
638643
#define USB_DEVICE_ID_PICKIT2 0x0033
639644
#define USB_DEVICE_ID_PICOLCD 0xc002
640645
#define USB_DEVICE_ID_PICOLCD_BOOTLOADER 0xf002
646+
#define USB_DEVICE_ID_PICK16F1454 0x0042
641647

642648
#define USB_VENDOR_ID_MICROSOFT 0x045e
643649
#define USB_DEVICE_ID_SIDEWINDER_GV 0x003b
@@ -654,6 +660,7 @@
654660
#define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7
655661
#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
656662
#define USB_DEVICE_ID_MS_TYPE_COVER_3 0x07dc
663+
#define USB_DEVICE_ID_MS_TYPE_COVER_3_JP 0x07dd
657664

658665
#define USB_VENDOR_ID_MOJO 0x8282
659666
#define USB_DEVICE_ID_RETRO_ADAPTER 0x3201
@@ -768,6 +775,9 @@
768775
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001
769776
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008
770777

778+
#define USB_VENDOR_ID_RAZER 0x1532
779+
#define USB_DEVICE_ID_RAZER_BLADE_14 0x011D
780+
771781
#define USB_VENDOR_ID_REALTEK 0x0bda
772782
#define USB_DEVICE_ID_REALTEK_READER 0x0152
773783

0 commit comments

Comments
 (0)