summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsravanM <Sravan@mindtribe.com>2016-02-03 16:54:31 -0800
committerEvan Wilson <evan@oliodevices.com>2016-02-19 01:06:57 -0800
commit359b553919daefd147de71afcf586548b3b5ed43 (patch)
treed600d6767595dad4fe8e2acbdb2d1ae9b11f94b9
parentd3648993f6f8e604a328a34c36f39178e4b9875f (diff)
downloadolio-linux-3.10-359b553919daefd147de71afcf586548b3b5ed43.tar.xz
olio-linux-3.10-359b553919daefd147de71afcf586548b3b5ed43.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