summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2021-10-27 14:46:46 +0800
committerCommit Bot <commit-bot@chromium.org>2022-01-12 09:15:53 +0000
commit2752c46154dece5da8dd54d004ed7d7f4c807322 (patch)
tree55be7867d32dfbae45237a3dd388de3e276db89a
parent3f45fc7b4fca3a17ea7cabd07d299204564dea63 (diff)
downloadchrome-ec-2752c46154dece5da8dd54d004ed7d7f4c807322.tar.gz
Krabby: enable base sensor icm42607
BUG=b:211845298 TEST=1) zmake 2) accelread 1 BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I7f463821fb6ebcf8afa7d42bf70ff8e6375aae47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3246995 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--zephyr/projects/corsola/include/gpio_map.h14
-rw-r--r--zephyr/projects/corsola/motionsense_krabby.dts32
-rw-r--r--zephyr/projects/corsola/prj_krabby.conf4
3 files changed, 26 insertions, 24 deletions
diff --git a/zephyr/projects/corsola/include/gpio_map.h b/zephyr/projects/corsola/include/gpio_map.h
index 8fda7b77d0..ca26199b35 100644
--- a/zephyr/projects/corsola/include/gpio_map.h
+++ b/zephyr/projects/corsola/include/gpio_map.h
@@ -129,10 +129,13 @@
#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
#endif
-/* TODO: remove after icm426xx driver added */
-static inline void motion_interrupt(enum gpio_signal signal)
-{
-}
+#ifdef CONFIG_PLATFORM_EC_ACCELGYRO_ICM42607
+ #define BASE_IMU_INT() GPIO_INT(GPIO_BASE_IMU_INT_L, \
+ GPIO_INT_EDGE_FALLING, \
+ icm42607_interrupt)
+#else
+ #define BASE_IMU_INT()
+#endif
/*
* Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items.
@@ -159,8 +162,7 @@ static inline void motion_interrupt(enum gpio_signal signal)
AP_IN_RST_INT() \
AP_EC_WDTRST_INT() \
GMR_TABLET_INT() \
- GPIO_INT(GPIO_BASE_IMU_INT_L, \
- GPIO_INT_EDGE_FALLING, motion_interrupt) \
+ BASE_IMU_INT() \
LID_ACCEL_INT() \
USBA_INT() \
EXTPWR_INT() \
diff --git a/zephyr/projects/corsola/motionsense_krabby.dts b/zephyr/projects/corsola/motionsense_krabby.dts
index 00434e6be9..589944ac93 100644
--- a/zephyr/projects/corsola/motionsense_krabby.dts
+++ b/zephyr/projects/corsola/motionsense_krabby.dts
@@ -13,7 +13,7 @@
* by alias. Using the alias, each driver creates
* its own <>_INT_EVENT.
*/
- bmi160-int = &base_accel;
+ icm42607-int = &base_accel;
lis2dw12-int = &lid_accel;
};
@@ -30,8 +30,8 @@
label = "LID_MUTEX";
};
- mutex_bmi160: bmi160-mutex {
- label = "BMI160_MUTEX";
+ base_mutex: icm42607-mutex {
+ label = "ICM42607_MUTEX";
};
};
@@ -39,15 +39,15 @@
motionsense-rotation-ref {
compatible = "cros-ec,motionsense-rotation-ref";
lid_rot_ref: lid-rotation-ref {
- mat33 = <(-1) 0 0
- 0 (-1) 0
+ mat33 = <1 0 0
+ 0 1 0
0 0 1>;
};
base_rot_ref: base-rotation-ref {
mat33 = <1 0 0
- 0 (-1) 0
- 0 0 (-1)>;
+ 0 1 0
+ 0 0 1>;
};
};
@@ -61,8 +61,8 @@
* "struct als_drv_data_t" in accelgyro.h
*/
motionsense-sensor-data {
- bmi160_data: bmi160-drv-data {
- compatible = "cros-ec,drvdata-bmi160";
+ icm42607_data: icm42607-drv-data {
+ compatible = "cros-ec,drvdata-icm42607";
status = "okay";
};
@@ -105,16 +105,16 @@
};
base_accel: base-accel {
- compatible = "cros-ec,bmi160-accel";
+ compatible = "cros-ec,icm42607-accel";
status = "okay";
label = "Base Accel";
active-mask = "SENSOR_ACTIVE_S0_S3";
location = "MOTIONSENSE_LOC_BASE";
- mutex = <&mutex_bmi160>;
+ mutex = <&base_mutex>;
port = <&i2c_sensor>;
rot-standard-ref = <&base_rot_ref>;
- drv-data = <&bmi160_data>;
+ drv-data = <&icm42607_data>;
configs {
compatible =
"cros-ec,motionsense-sensor-config";
@@ -129,17 +129,17 @@
};
};
- base-gyro {
- compatible = "cros-ec,bmi160-gyro";
+ base_gyro: base-gyro {
+ compatible = "cros-ec,icm42607-gyro";
status = "okay";
label = "Base Gyro";
active-mask = "SENSOR_ACTIVE_S0_S3";
location = "MOTIONSENSE_LOC_BASE";
- mutex = <&mutex_bmi160>;
+ mutex = <&base_mutex>;
port = <&i2c_sensor>;
rot-standard-ref = <&base_rot_ref>;
- drv-data = <&bmi160_data>;
+ drv-data = <&icm42607_data>;
};
};
diff --git a/zephyr/projects/corsola/prj_krabby.conf b/zephyr/projects/corsola/prj_krabby.conf
index 1182b2bbb5..caa3b47f3a 100644
--- a/zephyr/projects/corsola/prj_krabby.conf
+++ b/zephyr/projects/corsola/prj_krabby.conf
@@ -98,8 +98,8 @@ CONFIG_PLATFORM_EC_TABLET_MODE_SWITCH=y
# Sensor Drivers
CONFIG_PLATFORM_EC_ACCEL_LIS2DW12=y
CONFIG_PLATFORM_EC_ACCEL_LIS2DW12_AS_BASE=y
-CONFIG_PLATFORM_EC_ACCELGYRO_BMI160=y
-CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C=y
+CONFIG_PLATFORM_EC_ACCELGYRO_ICM42607=y
+CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM_I2C=y
# USB-A
CONFIG_PLATFORM_EC_USB_A_PORT_COUNT=1