aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/hid-sensor-hub.h
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2014-04-19 00:22:00 +0100
committerJonathan Cameron <jic23@kernel.org>2014-05-05 10:59:44 +0100
commit5d02edfc3957446fd625c0b018e14c6631a791f4 (patch)
tree3601d52baa45ff006e6bf7b2d13436c8046fa71e /include/linux/hid-sensor-hub.h
parentiio: Add Freescale MMA8452Q 3-axis accelerometer driver (diff)
downloadwireguard-linux-5d02edfc3957446fd625c0b018e14c6631a791f4.tar.xz
wireguard-linux-5d02edfc3957446fd625c0b018e14c6631a791f4.zip
iio: hid-sensors: Convert units and exponent
HID sensor hub specify a default unit and alternative units. This along with unit exponent can be used adjust scale. This change change HID sensor data units to IIO defined units for each sensor type. So in this way user space can use a simply use: "(data + offset) * scale" to get final result. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/hid-sensor-hub.h')
-rw-r--r--include/linux/hid-sensor-hub.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index b70cfd7ff29c..89626b23c246 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -223,4 +223,8 @@ int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st,
int hid_sensor_get_usage_index(struct hid_sensor_hub_device *hsdev,
u32 report_id, int field_index, u32 usage_id);
+int hid_sensor_format_scale(u32 usage_id,
+ struct hid_sensor_hub_attribute_info *attr_info,
+ int *val0, int *val1);
+
#endif