summaryrefslogtreecommitdiff
path: root/driver/accelgyro_lsm6dso.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-09-09 14:36:39 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-10 22:05:16 +0000
commit155d8545cab4fad0718485c37fcf8eeb5948f3f2 (patch)
treeb118e199ce8a15a7c296ec9c3d0ba695b16742dc /driver/accelgyro_lsm6dso.c
parent917fb7fbd7a3681067d171fb385bb77de31f3ab6 (diff)
downloadchrome-ec-155d8545cab4fad0718485c37fcf8eeb5948f3f2.tar.gz
driver: lsm6dso: Minor macro changes
Rename LSM6DSO_FIFO_ODR_TO_REG into LSM6DSO_FIFO_ODR_MASK as the macro return the mask to use to set the FIFO ODR. Remove CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ in code, as already used in LSM6DSO_ODR_MAX_VAL. Simplify LSM6DSO_ST_DATA by using . instead of ->. BUG=none BRANCH=deded TEST=buildall Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I4253368415635c858ce181f228591e8bf93eacb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150678 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
Diffstat (limited to 'driver/accelgyro_lsm6dso.c')
-rw-r--r--driver/accelgyro_lsm6dso.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/driver/accelgyro_lsm6dso.c b/driver/accelgyro_lsm6dso.c
index a23ea2c393..ca4d85edb8 100644
--- a/driver/accelgyro_lsm6dso.c
+++ b/driver/accelgyro_lsm6dso.c
@@ -208,7 +208,7 @@ static int accelgyro_config_fifo(const struct motion_sensor_t *s)
*/
samples_to_discard[s->type] = LSM6DSO_DISCARD_SAMPLES;
- fifo_odr_mask = LSM6DSO_FIFO_ODR_TO_REG(s);
+ fifo_odr_mask = LSM6DSO_FIFO_ODR_MASK(s);
reg_val = LSM6DSO_ODR_TO_REG(data->base.odr);
err = st_write_data_with_mask(s, LSM6DSO_FIFO_CTRL3_ADDR,
fifo_odr_mask, reg_val);
@@ -333,8 +333,7 @@ static int set_data_rate(const struct motion_sensor_t *s, int rate, int rnd)
}
if (normalized_rate < LSM6DSO_ODR_MIN_VAL ||
- normalized_rate > MIN(LSM6DSO_ODR_MAX_VAL,
- CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ))
+ normalized_rate > LSM6DSO_ODR_MAX_VAL)
return EC_RES_INVALID_PARAM;
}