diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2022-08-26 13:30:14 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-31 21:10:25 +0000 |
commit | c23f9e0555391bde6bbffad271913a926d6d8414 (patch) | |
tree | 0ce95390486eecc9f78316d28fbb48d9f7e55b23 /include | |
parent | 13a94b26a34077b2cc403386b2f398cec69ce2b0 (diff) | |
download | chrome-ec-c23f9e0555391bde6bbffad271913a926d6d8414.tar.gz |
driver: bmi: Enable On/Off body detection on all BMI IMU
Define a common function for setting the rms noise floor.
Use static function per sensor to set the proper floor.
BUG=b:236799854
BRANCH=dedede
TEST=Compile
Change-Id: I18e228fd98cb230a77d435f3865c8b249162a4bc
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3860188
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/driver/accelgyro_bmi_common.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/driver/accelgyro_bmi_common.h b/include/driver/accelgyro_bmi_common.h index 5647d8776d..bc82e8aba2 100644 --- a/include/driver/accelgyro_bmi_common.h +++ b/include/driver/accelgyro_bmi_common.h @@ -131,9 +131,6 @@ enum bmi_running_mode { (BMI160_CMD_REG + (v) * (BMI260_CMD_REG - BMI160_CMD_REG)) #define BMI_CMD_FIFO_FLUSH 0xb0 -#define BMI_ACCEL_RMS_NOISE_100HZ(v) \ - (BMI160_ACCEL_RMS_NOISE_100HZ + \ - (v) * (BMI260_ACCEL_RMS_NOISE_100HZ - BMI160_ACCEL_RMS_NOISE_100HZ)) #define BMI_ACCEL_100HZ 100 /* @@ -272,9 +269,8 @@ int bmi_get_offset(const struct motion_sensor_t *s, int16_t *offset, int bmi_get_resolution(const struct motion_sensor_t *s); -#ifdef CONFIG_BODY_DETECTION -int bmi_get_rms_noise(const struct motion_sensor_t *s); -#endif +int bmi_get_rms_noise(const struct motion_sensor_t *accel, + int rms_noise_100hz_mg); int bmi_set_scale(const struct motion_sensor_t *s, const uint16_t *scale, int16_t temp); |