summaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer/ak8975.c
diff options
context:
space:
mode:
authorGregor Boirie <gregor.boirie@parrot.com>2016-03-09 19:05:49 +0100
committerJonathan Cameron <jic23@kernel.org>2016-06-30 19:41:38 +0100
commitbc2b7dab629a51e8beb5fda4222c62a23b729f26 (patch)
tree302108fe801299d98882e8d506b4415746408374 /drivers/iio/magnetometer/ak8975.c
parenteaaa7ec71bff4cb34d9025ed89068d4b3cac3df0 (diff)
downloadblackbird-op-linux-bc2b7dab629a51e8beb5fda4222c62a23b729f26.tar.gz
blackbird-op-linux-bc2b7dab629a51e8beb5fda4222c62a23b729f26.zip
iio:core: timestamping clock selection support
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow userspace to select a particular POSIX clock for buffered samples and events timestamping. Following clocks, as listed in clock_gettime(2), are supported: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and CLOCK_TAI. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/magnetometer/ak8975.c')
-rw-r--r--drivers/iio/magnetometer/ak8975.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 57d3654d7caf..2121b50ab9b3 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -829,7 +829,8 @@ static void ak8975_fill_buffer(struct iio_dev *indio_dev)
buff[1] = clamp_t(s16, le16_to_cpu(buff[1]), -def->range, def->range);
buff[2] = clamp_t(s16, le16_to_cpu(buff[2]), -def->range, def->range);
- iio_push_to_buffers_with_timestamp(indio_dev, buff, iio_get_time_ns());
+ iio_push_to_buffers_with_timestamp(indio_dev, buff,
+ iio_get_time_ns(indio_dev));
return;
unlock:
OpenPOWER on IntegriCloud