diff options
author | Gregor Boirie <gregor.boirie@parrot.com> | 2016-03-09 13:05:49 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-06-30 14:41:38 -0400 |
commit | bc2b7dab629a51e8beb5fda4222c62a23b729f26 (patch) | |
tree | 302108fe801299d98882e8d506b4415746408374 /drivers/iio/gyro/bmg160_core.c | |
parent | eaaa7ec71bff4cb34d9025ed89068d4b3cac3df0 (diff) |
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/gyro/bmg160_core.c')
-rw-r--r-- | drivers/iio/gyro/bmg160_core.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 7ccc044063f6..8155251d9984 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c | |||
@@ -885,25 +885,25 @@ static irqreturn_t bmg160_event_handler(int irq, void *private) | |||
885 | 885 | ||
886 | if (val & BMG160_ANY_MOTION_BIT_X) | 886 | if (val & BMG160_ANY_MOTION_BIT_X) |
887 | iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, | 887 | iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, |
888 | 0, | 888 | 0, |
889 | IIO_MOD_X, | 889 | IIO_MOD_X, |
890 | IIO_EV_TYPE_ROC, | 890 | IIO_EV_TYPE_ROC, |
891 | dir), | 891 | dir), |
892 | iio_get_time_ns()); | 892 | iio_get_time_ns(indio_dev)); |
893 | if (val & BMG160_ANY_MOTION_BIT_Y) | 893 | if (val & BMG160_ANY_MOTION_BIT_Y) |
894 | iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, | 894 | iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, |
895 | 0, | 895 | 0, |
896 | IIO_MOD_Y, | 896 | IIO_MOD_Y, |
897 | IIO_EV_TYPE_ROC, | 897 | IIO_EV_TYPE_ROC, |
898 | dir), | 898 | dir), |
899 | iio_get_time_ns()); | 899 | iio_get_time_ns(indio_dev)); |
900 | if (val & BMG160_ANY_MOTION_BIT_Z) | 900 | if (val & BMG160_ANY_MOTION_BIT_Z) |
901 | iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, | 901 | iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, |
902 | 0, | 902 | 0, |
903 | IIO_MOD_Z, | 903 | IIO_MOD_Z, |
904 | IIO_EV_TYPE_ROC, | 904 | IIO_EV_TYPE_ROC, |
905 | dir), | 905 | dir), |
906 | iio_get_time_ns()); | 906 | iio_get_time_ns(indio_dev)); |
907 | 907 | ||
908 | ack_intr_status: | 908 | ack_intr_status: |
909 | if (!data->dready_trigger_on) { | 909 | if (!data->dready_trigger_on) { |