diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2016-11-28 14:41:16 -0800 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-12-03 10:06:13 +0000 |
commit | a96cd0f901eecd9589477cc2cd46bdb4f1f3e49a (patch) | |
tree | e69ecac2bcf8692050cb2ffde059c9e562fc4576 /include/linux/hid-sensor-hub.h | |
parent | 902c4b2446d468cc6e4940db1aa72ee4d144dd35 (diff) | |
download | linux-a96cd0f901eecd9589477cc2cd46bdb4f1f3e49a.tar.gz linux-a96cd0f901eecd9589477cc2cd46bdb4f1f3e49a.tar.bz2 linux-a96cd0f901eecd9589477cc2cd46bdb4f1f3e49a.zip |
iio: accel: hid-sensor-accel-3d: Add timestamp
Added timestamp channel. With this change, each sample has a timestamp.
This timestamp can be from the sensor hub when present or local kernel
timestamp. HID sensors can send timestamp with input data using usage id
HID_USAGE_SENSOR_TIME_TIMESTAMP. This timestamp value is converted to
nano seconds before pushing this sample to the iio core.
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.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index dd85f3503410..7ef111d3ecc5 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h @@ -232,6 +232,7 @@ struct hid_sensor_common { atomic_t data_ready; atomic_t user_requested_state; struct iio_trigger *trigger; + int timestamp_ns_scale; struct hid_sensor_hub_attribute_info poll; struct hid_sensor_hub_attribute_info report_state; struct hid_sensor_hub_attribute_info power_state; @@ -271,4 +272,7 @@ int hid_sensor_format_scale(u32 usage_id, s32 hid_sensor_read_poll_value(struct hid_sensor_common *st); +int64_t hid_sensor_convert_timestamp(struct hid_sensor_common *st, + int64_t raw_value); + #endif |