Skip to content

Commit def7cb8

Browse files
committed
Merge tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging tree update from Greg Kroah-Hartman: "Here is the big staging tree update for the 3.7-rc1 merge window. There are a few patches in here that are outside of the staging area, namely HID and IIO patches, but all of them have been acked by the relevant subsystem maintainers. The IIO stuff is still coming in through this tree as it hasn't entirely moved out of the staging tree, but is almost there. Other than that, there wa a ton of work on the comedi drivers to make them more readable and the correct style. Doing that removed a lot of code, but we added a new driver to the staging tree, so we didn't end up with a net reduction this time around: 662 files changed, 51649 insertions(+), 26582 deletions(-) All of these patches have been in the linux-next tree already. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1094 commits) staging: comedi: jr3_pci: fix iomem dereference staging: comedi: drivers: use comedi_fc.h cmdtest helpers Staging: winbond: usb_free_urb(NULL) is safe Staging: winbond: checkpatch cleanup Staging: winbond: Removed undesired spaces, lines and tabs Staging: winbond: Typo corrections in comments Staging: winbond: Changed c99 comments to c89 comments staging: r8712u: Do not queue cloned skb staging: comedi: ni_mio_common: always lock in ni_ai_poll() staging: comedi: s626: add FIXME comment staging: comedi: s626: don't dereference insn->data staging: comedi: s526: fix if() check in s526_gpct_winsn() staging: comedi: s626: cleanup comments in s626_initialize() staging: comedi: s626: remove clear of kzalloc'ed data staging: comedi: s626: remove 'WDInterval' from private data staging: comedi: s626: remove 'ChargeEnabled' from private data staging: comedi: s626: remove 'IsBoardRevA' comment staging: comedi: s626: #if 0 out the "SAA7146 BUG WORKAROUND" staging: comedi: s626: remove 'allocatedBuf' from private data staging: comedi: s626: add final attach message ...
2 parents 06d2fe1 + e187895 commit def7cb8

File tree

662 files changed

+51649
-26582
lines changed

Some content is hidden

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

662 files changed

