diff options
author | Song Hongyan <hongyan.song@intel.com> | 2017-05-07 18:24:25 +0800 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-05-07 12:22:33 +0100 |
commit | 00907c7a3282053dd4782e02c3101809608e7ea7 (patch) | |
tree | c486f6bcde38da72f616154284d8be3dcb3d38a4 /drivers | |
parent | 9ff88edc5e7bad08bdd79a20f14533a5cf44b865 (diff) | |
download | lwn-00907c7a3282053dd4782e02c3101809608e7ea7.tar.gz lwn-00907c7a3282053dd4782e02c3101809608e7ea7.zip |
iio: hid-sensor-rotation: Add geomagnetic orientation sensor hid support.
Geomagnetic orientation(AM) sensor is one kind of orientation 6dof sensor.
It gives the device rotation in respect to the earth center and the
magnetic north. The sensor is implemented through use of an accelerometer
and magnetometer do not use gyroscope. It is a standard HID sensor.
More information can be found in:
http://www.usb.org/developers/hidpage/HUTRR59_-_Usages_for_Wearables.pdf
Geomagnetic orientation(AM) sensor and dev rotation sensor have same
channel and share channel usage id. So the most of the code for relative
orientation sensor can be reused.
Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/orientation/hid-sensor-rotation.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c index 4d953c26325f..60d3517a78af 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -241,6 +241,9 @@ static int hid_dev_rot_probe(struct platform_device *pdev) case HID_USAGE_SENSOR_RELATIVE_ORIENTATION: name = "relative_orientation"; break; + case HID_USAGE_SENSOR_GEOMAGNETIC_ORIENTATION: + name = "geomagnetic_orientation"; + break; default: return -EINVAL; } @@ -339,6 +342,10 @@ static const struct platform_device_id hid_dev_rot_ids[] = { /* Relative orientation(AG) sensor */ .name = "HID-SENSOR-20008e", }, + { + /* Geomagnetic orientation(AM) sensor */ + .name = "HID-SENSOR-2000c1", + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(platform, hid_dev_rot_ids); |