diff options
author | Yuval Peress <peress@chromium.org> | 2021-04-15 10:55:25 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-16 22:32:27 +0000 |
commit | a2b75b36ebfeaf5f344e03e1c0ee0b77c11e82de (patch) | |
tree | faa28631546a204f7f718b63173c36046830b269 /zephyr/Kconfig.accelgyro_bmi | |
parent | 7ffc631e080dde6741580ecf217e9565ad791a71 (diff) | |
download | chrome-ec-a2b75b36ebfeaf5f344e03e1c0ee0b77c11e82de.tar.gz |
driver: bmi: fix use of I2C_PORT_ACCEL
The BMI driver is currently using I2C_PORT_ACCEL incorrectly as a
CONFIG_ value.
Update the use cases to a new config option that selects between SPI
and I2C communication specifically for the chip. To avoid a lot of
device.h changes, the value of the config value is automatically
inferred if not explicitly set.
BRANCH=none
BUG=b:185392974, b:146065507
TEST=zmake testall
TEST=make buildall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I6196cc595dc61877ab2b8ed5416bebee51276927
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829010
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.accelgyro_bmi')
-rw-r--r-- | zephyr/Kconfig.accelgyro_bmi | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/zephyr/Kconfig.accelgyro_bmi b/zephyr/Kconfig.accelgyro_bmi new file mode 100644 index 0000000000..bb8239f6d8 --- /dev/null +++ b/zephyr/Kconfig.accelgyro_bmi @@ -0,0 +1,33 @@ +# Copyright 2021 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + + +if PLATFORM_EC_ACCELGYRO_BMI +menu "BMI Sensor Common" + +choice PLATFORM_EC_ACCELGYRO_BMI_COMM + prompt "Accelgyro BMI's communication mode" + help + When using the BMI drivers, there's the option to communicate with the + chip via several methods. This choice helps improve code size by only + compiling the needed communication channels. + +config PLATFORM_EC_ACCELGYRO_BMI_COMM_SPI + bool "Use SPI communication" + help + The BMI chip is using SPI communication. This config value is used to + save on code size as only the SPI communication code will be included + for the BMI chip. + +config PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C + bool "Use I2C communication" + help + The BMI chip is using I2C communication. This config value is used to + save on code size as only the I2C communication code will be included + for the BMI chip. + +endchoice + +endmenu # BMI Sensor +endif # PLATFORM_EC_ACCELGYRO_BMI
\ No newline at end of file |