summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.accelgyro_icm
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-04-15 00:32:57 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-16 22:32:26 +0000
commit7ffc631e080dde6741580ecf217e9565ad791a71 (patch)
treec59ed3c07ed80d8af65b3d2740f5dc95e309d9ce /zephyr/Kconfig.accelgyro_icm
parent1bfa6a7da4017b0c86d21cda2de70fb31d87ffc7 (diff)
downloadchrome-ec-7ffc631e080dde6741580ecf217e9565ad791a71.tar.gz
driver: icm: fix use of I2C_PORT_ACCEL
The ICM 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: I8b1a507a76031c2bb1aaf4ca7b14b92252a941f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2826920 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.accelgyro_icm')
-rw-r--r--zephyr/Kconfig.accelgyro_icm33
1 files changed, 33 insertions, 0 deletions
diff --git a/zephyr/Kconfig.accelgyro_icm b/zephyr/Kconfig.accelgyro_icm
new file mode 100644
index 0000000000..2bee9184b5
--- /dev/null
+++ b/zephyr/Kconfig.accelgyro_icm
@@ -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_ICM
+menu "ICM Sensor Common"
+
+choice PLATFORM_EC_ACCELGYRO_ICM_COMM
+ prompt "Accelgyro ICM's communication mode"
+ help
+ When using the ICM 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_ICM_COMM_SPI
+ bool "Use SPI communication"
+ help
+ The ICM 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 ICM chip.
+
+config PLATFORM_EC_ACCELGYRO_ICM_COMM_I2C
+ bool "Use I2C communication"
+ help
+ The ICM 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 ICM chip.
+
+endchoice
+
+endmenu # ICM Sensor
+endif # PLATFORM_EC_ACCELGYRO_ICM \ No newline at end of file