diff options
| author | sravanM <Sravan@mindtribe.com> | 2016-02-05 14:43:06 -0800 |
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2016-02-05 17:19:36 -0800 |
| commit | 501c111940293b006c0d83986223233aef71883a (patch) | |
| tree | 0486b268a6dd409e3e3423e024f946d475a1b3bc | |
| parent | e36446b28f9cd527e0a86db588c93a6440aa354e (diff) | |
| download | olio-linux-3.10-501c111940293b006c0d83986223233aef71883a.tar.xz olio-linux-3.10-501c111940293b006c0d83986223233aef71883a.zip | |
accounting for LSB
Change-Id: Iec76ffa7029013bae546e9b3c1fdaa0127d02a30
Signed-off-by: Evan Wilson <evan@oliodevices.com>
| -rw-r--r-- | drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c | 4 |
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 20fed875f3b..88c596ce01c 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); |