summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsravanM <Sravan@mindtribe.com>2016-02-05 14:43:06 -0800
committerEvan Wilson <evan@oliodevices.com>2016-03-18 13:35:58 -0700
commit19f19a217a28d5d593cba696b361a196605aaa01 (patch)
tree945adbeeac3eef009b8c8280221b3a183f48d43c
parent816e93427dcca7eca8381a5807a4b53e029b6e2d (diff)
downloadolio-linux-3.10-19f19a217a28d5d593cba696b361a196605aaa01.tar.xz
olio-linux-3.10-19f19a217a28d5d593cba696b361a196605aaa01.zip
accounting for LSB
Change-Id: If9bb8fd7784b1143848e07a507c2b00e67f9b0f7 Signed-off-by: Evan Wilson <evan@oliodevices.com>
-rw-r--r--drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c
index 00948755125..089a28fde8c 100644
--- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c
+++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c
@@ -802,8 +802,10 @@ int st_lsm6ds3_set_fifo_decimators_and_threshold(struct lsm6ds3_data *cdata)
if (fifo_len > 0) {
fifo_threshold = fifo_len / 2;
- if(fifo_threshold > cdata->min_latency_samples * ST_LSM6DS3_FIFO_ELEMENT_LEN_BYTE)
+ if(fifo_threshold > cdata->min_latency_samples * ST_LSM6DS3_FIFO_ELEMENT_LEN_BYTE){
fifo_threshold = cdata->min_latency_samples * ST_LSM6DS3_FIFO_ELEMENT_LEN_BYTE;
+ fifo_threshold /= 2; //LSB of the register is 1 word
+ }
dev_info(cdata->dev,"setting FIFO length/threshold: 0x%x 0x%x ", fifo_len, fifo_threshold);