+51649
-26582
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* Freescale i.MX28 LRADC device driver
2+
3+
Required properties:
4+
- compatible: Should be "fsl,imx28-lradc"
5+
- reg: Address and length of the register set for the device
6+
- interrupts: Should contain the LRADC interrupts
7+
8+
Examples:
9+
10+
lradc@80050000 {
11+
compatible = "fsl,imx28-lradc";
12+
reg = <0x80050000 0x2000>;
13+
interrupts = <10 14 15 16 17 18 19
14+
20 21 22 23 24 25>;
15+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Freescale i.MX IPUv3
2+
====================
3+
4+
Required properties:
5+
- compatible: Should be "fsl,<chip>-ipu"
6+
- reg: should be register base and length as documented in the
7+
datasheet
8+
- interrupts: Should contain sync interrupt and error interrupt,
9+
in this order.
10+
- #crtc-cells: 1, See below
11+
12+
example:
13+
14+
ipu: ipu@18000000 {
15+
#crtc-cells = <1>;
16+
compatible = "fsl,imx53-ipu";
17+
reg = <0x18000000 0x080000000>;
18+
interrupts = <11 10>;
19+
};
20+
21+
Parallel display support
22+
========================
23+
24+
Required properties:
25+
- compatible: Should be "fsl,imx-parallel-display"
26+
- crtc: the crtc this display is connected to, see below
27+
Optional properties:
28+
- interface_pix_fmt: How this display is connected to the
29+
crtc. Currently supported types: "rgb24", "rgb565"
30+
- edid: verbatim EDID data block describing attached display.
31+
- ddc: phandle describing the i2c bus handling the display data
32+
channel
33+
34+
example:
35+
36+
display@di0 {
37+
compatible = "fsl,imx-parallel-display";
38+
edid = [edid-data];
39+
crtc = <&ipu 0>;
40+
interface-pix-fmt = "rgb24";
41+
};

Documentation/hid/hid-sensor.txt

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
2+
HID Sensors Framework
3+
======================
4+
HID sensor framework provides necessary interfaces to implement sensor drivers,
5+
which are connected to a sensor hub. The sensor hub is a HID device and it provides
6+
a report descriptor conforming to HID 1.12 sensor usage tables.
7+
8+
Description from the HID 1.12 "HID Sensor Usages" specification:
9+
"Standardization of HID usages for sensors would allow (but not require) sensor
10+
hardware vendors to provide a consistent Plug And Play interface at the USB boundary,
11+
thereby enabling some operating systems to incorporate common device drivers that
12+
could be reused between vendors, alleviating any need for the vendors to provide
13+
the drivers themselves."
14+
15+
This specification describes many usage IDs, which describe the type of sensor
16+
and also the individual data fields. Each sensor can have variable number of
17+
data fields. The length and order is specified in the report descriptor. For
18+
example a part of report descriptor can look like:
19+
20+
INPUT(1)[INPUT]
21+
..
22+
Field(2)
23+
Physical(0020.0073)
24+
Usage(1)
25+
0020.045f
26+
Logical Minimum(-32767)
27+
Logical Maximum(32767)
28+
Report Size(8)
29+
Report Count(1)
30+
Report Offset(16)
31+
Flags(Variable Absolute)
32+
..
33+
..
34+
35+
The report is indicating "sensor page (0x20)" contains an accelerometer-3D (0x73).
36+
This accelerometer-3D has some fields. Here for example field 2 is motion intensity
37+
(0x045f) with a logical minimum value of -32767 and logical maximum of 32767. The
38+
order of fields and length of each field is important as the input event raw
39+
data will use this format.
40+
41+
42+
Implementation
43+
=================
44+
45+
This specification defines many different types of sensors with different sets of
46+
data fields. It is difficult to have a common input event to user space applications,
47+
for different sensors. For example an accelerometer can send X,Y and Z data, whereas
48+
an ambient light sensor can send illumination data.
49+
So the implementation has two parts:
50+
- Core hid driver
51+
- Individual sensor processing part (sensor drivers)
52+
53+
Core driver
54+
-----------
55+
The core driver registers (hid-sensor-hub) registers as a HID driver. It parses
56+
report descriptors and identifies all the sensors present. It adds an MFD device
57+
with name HID-SENSOR-xxxx (where xxxx is usage id from the specification).
58+
For example
59+
HID-SENSOR-200073 is registered for an Accelerometer 3D driver.
60+
So if any driver with this name is inserted, then the probe routine for that
61+
function will be called. So an accelerometer processing driver can register
62+
with this name and will be probed if there is an accelerometer-3D detected.
63+
64+
The core driver provides a set of APIs which can be used by the processing
65+
drivers to register and get events for that usage id. Also it provides parsing
66+
functions, which get and set each input/feature/output report.
67+
68+
Individual sensor processing part (sensor drivers)
69+
-----------
70+
The processing driver will use an interface provided by the core driver to parse
71+
the report and get the indexes of the fields and also can get events. This driver
72+
can use IIO interface to use the standard ABI defined for a type of sensor.
73+
74+
75+
Core driver Interface
76+
=====================
77+
78+
Callback structure:
79+
Each processing driver can use this structure to set some callbacks.
80+
int (*suspend)(..): Callback when HID suspend is received
81+
int (*resume)(..): Callback when HID resume is received
82+
int (*capture_sample)(..): Capture a sample for one of its data fields
83+
int (*send_event)(..): One complete event is received which can have
84+
multiple data fields.
85+
86+
Registration functions:
87+
int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
88+
u32 usage_id,
89+
struct hid_sensor_hub_callbacks *usage_callback):
90+
91+
Registers callbacks for an usage id. The callback functions are not allowed
92+
to sleep.
93+
94+
95+
int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
96+
u32 usage_id):
97+
98+
Removes callbacks for an usage id.
99+
100+
101+
Parsing function:
102+
int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
103+
u8 type,
104+
u32 usage_id, u32 attr_usage_id,
105+
struct hid_sensor_hub_attribute_info *info);
106+
107+
A processing driver can look for some field of interest and check if it exists
108+
in a report descriptor. If it exists it will store necessary information
109+
so that fields can be set or get individually.
110+
These indexes avoid searching every time and getting field index to get or set.
111+
112+
113+
Set Feature report
114+
int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
115+
u32 field_index, s32 value);
116+
117+
This interface is used to set a value for a field in feature report. For example
118+
if there is a field report_interval, which is parsed by a call to
119+
sensor_hub_input_get_attribute_info before, then it can directly set that individual
120+
field.
121+
122+
123+
int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
124+
u32 field_index, s32 *value);
125+
126+
This interface is used to get a value for a field in input report. For example
127+
if there is a field report_interval, which is parsed by a call to
128+
sensor_hub_input_get_attribute_info before, then it can directly get that individual
129+
field value.
130+
131+
132+
int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
133+
u32 usage_id,
134+
u32 attr_usage_id, u32 report_id);
135+
136+
This is used to get a particular field value through input reports. For example
137+
accelerometer wants to poll X axis value, then it can call this function with
138+
the usage id of X axis. HID sensors can provide events, so this is not necessary
139+
to poll for any field. If there is some new sample, the core driver will call
140+
registered callback function to process the sample.

