diff options
author | Ching-Kang Yen <chingkang@chromium.org> | 2020-03-31 19:10:36 +0800 |
---|---|---|
committer | Ching-Kang Yen <chingkang@chromium.org> | 2020-04-23 13:42:42 +0000 |
commit | 86be30f5c4220112c6303c176f12096151285515 (patch) | |
tree | cfeeb602160484cfd88b29ddaaf741ac1e09d9e8 /driver/mag_bmm150.h | |
parent | 246044881c894aac0f552e5218b8207f74d105f7 (diff) | |
download | chrome-ec-86be30f5c4220112c6303c176f12096151285515.tar.gz |
driver: Add BMI common code
Add accelgyro_bmi_common.(c/h) for the code shared among the BMI.
BRANCH=None
BUG=b:146144827
TEST=make -j4 BOARD=ampton
Then, flash the ec.bin into DUT, check sensor data is available on DUT
by "ectool motionsense".
TEST=make buildall -j
Change-Id: Ia56ffb0896943b08640b3d6ca96324ac5e7d93a0
Signed-off-by: Ching-Kang Yen <chingkang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130146
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'driver/mag_bmm150.h')
-rw-r--r-- | driver/mag_bmm150.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/driver/mag_bmm150.h b/driver/mag_bmm150.h index 79c77e66d7..f97d2a8882 100644 --- a/driver/mag_bmm150.h +++ b/driver/mag_bmm150.h @@ -112,20 +112,21 @@ struct bmm150_private_data { struct mag_cal_t cal; struct bmm150_comp_registers comp; }; + +#ifdef CONFIG_MAG_BMI_BMM150 +#include "accelgyro_bmi_common.h" + #define BMM150_COMP_REG(_s) \ - (&BMI160_GET_DATA(_s)->compass.comp) + (&BMI_GET_DATA(_s)->compass.comp) #define BMM150_CAL(_s) \ - (&BMI160_GET_DATA(_s)->compass.cal) - -#ifdef CONFIG_MAG_BMI160_BMM150 -#include "accelgyro_bmi160.h" + (&BMI_GET_DATA(_s)->compass.cal) /* - * Behind a BMI160, the BMM150 is in forced mode. Be sure to choose a frequency - * comptible with BMI160. + * Behind a BMI, the BMM150 is in forced mode. Be sure to choose a frequency + * compatible with BMI. */ #define BMM150_MAG_MAX_FREQ(_preset) \ - BMI160_REG_TO_ODR(BMI160_ODR_TO_REG(__BMM150_MAG_MAX_FREQ(_preset))) + BMI_REG_TO_ODR(BMI_ODR_TO_REG(__BMM150_MAG_MAX_FREQ(_preset))) #else #define BMM150_MAG_MAX_FREQ(_preset) __BMM150_MAG_MAX_FREQ(_preset) #endif |