aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 19:24:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 19:24:28 -0400
commit0f1b1e6d73cb989ce2c071edc57deade3b084dfe (patch)
tree1bd8f2d3ea66dbc3fadd9a9ca522caa99d9b5277
parent159d8133d0b54a501a41a66fe3a0e7d16405e36d (diff)
parent3ae821effdfea47dcb36b52e0a8dffd9757a96a6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: - substantial cleanup of the generic and transport layers, in the direction of an ultimate goal of making struct hid_device completely transport independent, by Benjamin Tissoires - cp2112 driver from David Barksdale - a lot of fixes and new hardware support (Dualshock 4) to hid-sony driver, by Frank Praznik - support for Win 8.1 multitouch protocol by Andrew Duggan - other smaller fixes / device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (75 commits) HID: sony: fix force feedback mismerge HID: sony: Set the quriks flag for Bluetooth controllers HID: sony: Fix Sixaxis cable state detection HID: uhid: Add UHID_CREATE2 + UHID_INPUT2 HID: hyperv: fix _raw_request() prototype HID: hyperv: Implement a stub raw_request() entry point HID: hid-sensor-hub: fix sleeping function called from invalid context HID: multitouch: add support for Win 8.1 multitouch touchpads HID: remove hid_output_raw_report transport implementations HID: sony: do not rely on hid_output_raw_report HID: cp2112: remove the last hid_output_raw_report() call HID: cp2112: remove various hid_out_raw_report calls HID: multitouch: add support of other generic collections in hid-mt HID: multitouch: remove pen special handling HID: multitouch: remove registered devices with default behavior HID: hidp: Add a comment that some devices depend on the current behavior of uniq HID: sony: Prevent duplicate controller connections. HID: sony: Perform a boundry check on the sixaxis battery level index. HID: sony: Fix work queue issues HID: sony: Fix multi-line comment styling ...
-rw-r--r--Documentation/hid/hid-transport.txt317
-rw-r--r--Documentation/hid/uhid.txt11
-rw-r--r--drivers/hid/Kconfig19
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c52
-rw-r--r--drivers/hid/hid-cp2112.c1073
-rw-r--r--drivers/hid/hid-hyperv.c10
-rw-r--r--drivers/hid/hid-ids.h5
-rw-r--r--drivers/hid/hid-input.c21
-rw-r--r--drivers/hid/hid-lg.c6
-rw-r--r--drivers/hid/hid-logitech-dj.c111
-rw-r--r--drivers/hid/hid-magicmouse.c4
-rw-r--r--drivers/hid/hid-microsoft.c74
-rw-r--r--drivers/hid/hid-multitouch.c281
-rw-r--r--drivers/hid/hid-sensor-hub.c217
-rw-r--r--drivers/hid/hid-sony.c808
-rw-r--r--drivers/hid/hid-thingm.c4
-rw-r--r--drivers/hid/hid-wacom.c28
-rw-r--r--drivers/hid/hid-wiimote-core.c4
-rw-r--r--drivers/hid/hidraw.c27
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c139
-rw-r--r--drivers/hid/uhid.c103
-rw-r--r--drivers/hid/usbhid/hid-core.c102
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-trigger.c39
-rw-r--r--include/linux/hid-sensor-hub.h9
-rw-r--r--include/linux/hid-sensor-ids.h16
-rw-r--r--include/linux/hid.h76
-rw-r--r--include/uapi/linux/uhid.h23
-rw-r--r--net/bluetooth/hidp/core.c100
29 files changed, 3022 insertions, 658 deletions
diff --git a/Documentation/hid/hid-transport.txt b/Documentation/hid/hid-transport.txt
new file mode 100644
index 000000000000..3dcba9fd4a3a
--- /dev/null
+++ b/Documentation/hid/hid-transport.txt
@@ -0,0 +1,317 @@
1 HID I/O Transport Drivers
2 ===========================
3
4The HID subsystem is independent of the underlying transport driver. Initially,
5only USB was supported, but other specifications adopted the HID design and
6provided new transport drivers. The kernel includes at least support for USB,
7Bluetooth, I2C and user-space I/O drivers.
8
91) HID Bus
10==========
11
12The HID subsystem is designed as a bus. Any I/O subsystem may provide HID
13devices and register them with the HID bus. HID core then loads generic device
14drivers on top of it. The transport drivers are responsible of raw data
15transport and device setup/management. HID core is responsible of
16report-parsing, report interpretation and the user-space API. Device specifics
17and quirks are handled by all layers depending on the quirk.
18
19 +-----------+ +-----------+ +-----------+ +-----------+
20 | Device #1 | | Device #i | | Device #j | | Device #k |
21 +-----------+ +-----------+ +-----------+ +-----------+
22 \\ // \\ //
23 +------------+ +------------+
24 | I/O Driver | | I/O Driver |
25 +------------+ +------------+
26 || ||
27 +------------------+ +------------------+
28 | Transport Driver | | Transport Driver |
29 +------------------+ +------------------+
30 \___ ___/
31 \ /
32 +----------------+
33 | HID Core |
34 +----------------+
35 / | | \
36 / | | \
37 ____________/ | | \_________________
38 / | | \
39 / | | \
40 +----------------+ +-----------+ +------------------+ +------------------+
41 | Generic Driver | | MT Driver | | Custom Driver #1 | | Custom Driver #2 |
42 +----------------+ +-----------+ +------------------+ +------------------+
43
44Example Drivers:
45 I/O: USB, I2C, Bluetooth-l2cap
46 Transport: USB-HID, I2C-HID, BT-HIDP
47
48Everything below "HID Core" is simplified in this graph as it is only of
49interest to HID device drivers. Transport drivers do not need to know the
50specifics.
51
521.1) Device Setup
53-----------------
54
55I/O drivers normally provide hotplug detection or device enumeration APIs to the
56transport drivers. Transport drivers use this to find any suitable HID device.
57They allocate HID device objects and register them with HID core. Transport
58drivers are not required to register themselves with HID core. HID core is never
59aware of which transport drivers are available and is not interested in it. It
60is only interested in devices.
61
62Transport drivers attach a constant "struct hid_ll_driver" object with each
63device. Once a device is registered with HID core, the callbacks provided via
64this struct are used by HID core to communicate with the device.
65
66Transport drivers are responsible of detecting device failures and unplugging.
67HID core will operate a device as long as it is registered regardless of any
68device failures. Once transport drivers detect unplug or failure events, they
69must unregister the device from HID core and HID core will stop using the
70provided callbacks.
71
721.2) Transport Driver Requirements
73----------------------------------
74
75The terms "asynchronous" and "synchronous" in this document describe the
76transmission behavior regarding acknowledgements. An asynchronous channel must
77not perform any synchronous operations like waiting for acknowledgements or
78verifications. Generally, HID calls operating on asynchronous channels must be
79running in atomic-context just fine.
80On the other hand, synchronous channels can be implemented by the transport
81driver in whatever way they like. They might just be the same as asynchronous
82channels, but they can also provide acknowledgement reports, automatic
83retransmission on failure, etc. in a blocking manner. If such functionality is
84required on asynchronous channels, a transport-driver must implement that via
85its own worker threads.
86
87HID core requires transport drivers to follow a given design. A Transport
88driver must provide two bi-directional I/O channels to each HID device. These
89channels must not necessarily be bi-directional in the hardware itself. A
90transport driver might just provide 4 uni-directional channels. Or it might
91multiplex all four on a single physical channel. However, in this document we
92will describe them as two bi-directional channels as they have several
93properties in common.
94
95 - Interrupt Channel (intr): The intr channel is used for asynchronous data
96 reports. No management commands or data acknowledgements are sent on this
97 channel. Any unrequested incoming or outgoing data report must be sent on
98 this channel and is never acknowledged by the remote side. Devices usually
99 send their input events on this channel. Outgoing events are normally
100 not send via intr, except if high throughput is required.
101 - Control Channel (ctrl): The ctrl channel is used for synchronous requests and
102 device management. Unrequested data input events must not be sent on this
103 channel and are normally ignored. Instead, devices only send management
104 events or answers to host requests on this channel.
105 The control-channel is used for direct blocking queries to the device
106 independent of any events on the intr-channel.
107 Outgoing reports are usually sent on the ctrl channel via synchronous
108 SET_REPORT requests.
109
110Communication between devices and HID core is mostly done via HID reports. A
111report can be of one of three types:
112
113 - INPUT Report: Input reports provide data from device to host. This
114 data may include button events, axis events, battery status or more. This
115 data is generated by the device and sent to the host with or without
116 requiring explicit requests. Devices can choose to send data continuously or
117 only on change.
118 - OUTPUT Report: Output reports change device states. They are sent from host
119 to device and may include LED requests, rumble requests or more. Output
120 reports are never sent from device to host, but a host can retrieve their
121 current state.
122 Hosts may choose to send output reports either continuously or only on
123 change.
124 - FEATURE Report: Feature reports are used for specific static device features
125 and never reported spontaneously. A host can read and/or write them to access
126 data like battery-state or device-settings.
127 Feature reports are never sent without requests. A host must explicitly set
128 or retrieve a feature report. This also means, feature reports are never sent
129 on the intr channel as this channel is asynchronous.
130
131INPUT and OUTPUT reports can be sent as pure data reports on the intr channel.