drivers/hid/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,20 @@ config HID_ZYDACRON
708708
---help---
709709
Support for Zydacron remote control.
710710

711+
config HID_SENSOR_HUB
712+
tristate "HID Sensors framework support"
713+
depends on USB_HID
714+
select MFD_CORE
715+
default n
716+
-- help---
717+
Support for HID Sensor framework. This creates a MFD instance
718+
for a sensor hub and identifies all the sensors connected to it.
719+
Each sensor is registered as a MFD cell, so that sensor specific
720+
processing can be done in a separate driver. Each sensor
721+
drivers can use the service provided by this driver to register
722+
for events and handle data streams. Each sensor driver can format
723+
data and present to user mode using input or IIO interface.
724+
711725
endmenu
712726

713727
endif # HID

drivers/hid/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ obj-$(CONFIG_HID_ZYDACRON) += hid-zydacron.o
112112
obj-$(CONFIG_HID_WACOM) += hid-wacom.o
113113
obj-$(CONFIG_HID_WALTOP) += hid-waltop.o
114114
obj-$(CONFIG_HID_WIIMOTE) += hid-wiimote.o
115+
obj-$(CONFIG_HID_SENSOR_HUB) += hid-sensor-hub.o
115116

116117
obj-$(CONFIG_USB_HID) += usbhid/
117118
obj-$(CONFIG_USB_MOUSE) += usbhid/

drivers/hid/hid-core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,10 @@ static const struct hid_device_id hid_have_special_driver[] = {
15681568
{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
15691569
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
15701570
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
1571+
{ HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8086, USB_DEVICE_ID_SENSOR_HUB_1020) },
1572+
{ HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8086, USB_DEVICE_ID_SENSOR_HUB_09FA) },
1573+
{ HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8087, USB_DEVICE_ID_SENSOR_HUB_1020) },
1574+
{ HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8087, USB_DEVICE_ID_SENSOR_HUB_09FA) },
15711575
{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
15721576
{ HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
15731577
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
@@ -1665,6 +1669,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
16651669
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
16661670
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
16671671
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
1672+
{ HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_SENSOR_HUB_7014) },
16681673
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
16691674
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
16701675
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) },

drivers/hid/hid-ids.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@
429429
#define USB_VENDOR_ID_IMATION 0x0718
430430
#define USB_DEVICE_ID_DISC_STAKKA 0xd000
431431

432+
#define USB_VENDOR_ID_INTEL_8086 0x8086
433+
#define USB_VENDOR_ID_INTEL_8087 0x8087
434+
#define USB_DEVICE_ID_SENSOR_HUB_1020 0x1020
435+
#define USB_DEVICE_ID_SENSOR_HUB_09FA 0x09FA
436+
432437
#define USB_VENDOR_ID_IRTOUCHSYSTEMS 0x6615
433438
#define USB_DEVICE_ID_IRTOUCH_INFRARED_USB 0x0070
434439

@@ -706,6 +711,7 @@
706711

707712
#define USB_VENDOR_ID_STANTUM_STM 0x0483
708713
#define USB_DEVICE_ID_MTP_STM 0x3261
714+
#define USB_DEVICE_ID_SENSOR_HUB_7014 0x7014
709715

710716
#define USB_VENDOR_ID_STANTUM_SITRONIX 0x1403
711717
#define USB_DEVICE_ID_MTP_SITRONIX 0x5001

0 commit comments

Comments
 (0)