diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2021-09-09 14:36:39 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-10 22:05:16 +0000 |
commit | 155d8545cab4fad0718485c37fcf8eeb5948f3f2 (patch) | |
tree | b118e199ce8a15a7c296ec9c3d0ba695b16742dc /driver/accelgyro_lsm6dso.h | |
parent | 917fb7fbd7a3681067d171fb385bb77de31f3ab6 (diff) | |
download | chrome-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.h')
-rw-r--r-- | driver/accelgyro_lsm6dso.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/accelgyro_lsm6dso.h b/driver/accelgyro_lsm6dso.h index a823fe7e61..a786f5adf0 100644 --- a/driver/accelgyro_lsm6dso.h +++ b/driver/accelgyro_lsm6dso.h @@ -128,7 +128,7 @@ struct lsm6dso_fstatus { /* ODR reg value from selected data rate in mHz */ #define LSM6DSO_ODR_TO_REG(_odr) (__fls(_odr / LSM6DSO_ODR_MIN_VAL) + 1) -#define LSM6DSO_FIFO_ODR_TO_REG(_s) \ +#define LSM6DSO_FIFO_ODR_MASK(_s) \ (_s->type == MOTIONSENSE_TYPE_ACCEL ? LSM6DSO_FIFO_ODR_XL_MASK : \ LSM6DSO_FIFO_ODR_G_MASK) @@ -221,7 +221,7 @@ struct lsm6dso_data { #define LSM6DSO_GET_DATA(_s) ((struct stprivate_data *)((_s)->drv_data)) /* Macro to initialize motion_sensors structure */ -#define LSM6DSO_ST_DATA(g, type) (&(&(g))->st_data[(type)]) +#define LSM6DSO_ST_DATA(g, type) (&((g).st_data[type])) #define LSM6DSO_MAIN_SENSOR(_s) ((_s) - (_s)->type) extern const struct accelgyro_drv lsm6dso_drv; |