summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsravanM <Sravan@mindtribe.com>2016-02-03 16:54:31 -0800
committerEvan Wilson <evan@oliodevices.com>2016-02-05 17:18:19 -0800
commit8fb09182d750071c58ba7d8ee354199f74406e38 (patch)
tree7df099cb049422d931682572bb6d911e404753aa
parenta132a9028956b6f8668cefbfe65a47579f79a685 (diff)
downloadolio-linux-3.10-8fb09182d750071c58ba7d8ee354199f74406e38.tar.xz
olio-linux-3.10-8fb09182d750071c58ba7d8ee354199f74406e38.zip
Fixing the timestamp for fake events passed through the buffer. If the 6D event is pushed with a timestamp that is the current timestamp then any data previous to that(All of the fifo) will be ignored when pushed to the buffer.
Change-Id: I8857f50b26faa2dc213824c31c786606343cd500 Signed-off-by: Evan Wilson <evan@oliodevices.com>
-rw-r--r--drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c
index b89141689a1..c555927769d 100644
--- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c
+++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c
@@ -29,6 +29,8 @@
#define ST_LSM6DS3_FIFO_DATA_OUT_L 0x3e
#define ST_LSM6DS3_FIFO_DATA_OVR_2REGS 0x4000
+static int64_t last_timestamp = 0;
+
static void st_lsm6ds3_push_data_with_timestamp(struct lsm6ds3_data *cdata,
u8 index, u8 *data, int64_t timestamp)
{
@@ -154,7 +156,7 @@ void st_lsm6ds3_push_tap_to_fifo(struct lsm6ds3_data *cdata)
st_lsm6ds3_push_data_with_timestamp(
cdata, ST_INDIO_DEV_ACCEL,
fake_tap,
- cdata->accel_timestamp -1);
+ last_timestamp);
}
@@ -165,7 +167,7 @@ void st_lsm6ds3_push_d6d_to_fifo(struct lsm6ds3_data *cdata)
st_lsm6ds3_push_data_with_timestamp(
cdata, ST_INDIO_DEV_ACCEL,
d6d_signature,
- cdata->accel_timestamp -1);
+ last_timestamp);
}
@@ -221,6 +223,7 @@ void st_lsm6ds3_read_fifo(struct lsm6ds3_data *cdata, bool check_fifo_len, bool
}
}
+ last_timestamp = cdata->timestamp + 1;
read_len *= ST_LSM6DS3_BYTE_FOR_CHANNEL;
#ifdef CONFIG_ST_LSM6DS3_IIO_MASTER_SUPPORT