diff options
| author | sravanM <Sravan@mindtribe.com> | 2016-02-05 14:43:06 -0800 |
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2016-02-19 01:06:58 -0800 |
| commit | 766bce30f9720d1b1fd6cd6d170f3581662596de (patch) | |
| tree | 84bd2b7f7fdf02976ec9ea3314056b6e474b4b7d | |
| parent | ccffdb0505e82210ff26c0e10611f8f7413e6be8 (diff) | |
| download | olio-linux-3.10-766bce30f9720d1b1fd6cd6d170f3581662596de.tar.xz olio-linux-3.10-766bce30f9720d1b1fd6cd6d170f3581662596de.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 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); |