Skip to content

Commit 8de29a3

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: - quite a few firmware fixes for RMI driver by Andrew Duggan - huion and uclogic drivers have been substantially overlaping in functionality laterly. This redundancy is fixed by hid-huion driver being merged into hid-uclogic; work done by Benjamin Tissoires and Nikolai Kondrashov - i2c-hid now supports ACPI GPIO interrupts; patch from Mika Westerberg - Some of the quirks, that got separated into individual drivers, have historically had EXPERT dependency. As HID subsystem matured (as well as the individual drivers), this made less and less sense. This dependency is now being removed by patch from Jean Delvare - Logitech lg4ff driver received a couple of improvements for mode switching, by Michal Malý - multitouch driver now supports clickpads, patches by Benjamin Tissoires and Seth Forshee - hid-sensor framework received a substantial update; namely support for Custom and Generic pages is being added; work done by Srinivas Pandruvada - wacom driver received substantial update; it now supports i2c-conntected devices (Mika Westerberg), Bamboo PADs are now properly supported (Benjamin Tissoires), much improved battery reporting (Jason Gerecke) and pen proximity cleanups (Ping Cheng) - small assorted fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits) HID: sensor: Update document for custom sensor HID: sensor: Custom and Generic sensor support HID: debug: fix error handling in hid_debug_events_read() Input - mt: Fix input_mt_get_slot_by_key HID: logitech-hidpp: fix error return code HID: wacom: Add support for Cintiq 13HD Touch HID: logitech-hidpp: add a module parameter to keep firmware gestures HID: usbhid: yet another mouse with ALWAYS_POLL HID: usbhid: more mice with ALWAYS_POLL HID: wacom: set stylus_in_proximity before checking touch_down HID: wacom: use wacom_wac_finger_count_touches to set touch_down HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT HID: pidff: effect can't be NULL HID: add quirk for PIXART OEM mouse used by HP HID: add HP OEM mouse to quirk ALWAYS_POLL HID: wacom: ask for a in-prox report when it was missed HID: hid-sensor-hub: Fix sparse warning HID: hid-sensor-hub: fix attribute read for logical usage id HID: plantronics: fix Kconfig default HID: pidff: support more than one concurrent effect ...
2 parents 31f7dc7 + 2e455c2 commit 8de29a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2980
-706
lines changed

