mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 15:01:44 +00:00
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>
This commit is contained in:
parent
c7eeea93ac
commit
5d02edfc39
2 changed files with 118 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue