summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorDevin Lu <devin.lu@quantatw.com>2022-08-04 03:03:22 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-05 01:19:38 +0000
commit50ecbf38dcbc47034303a49a299b52edf1888ed1 (patch)
treecedbdc5d89c9de8144ff46d7221532d347ce594f /board
parent18e2818a999503c3f130fc71379488047b4cef89 (diff)
downloadchrome-ec-50ecbf38dcbc47034303a49a299b52edf1888ed1.tar.gz
Reland "burnet: Replace 2nd source base accel sensor"
This reverts commit 0c7b1d9720377c5c6922ab9cc9d692aca6fb8bf5. Reason for revert: b/230553688 Original change's description: > Revert "burnet: Replace 2nd source base accel sensor" > > This reverts commit 2d90081520b78e1124688c914cd03b26aa543d8c. > > Reason for revert: deprecate ICM-42607 and resume ICM-40608 > > Original change's description: > > burnet: Replace 2nd source base accel sensor > > > > This patch replaces 2nd source base accelerometer to ICM-42607. > > > > BUG=b:230553688 > > BRANCH=firmware-kukui-12573.B > > TEST=On Burnet. Sensor works. > > > > Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> > > Change-Id: Ia5456f2f87d644821371ac0ffdea16c07a5c3fff > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508936 > > Reviewed-by: Eric Yilun Lin <yllin@google.com> > > Bug: b:230553688 > Change-Id: I4e085c55e4ed790ced3506ff9a39dae6ffb91c26 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3737695 > Reviewed-by: Ting Shen <phoenixshen@chromium.org> > Tested-by: Devin Lu <devin.lu@quantatw.com> > Commit-Queue: Devin Lu <devin.lu@quantatw.com> Bug: b:230553688 Change-Id: I4e5ac5de21e63fb002e3424132118b2acfc8a796 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3809411 Commit-Queue: Devin Lu <devin.lu@quantatw.com> Tested-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/burnet/board.c48
-rw-r--r--board/burnet/board.h6
2 files changed, 27 insertions, 27 deletions
diff --git a/board/burnet/board.c b/board/burnet/board.c
index f87ca7c837..4da6597adc 100644
--- a/board/burnet/board.c
+++ b/board/burnet/board.c
@@ -17,7 +17,7 @@
#include "driver/accel_kionix.h"
#include "driver/accelgyro_bmi_common.h"
#include "driver/accelgyro_icm_common.h"
-#include "driver/accelgyro_icm426xx.h"
+#include "driver/accelgyro_icm42607.h"
#include "driver/battery/max17055.h"
#include "driver/bc12/pi3usb9201.h"
#include "driver/charger/isl923x.h"
@@ -328,7 +328,7 @@ static const mat33_fp_t base_bmi160_ref = { { FLOAT_TO_FP(-1), 0, 0 },
{ 0, FLOAT_TO_FP(1), 0 },
{ 0, 0, FLOAT_TO_FP(-1) } };
-static const mat33_fp_t base_icm426xx_ref = { { 0, FLOAT_TO_FP(-1), 0 },
+static const mat33_fp_t base_icm42607_ref = { { 0, FLOAT_TO_FP(-1), 0 },
{ FLOAT_TO_FP(-1), 0, 0 },
{ 0, 0, FLOAT_TO_FP(-1) } };
@@ -336,7 +336,7 @@ static const mat33_fp_t base_icm426xx_ref = { { 0, FLOAT_TO_FP(-1), 0 },
static struct accelgyro_saved_data_t g_bma253_data;
static struct kionix_accel_data g_kx022_data;
static struct bmi_drv_data_t g_bmi160_data;
-static struct icm_drv_data_t g_icm426xx_data;
+static struct icm_drv_data_t g_icm42607_data;
struct motion_sensor_t lid_accel_kx022 = {
.name = "Lid Accel",
@@ -361,21 +361,21 @@ struct motion_sensor_t lid_accel_kx022 = {
},
};
-struct motion_sensor_t base_accel_icm426xx = {
+struct motion_sensor_t base_accel_icm42607 = {
.name = "Base Accel",
.active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_ICM426XX,
+ .chip = MOTIONSENSE_CHIP_ICM42607,
.type = MOTIONSENSE_TYPE_ACCEL,
.location = MOTIONSENSE_LOC_BASE,
- .drv = &icm426xx_drv,
+ .drv = &icm42607_drv,
.mutex = &g_base_mutex,
- .drv_data = &g_icm426xx_data,
+ .drv_data = &g_icm42607_data,
.port = CONFIG_SPI_ACCEL_PORT,
.i2c_spi_addr_flags = ACCEL_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT),
.default_range = 4,
- .rot_standard_ref = &base_icm426xx_ref,
- .min_frequency = ICM426XX_ACCEL_MIN_FREQ,
- .max_frequency = ICM426XX_ACCEL_MAX_FREQ,
+ .rot_standard_ref = &base_icm42607_ref,
+ .min_frequency = ICM42607_ACCEL_MIN_FREQ,
+ .max_frequency = ICM42607_ACCEL_MAX_FREQ,
.config = {
/* EC use accel for angle detection */
[SENSOR_CONFIG_EC_S0] = {
@@ -388,21 +388,21 @@ struct motion_sensor_t base_accel_icm426xx = {
},
};
-struct motion_sensor_t base_gyro_icm426xx = {
+struct motion_sensor_t base_gyro_icm42607 = {
.name = "Base Gyro",
.active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_ICM426XX,
+ .chip = MOTIONSENSE_CHIP_ICM42607,
.type = MOTIONSENSE_TYPE_GYRO,
.location = MOTIONSENSE_LOC_BASE,
- .drv = &icm426xx_drv,
+ .drv = &icm42607_drv,
.mutex = &g_base_mutex,
- .drv_data = &g_icm426xx_data,
+ .drv_data = &g_icm42607_data,
.port = CONFIG_SPI_ACCEL_PORT,
.i2c_spi_addr_flags = ACCEL_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT),
.default_range = 1000, /* dps */
- .rot_standard_ref = &base_icm426xx_ref,
- .min_frequency = ICM426XX_GYRO_MIN_FREQ,
- .max_frequency = ICM426XX_GYRO_MAX_FREQ,
+ .rot_standard_ref = &base_icm42607_ref,
+ .min_frequency = ICM42607_GYRO_MIN_FREQ,
+ .max_frequency = ICM42607_GYRO_MAX_FREQ,
};
struct motion_sensor_t motion_sensors[] = {
@@ -487,8 +487,8 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
void sensor_interrupt(enum gpio_signal signal)
{
switch (motion_sensors[BASE_ACCEL].chip) {
- case MOTIONSENSE_CHIP_ICM426XX:
- icm426xx_interrupt(signal);
+ case MOTIONSENSE_CHIP_ICM42607:
+ icm42607_interrupt(signal);
break;
case MOTIONSENSE_CHIP_BMI160:
default:
@@ -508,12 +508,12 @@ static void board_update_config(void)
if (rv == EC_SUCCESS)
motion_sensors[LID_ACCEL] = lid_accel_kx022;
- /* Read icm-40608 chip content */
- rv = icm_read8(&base_accel_icm426xx, ICM426XX_REG_WHO_AM_I, &val);
+ /* Read icm-42607 chip content */
+ rv = icm_read8(&base_accel_icm42607, ICM42607_REG_WHO_AM_I, &val);
- if (rv == EC_SUCCESS && val == ICM426XX_CHIP_ICM40608) {
- motion_sensors[BASE_ACCEL] = base_accel_icm426xx;
- motion_sensors[BASE_GYRO] = base_gyro_icm426xx;
+ if (rv == EC_SUCCESS && val == ICM42607_CHIP_ICM42607P) {
+ motion_sensors[BASE_ACCEL] = base_accel_icm42607;
+ motion_sensors[BASE_GYRO] = base_gyro_icm42607;
}
CPRINTS("Lid Accel Chip: %d", motion_sensors[LID_ACCEL].chip);
diff --git a/board/burnet/board.h b/board/burnet/board.h
index b367f42eb8..8702502d69 100644
--- a/board/burnet/board.h
+++ b/board/burnet/board.h
@@ -57,9 +57,9 @@
#define CONFIG_ACCELGYRO_BMI160 /* Base accel */
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
-/* ICM426XX Base accel/gyro */
-#define CONFIG_ACCELGYRO_ICM426XX
-#define CONFIG_ACCELGYRO_ICM426XX_INT_EVENT \
+/* ICM42607 Base accel/gyro */
+#define CONFIG_ACCELGYRO_ICM42607
+#define CONFIG_ACCELGYRO_ICM42607_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
#define CONFIG_ALS
#define CONFIG_CMD_ACCEL_INFO