diff options
author | Song Hongyan <hongyan.song@intel.com> | 2017-03-20 10:12:54 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-03-25 17:25:11 +0100 |
commit | e0ad9b73e81a2dfb8cf8b375fefbb0891a8187a1 (patch) | |
tree | 5b1a8d49f760bd3c7854189cd025c38847e49769 /drivers/iio | |
parent | iio:light: Add support for STMicro VL6180 sensor (diff) | |
download | linux-e0ad9b73e81a2dfb8cf8b375fefbb0891a8187a1.tar.xz linux-e0ad9b73e81a2dfb8cf8b375fefbb0891a8187a1.zip |
iio: hid-sensor-attributes: Fix gravity sensor scale value not right issue
Scale value include two parts: unit conversion and exponent conversion.
Add gravity unit convert table to fix gravity sensor scale value not
right issue.
Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c index 9338f94ce1dc..cfb2fdc3177f 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c @@ -38,6 +38,12 @@ static struct { {HID_USAGE_SENSOR_ACCEL_3D, HID_USAGE_SENSOR_UNITS_G, 9, 806650000}, + {HID_USAGE_SENSOR_GRAVITY_VECTOR, 0, 9, 806650000}, + {HID_USAGE_SENSOR_GRAVITY_VECTOR, + HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0}, + {HID_USAGE_SENSOR_GRAVITY_VECTOR, + HID_USAGE_SENSOR_UNITS_G, 9, 806650000}, + {HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293}, {HID_USAGE_SENSOR_GYRO_3D, HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0}, |