summaryrefslogtreecommitdiff
path: root/driver/accelgyro_bmi260.c
diff options
context:
space:
mode:
authorChing-Kang Yen <chingkang@chromium.org>2020-07-30 17:37:08 +0800
committerCommit Bot <commit-bot@chromium.org>2020-09-03 07:15:38 +0000
commit90c79d90699268d31a3a2d8f48af5955e493005b (patch)
treed6b16ac11119d1fd117ef5279ddf40e27da6cc79 /driver/accelgyro_bmi260.c
parente9d86fc334f71d6f0daf44f9bc0f9ee311620095 (diff)
downloadchrome-ec-90c79d90699268d31a3a2d8f48af5955e493005b.tar.gz
driver: bmi: add get_rms_noise() for body detection
We will need the amount of noise for body detection. The amount of noise in accelometer will depends on several thing, e.g., output data rate. Add get_rms_noise() function to get the root mean square of noise in BMI. BRANCH=None BUG=b:123434029 TEST=buildall Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: Ia56bbd2cdb36bee771beb9df32451d3e56f4f028 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2329112 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Heng-ruey Hsu <henryhsu@chromium.org>
Diffstat (limited to 'driver/accelgyro_bmi260.c')
-rw-r--r--driver/accelgyro_bmi260.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/driver/accelgyro_bmi260.c b/driver/accelgyro_bmi260.c
index 6eeb80cb04..cd75de2d9d 100644
--- a/driver/accelgyro_bmi260.c
+++ b/driver/accelgyro_bmi260.c
@@ -565,6 +565,9 @@ const struct accelgyro_drv bmi260_drv = {
#ifdef CONFIG_ACCEL_INTERRUPTS
.irq_handler = irq_handler,
#endif
+#ifdef CONFIG_BODY_DETECTION
+ .get_rms_noise = bmi_get_rms_noise,
+#endif
};
#ifdef CONFIG_CMD_I2C_STRESS_TEST_ACCEL