Skip to content

Commit

Permalink
HID: sensor: Custom and Generic sensor support
Browse files Browse the repository at this point in the history
HID Sensor Spec defines two usage ids for custom sensors

	HID_USAGE_SENSOR_TYPE_OTHER_CUSTOM (0x09, 0xE1)
	HID_USAGE_SENSOR_TYPE_OTHER_GENERIC(0x09, 0xE2)

	In addition the standard also defines usage ids for custom fields.
The purpose of these sensors is to extend the functionality or provide a way to
obfuscate the data being communicated by a sensor. Without knowing the mapping
between the data and its encapsulated form, it is difficult for an driver to
determine what data is being communicated by the sensor.  This allows some
differentiating use cases, where vendor can provide applications.  Since these
can't be represented by standard sensor interfaces like IIO, we present these
as fields with

- type (input/output)
- units
- min/max
- get/set value

In addition an dev interface to transfer report events. Details about this
interface is described in /Documentation/hid/hid-sensor.txt.  Manufacturers
should not use these ids for any standard sensors, otherwise the the
product/vendor id can be added to black list.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Srinivas Pandruvada authored and Jiri Kosina committed Apr 10, 2015
1 parent 62fad13 commit 4a7de05
Show file tree
Hide file tree
Showing 3 changed files with 865 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,21 @@ config HID_SENSOR_HUB
for events and handle data streams. Each sensor driver can format
data and present to user mode using input or IIO interface.

config HID_SENSOR_CUSTOM_SENSOR
tristate "HID Sensors hub custom sensor support"
depends on HID_SENSOR_HUB
default n
---help---
HID Sensor hub specification allows definition of some custom and
generic sensors. Unlike other HID sensors, they can't be exported
via Linux IIO because of custom fields. This is up to the manufacturer
to decide how to interpret these special sensor ids and process in
the user space. Currently some manufacturers are using these ids for
sensor calibration and debugging other sensors. Manufacturers
should't use these special custom sensor ids to export any of the
standard sensors.
Select this config option for custom/generic sensor support.

endmenu

endif # HID
Expand Down
1 change: 1 addition & 0 deletions drivers/hid/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ obj-$(CONFIG_HID_WACOM) += wacom.o
obj-$(CONFIG_HID_WALTOP) += hid-waltop.o
obj-$(CONFIG_HID_WIIMOTE) += hid-wiimote.o
obj-$(CONFIG_HID_SENSOR_HUB) += hid-sensor-hub.o
obj-$(CONFIG_HID_SENSOR_CUSTOM_SENSOR) += hid-sensor-custom.o

obj-$(CONFIG_USB_HID) += usbhid/
obj-$(CONFIG_USB_MOUSE) += usbhid/
Expand Down
Loading

0 comments on commit 4a7de05

Please sign in to comment.