Documentation/ABI/testing/sysfs-driver-hid

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ Description: When read, this file returns the device's raw binary HID
88
report descriptor.
99
This file cannot be written.
1010
Users: HIDAPI library (http://www.signal11.us/oss/hidapi)
11+
12+
What: For USB devices : /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/country
13+
For BT devices : /sys/class/bluetooth/hci<addr>/<hid-bus>:<vendor-id>:<product-id>.<num>/country
14+
Symlink : /sys/class/hidraw/hidraw<num>/device/country
15+
Date: February 2015
16+
KernelVersion: 3.19
17+
Contact: Olivier Gay <[email protected]>
18+
Description: When read, this file returns the hex integer value in ASCII
19+
of the device's HID country code (e.g. 21 for US).
20+
This file cannot be written.

Documentation/ABI/testing/sysfs-driver-hid-logitech-lg4ff

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,48 @@ Contact: Michal Malý <[email protected]>
55
Description: Display minimum, maximum and current range of the steering
66
wheel. Writing a value within min and max boundaries sets the
77
range of the wheel.
8+
9+
What: /sys/bus/hid/drivers/logitech/<dev>/alternate_modes
10+
Date: Feb 2015
11+
KernelVersion: 4.1
12+
Contact: Michal Malý <[email protected]>
13+
Description: Displays a set of alternate modes supported by a wheel. Each
14+
mode is listed as follows:
15+
Tag: Mode Name
16+
Currently active mode is marked with an asterisk. List also
17+
contains an abstract item "native" which always denotes the
18+
native mode of the wheel. Echoing the mode tag switches the
19+
wheel into the corresponding mode. Depending on the exact model
20+
of the wheel not all listed modes might always be selectable.
21+
If a wheel cannot be switched into the desired mode, -EINVAL
22+
is returned accompanied with an explanatory message in the
23+
kernel log.
24+
This entry is not created for devices that have only one mode.
25+
26+
Currently supported mode switches:
27+
Driving Force Pro:
28+
DF-EX --> DFP
29+
30+
G25:
31+
DF-EX --> DFP --> G25
32+
33+
G27:
34+
DF-EX <*> DFP <-> G25 <-> G27
35+
DF-EX <*--------> G25 <-> G27
36+
DF-EX <*----------------> G27
37+
38+
DFGT:
39+
DF-EX <*> DFP <-> DFGT
40+
DF-EX <*--------> DFGT
41+
42+
* hid_logitech module must be loaded with lg4ff_no_autoswitch=1
43+
parameter set in order for the switch to DF-EX mode to work.
44+
45+
What: /sys/bus/hid/drivers/logitech/<dev>/real_id
46+
Date: Feb 2015
47+
KernelVersion: 4.1
48+
Contact: Michal Malý <[email protected]>
49+
Description: Displays the real model of the wheel regardless of any
50+
alternate mode the wheel might be switched to.
51+
It is a read-only value.
52+
This entry is not created for devices that have only one mode.

Documentation/hid/hid-sensor.txt

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,87 @@ accelerometer wants to poll X axis value, then it can call this function with
138138
the usage id of X axis. HID sensors can provide events, so this is not necessary
139139
to poll for any field. If there is some new sample, the core driver will call
140140
registered callback function to process the sample.
141+
142+
143+
----------
144+
145+
HID Custom and generic Sensors
146+
147+
HID Sensor specification defines two special sensor usage types. Since they
148+
don't represent a standard sensor, it is not possible to define using Linux IIO
149+
type interfaces.
150+
The purpose of these sensors is to extend the functionality or provide a
151+
way to obfuscate the data being communicated by a sensor. Without knowing the
152+
mapping between the data and its encapsulated form, it is difficult for
153+
an application/driver to determine what data is being communicated by the sensor.
154+
This allows some differentiating use cases, where vendor can provide applications.
155+
Some common use cases are debug other sensors or to provide some events like
156+
keyboard attached/detached or lid open/close.
157+
158+
To allow application to utilize these sensors, here they are exported uses sysfs
159+
attribute groups, attributes and misc device interface.
160+
161+
An example of this representation on sysfs:
162+
/sys/devices/pci0000:00/INT33C2:00/i2c-0/i2c-INT33D1:00/0018:8086:09FA.0001/HID-SENSOR-2000e1.6.auto$ tree -R
163+
.
164+
????????? enable_sensor
165+
????????? feature-0-200316
166+
??????? ????????? feature-0-200316-maximum
167+
??????? ????????? feature-0-200316-minimum
168+
??????? ????????? feature-0-200316-name
169+
??????? ????????? feature-0-200316-size
170+
??????? ????????? feature-0-200316-unit-expo
171+
??????? ????????? feature-0-200316-units
172+
??????? ????????? feature-0-200316-value
173+
????????? feature-1-200201
174+
??????? ????????? feature-1-200201-maximum
175+
??????? ????????? feature-1-200201-minimum
176+
??????? ????????? feature-1-200201-name
177+
??????? ????????? feature-1-200201-size
178+
??????? ????????? feature-1-200201-unit-expo
179+
??????? ????????? feature-1-200201-units
180+
??????? ????????? feature-1-200201-value
181+
????????? input-0-200201
182+
??????? ????????? input-0-200201-maximum
183+
??????? ????????? input-0-200201-minimum
184+
??????? ????????? input-0-200201-name
185+
??????? ????????? input-0-200201-size
186+
??????? ????????? input-0-200201-unit-expo
187+
??????? ????????? input-0-200201-units
188+
??????? ????????? input-0-200201-value
189+
????????? input-1-200202
190+
??????? ????????? input-1-200202-maximum
191+
??????? ????????? input-1-200202-minimum
192+
??????? ????????? input-1-200202-name
193+
??????? ????????? input-1-200202-size
194+
??????? ????????? input-1-200202-unit-expo
195+
??????? ????????? input-1-200202-units
196+
??????? ????????? input-1-200202-value
197+
198+
Here there is a custom sensors with four fields, two feature and two inputs.
199+
Each field is represented by a set of attributes. All fields except the "value"
200+
are read only. The value field is a RW field.
201+
Example
202+
/sys/bus/platform/devices/HID-SENSOR-2000e1.6.auto/feature-0-200316$ grep -r . *
203+
feature-0-200316-maximum:6
204+
feature-0-200316-minimum:0
205+
feature-0-200316-name:property-reporting-state
206+
feature-0-200316-size:1
207+
feature-0-200316-unit-expo:0
208+
feature-0-200316-units:25
209+
feature-0-200316-value:1
210+
211+
How to enable such sensor?
212+
By default sensor can be power gated. To enable sysfs attribute "enable" can be
213+
used.
214+
$ echo 1 > enable_sensor
215+
216+
Once enabled and powered on, sensor can report value using HID reports.
217+
These reports are pushed using misc device interface in a FIFO order.
218+
/dev$ tree | grep HID-SENSOR-2000e1.6.auto
219+
??????? ????????? 10:53 -> ../HID-SENSOR-2000e1.6.auto
220+
????????? HID-SENSOR-2000e1.6.auto
221+
222+
Each reports can be of variable length preceded by a header. This header
223+
consist of a 32 bit usage id, 64 bit time stamp and 32 bit length field of raw
224+
data.

drivers/hid/Kconfig

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ menu "Special HID drivers"
9292
depends on HID
9393

9494
config HID_A4TECH
95-
tristate "A4 tech mice" if EXPERT
95+
tristate "A4 tech mice"
9696
depends on HID
9797
default !EXPERT
9898
---help---
@@ -113,7 +113,7 @@ config HID_ACRUX_FF
113113
game controllers.
114114

115115
config HID_APPLE
116-
tristate "Apple {i,Power,Mac}Books" if EXPERT
116+
tristate "Apple {i,Power,Mac}Books"
117117
depends on HID
118118
default !EXPERT
119119
---help---
@@ -141,7 +141,7 @@ config HID_AUREAL
141141
Support for Aureal Cy se W-01RN Remote Controller and other Aureal derived remotes.
142142

143143
config HID_BELKIN
144-
tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT
144+
tristate "Belkin Flip KVM and Wireless keyboard"
145145
depends on HID
146146
default !EXPERT
147147
---help---
@@ -158,14 +158,14 @@ config HID_BETOP_FF
158158
- BETOP 2185 PC & BFM MODE
159159

160160
config HID_CHERRY
161-
tristate "Cherry Cymotion keyboard" if EXPERT
161+
tristate "Cherry Cymotion keyboard"
162162
depends on HID
163163
default !EXPERT
164164
---help---
165165
Support for Cherry Cymotion keyboard.
166166

167167
config HID_CHICONY
168-
tristate "Chicony Tactical pad" if EXPERT
168+
tristate "Chicony Tactical pad"
169169
depends on HID
170170
default !EXPERT
171171
---help---
@@ -196,7 +196,7 @@ config HID_CP2112
196196
customizable USB descriptor fields are exposed as sysfs attributes.
197197

198198
config HID_CYPRESS
199-
tristate "Cypress mouse and barcode readers" if EXPERT
199+
tristate "Cypress mouse and barcode readers"
200200
depends on HID
201201
default !EXPERT
202202
---help---
@@ -245,7 +245,7 @@ config HID_ELO
245245
different devices than those handled by CONFIG_TOUCHSCREEN_USB_ELO.
246246

247247
config HID_EZKEY
248-
tristate "Ezkey BTC 8193 keyboard" if EXPERT
248+
tristate "Ezkey BTC 8193 keyboard"
249249
depends on HID
250250
default !EXPERT
251251
---help---
@@ -286,12 +286,6 @@ config HID_GT683R
286286
Currently the following devices are know to be supported:
287287
- MSI GT683R
288288

289-
config HID_HUION
290-
tristate "Huion tablets"
291-
depends on USB_HID
292-
---help---
293-
Support for Huion 580 tablet.
294-
295289
config HID_KEYTOUCH
296290
tristate "Keytouch HID devices"
297291
depends on HID
@@ -312,9 +306,9 @@ config HID_KYE
312306

313307
config HID_UCLOGIC
314308
tristate "UC-Logic"
315-
depends on HID
309+
depends on USB_HID
316310
---help---
317-
Support for UC-Logic tablets.
311+
Support for UC-Logic and Huion tablets.
318312

319313
config HID_WALTOP
320314
tristate "Waltop"
@@ -344,7 +338,7 @@ config HID_TWINHAN
344338
Support for Twinhan IR remote control.
345339

346340
config HID_KENSINGTON
347-
tristate "Kensington Slimblade Trackball" if EXPERT
341+
tristate "Kensington Slimblade Trackball"
348342
depends on HID
349343
default !EXPERT
350344
---help---
@@ -372,7 +366,7 @@ config HID_LENOVO
372366
- ThinkPad Compact USB Keyboard with TrackPoint (supports Fn keys)
373367

374368
config HID_LOGITECH
375-
tristate "Logitech devices" if EXPERT
369+
tristate "Logitech devices"
376370
depends on HID
377371
default !EXPERT
378372
---help---
@@ -461,14 +455,14 @@ config HID_MAGICMOUSE
461455
Apple Wireless "Magic" Mouse and the Apple Wireless "Magic" Trackpad.
462456

463457
config HID_MICROSOFT
464-
tristate "Microsoft non-fully HID-compliant devices" if EXPERT
458+
tristate "Microsoft non-fully HID-compliant devices"
465459
depends on HID
466460
default !EXPERT
467461
---help---
468462
Support for Microsoft devices that are not fully compliant with HID standard.
469463

470464
config HID_MONTEREY
471-
tristate "Monterey Genius KB29E keyboard" if EXPERT
465+
tristate "Monterey Genius KB29E keyboard"
472466
depends on HID
473467
default !EXPERT
474468
---help---
@@ -638,7 +632,6 @@ config HID_PICOLCD_CIR
638632

639633
config HID_PLANTRONICS
640634
tristate "Plantronics USB HID Driver"
641-
default !EXPERT
642635
depends on HID
643636
---help---
644637
Provides HID support for Plantronics telephony devices.
@@ -885,6 +878,21 @@ config HID_SENSOR_HUB
885878
for events and handle data streams. Each sensor driver can format
886879
data and present to user mode using input or IIO interface.
887880

881+
config HID_SENSOR_CUSTOM_SENSOR
882+
tristate "HID Sensors hub custom sensor support"
883+
depends on HID_SENSOR_HUB
884+
default n
885+
---help---
886+
HID Sensor hub specification allows definition of some custom and
887+
generic sensors. Unlike other HID sensors, they can't be exported
888+
via Linux IIO because of custom fields. This is up to the manufacturer
889+
to decide how to interpret these special sensor ids and process in
890+
the user space. Currently some manufacturers are using these ids for
891+
sensor calibration and debugging other sensors. Manufacturers
892+
should't use these special custom sensor ids to export any of the
893+
standard sensors.
894+
Select this config option for custom/generic sensor support.
895+
888896
endmenu
889897

890898
endif # HID

drivers/hid/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
4141
obj-$(CONFIG_HID_HOLTEK) += hid-holtek-kbd.o
4242
obj-$(CONFIG_HID_HOLTEK) += hid-holtek-mouse.o
4343
obj-$(CONFIG_HID_HOLTEK) += hid-holtekff.o
44-
obj-$(CONFIG_HID_HUION) += hid-huion.o
4544
obj-$(CONFIG_HID_HYPERV_MOUSE) += hid-hyperv.o
4645
obj-$(CONFIG_HID_ICADE) += hid-icade.o
4746
obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
@@ -101,6 +100,7 @@ obj-$(CONFIG_HID_WACOM) += wacom.o
101100
obj-$(CONFIG_HID_WALTOP) += hid-waltop.o
102101
obj-$(CONFIG_HID_WIIMOTE) += hid-wiimote.o
103102
obj-$(CONFIG_HID_SENSOR_HUB) += hid-sensor-hub.o
103+
obj-$(CONFIG_HID_SENSOR_CUSTOM_SENSOR) += hid-sensor-custom.o
104104

105105
obj-$(CONFIG_USB_HID) += usbhid/
106106
obj-$(CONFIG_USB_MOUSE) += usbhid/

drivers/hid/hid-core.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,12 +1562,26 @@ read_report_descriptor(struct file *filp, struct kobject *kobj,
15621562
return count;
15631563
}
15641564

1565+
static ssize_t
1566+
show_country(struct device *dev, struct device_attribute *attr,
1567+
char *buf)
1568+
{
1569+
struct hid_device *hdev = container_of(dev, struct hid_device, dev);
1570+
1571+
return sprintf(buf, "%02x\n", hdev->country & 0xff);
1572+
}
1573+
15651574
static struct bin_attribute dev_bin_attr_report_desc = {
15661575
.attr = { .name = "report_descriptor", .mode = 0444 },
15671576
.read = read_report_descriptor,
15681577
.size = HID_MAX_DESCRIPTOR_SIZE,
15691578
};
15701579

1580+
static struct device_attribute dev_attr_country = {
1581+
.attr = { .name = "country", .mode = 0444 },
1582+
.show = show_country,
1583+
};
1584+
15711585
int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
15721586
{
15731587
static const char *types[] = { "Device", "Pointer", "Mouse", "Device",
@@ -1646,6 +1660,11 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
16461660
bus = "<UNKNOWN>";
16471661
}
16481662

1663+
ret = device_create_file(&hdev->dev, &dev_attr_country);
1664+
if (ret)
1665+
hid_warn(hdev,
1666+
"can't create sysfs country code attribute err: %d\n", ret);
1667+
16491668
ret = device_create_bin_file(&hdev->dev, &dev_bin_attr_report_desc);
16501669
if (ret)
16511670
hid_warn(hdev,
@@ -1661,6 +1680,7 @@ EXPORT_SYMBOL_GPL(hid_connect);
16611680

16621681
void hid_disconnect(struct hid_device *hdev)
16631682
{
1683+
device_remove_file(&hdev->dev, &dev_attr_country);
16641684
device_remove_bin_file(&hdev->dev, &dev_bin_attr_report_desc);
16651685
if (hdev->claimed & HID_CLAIMED_INPUT)
16661686
hidinput_disconnect(hdev);
@@ -1824,6 +1844,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
18241844
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
18251845
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
18261846
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
1847+
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912) },
18271848
{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
18281849
{ HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
18291850
#if IS_ENABLED(CONFIG_HID_LENOVO)

drivers/hid/hid-debug.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ static const struct hid_usage_entry hid_usage_table[] = {
165165
{0, 0x53, "DeviceIndex"},
166166
{0, 0x54, "ContactCount"},
167167
{0, 0x55, "ContactMaximumNumber"},
168+
{0, 0x59, "ButtonType"},
168169
{0, 0x5A, "SecondaryBarrelSwitch"},
169170
{0, 0x5B, "TransducerSerialNumber"},
170171
{ 15, 0, "PhysicalInterfaceDevice" },
@@ -1127,7 +1128,8 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,
11271128

11281129
if (!list->hdev || !list->hdev->debug) {
11291130
ret = -EIO;
1130-
break;
1131+
set_current_state(TASK_RUNNING);
1132+
goto out;
11311133
}
11321134

11331135
/* allow O_NONBLOCK from other threads */

0 commit comments

Comments
 (0)