summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorHyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com>2021-01-19 21:46:31 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-22 21:43:16 +0000
commit3ccae3be744d4084712d7259cd77e0727c81786f (patch)
tree8a798c69b1355a5f10c2560500c55d0e37f076a4 /zephyr
parent90995b4a525442b448384e8c5e6d77f541283c4d (diff)
downloadchrome-ec-3ccae3be744d4084712d7259cd77e0727c81786f.tar.gz
zephyr: add bmi260, bma2x2,and tcs3400 support
Add BMI260, BMA2x2, and TCS3400 support to zephyr. BUG=b:173508071,b:173508128,b:173507878 BRANCH=none TEST=make buildall -j8 build volteer on zephyr Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Change-Id: Ibc22ed08b4f6db6cf70e3a62c3d16ef750e69de2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2639733 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/CMakeLists.txt12
-rw-r--r--zephyr/Kconfig.motionsense2
-rw-r--r--zephyr/Kconfig.sensor_devices27
-rw-r--r--zephyr/shim/include/config_chip.h16
4 files changed, 56 insertions, 1 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index de5ba324c7..2870611b64 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -56,7 +56,8 @@ zephyr_include_directories_ifdef(
"${PLATFORM_EC}/fuzz"
"${PLATFORM_EC}/test"
"${PLATFORM_EC}/include"
- "${PLATFORM_EC}/include/driver")
+ "${PLATFORM_EC}/include/driver"
+ "${PLATFORM_EC}/third_party")
add_subdirectory("app")
add_subdirectory("drivers")
@@ -75,8 +76,17 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/base32.c"
# Now include files that depend on or relate to other CONFIG options, sorted by
# CONFIG
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ACCEL_BMA255
+ "${PLATFORM_EC}/driver/accel_bma2x2.c"
+ "${PLATFORM_EC}/common/math_util.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ACCELGYRO_BMI260
+ "${PLATFORM_EC}/driver/accelgyro_bmi_common.c"
+ "${PLATFORM_EC}/driver/accelgyro_bmi260.c"
+ "${PLATFORM_EC}/common/math_util.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ACCEL_FIFO
"${PLATFORM_EC}/common/motion_sense_fifo.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ALS_TCS3400
+ "${PLATFORM_EC}/driver/als_tcs3400.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ACPI "${PLATFORM_EC}/common/acpi.c"
"${PLATFORM_EC}/common/ec_features.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY "${PLATFORM_EC}/common/battery.c")
diff --git a/zephyr/Kconfig.motionsense b/zephyr/Kconfig.motionsense
index b73d1b9d35..04903b361b 100644
--- a/zephyr/Kconfig.motionsense
+++ b/zephyr/Kconfig.motionsense
@@ -122,3 +122,5 @@ config PLATFORM_EC_GMR_TABLET_MODE
in common/tablet_mode.c.
endif # PLATFORM_EC_LID_ANGLE
+
+rsource "Kconfig.sensor_devices"
diff --git a/zephyr/Kconfig.sensor_devices b/zephyr/Kconfig.sensor_devices
new file mode 100644
index 0000000000..4c477c2d76
--- /dev/null
+++ b/zephyr/Kconfig.sensor_devices
@@ -0,0 +1,27 @@
+# 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.
+
+menu "Sensor Devices"
+
+config PLATFORM_EC_ACCEL_BMA255
+ bool "BMA2X2 Accelerometer Family Driver"
+ help
+ The driver supports Bosch's a triaxial, low-g acceleration sensor.
+ It allows measurements of acceleration in three perpendicular axes.
+ Currently the driver supports BMA253, BMA255, BMA355, BMA280, BMA282,
+ BMA223, BMA254, BMA284, BMA250E, BMA222E, BMC150 BMC056, BMC156.
+
+config PLATFORM_EC_ACCELGYRO_BMI260
+ bool "BMI260 Accelgyrometer Driver"
+ help
+ The driver supports Bosch's BMI260 which is an IMU consisting of
+ a 16-bit tri-axial gyroscope and a 16-bit tri-axial accelerometer.
+
+config PLATFORM_EC_ALS_TCS3400
+ bool "TCS3400 Ambient Light Senseor Driver"
+ help
+ The driver supports TCS3400 which provides color and
+ IR (red, green, blue, clear and IR) ambient light sensing.
+
+endmenu # Sensor devices
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 4219a85f63..fff357ba3d 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -673,6 +673,22 @@ enum battery_type {
#define CONFIG_GMR_TABLET_MODE
#endif
+/* sensors */
+#undef CONFIG_ACCELGYRO_BMI260
+#ifdef CONFIG_PLATFORM_EC_ACCELGYRO_BMI260
+#define CONFIG_ACCELGYRO_BMI260
+#endif
+
+#undef CONFIG_ACCEL_BMA255
+#ifdef CONFIG_PLATFORM_EC_ACCEL_BMA255
+#define CONFIG_ACCEL_BMA255
+#endif
+
+#undef CONFIG_ALS_TCS3400
+#ifdef CONFIG_PLATFORM_EC_ALS_TCS3400
+#define CONFIG_ALS_TCS3400
+#endif
+
#endif /* CONFIG_PLATFORM_EC_MOTIONSENSE */
#endif /* __CROS_EC_CONFIG_CHIP_H */