summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelmo_lan <elmo_lan@compal.corp-partner.google.com>2021-07-13 19:52:48 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-19 23:39:50 +0000
commit1d0e31a1e4983e4d99ce04490bd8378204d65708 (patch)
tree4fe7efdbc699f305068337229428fe83d0fbe8b5
parente508cfee4e10998f9342a8ae6c8875e5116f05fc (diff)
downloadchrome-ec-1d0e31a1e4983e4d99ce04490bd8378204d65708.tar.gz
sensor: fix LSM6DSO drv_data overlapping
The base g-sensor provides 2 functions: accelerometer and gyro. EC need to assign 2 different addresses to store each calibration data. BRANCH=none BUG=none TEST=make BOARD Signed-off-by: elmo_lan <elmo_lan@compal.corp-partner.google.com> Change-Id: I90f5c4daa51b63788f102c0689c59e566255ffc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3023757 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com> Tested-by: Boris Mittelberg <bmbm@google.com>
-rw-r--r--board/kano/sensors.c6
-rw-r--r--board/redrix/sensors.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/board/kano/sensors.c b/board/kano/sensors.c
index 84be4060a3..e80d5f912a 100644
--- a/board/kano/sensors.c
+++ b/board/kano/sensors.c
@@ -159,7 +159,8 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_BASE,
.drv = &lsm6dso_drv,
.mutex = &g_base_accel_mutex,
- .drv_data = &lsm6dso_data,
+ .drv_data = LSM6DSO_ST_DATA(lsm6dso_data,
+ MOTIONSENSE_TYPE_ACCEL),
.int_signal = GPIO_EC_IMU_INT_R_L,
.flags = MOTIONSENSE_FLAG_INT_SIGNAL,
.port = I2C_PORT_SENSOR,
@@ -188,7 +189,8 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_BASE,
.drv = &lsm6dso_drv,
.mutex = &g_base_accel_mutex,
- .drv_data = &lsm6dso_data,
+ .drv_data = LSM6DSO_ST_DATA(lsm6dso_data,
+ MOTIONSENSE_TYPE_GYRO),
.int_signal = GPIO_EC_IMU_INT_R_L,
.flags = MOTIONSENSE_FLAG_INT_SIGNAL,
.port = I2C_PORT_SENSOR,
diff --git a/board/redrix/sensors.c b/board/redrix/sensors.c
index 84be4060a3..e80d5f912a 100644
--- a/board/redrix/sensors.c
+++ b/board/redrix/sensors.c
@@ -159,7 +159,8 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_BASE,
.drv = &lsm6dso_drv,
.mutex = &g_base_accel_mutex,
- .drv_data = &lsm6dso_data,
+ .drv_data = LSM6DSO_ST_DATA(lsm6dso_data,
+ MOTIONSENSE_TYPE_ACCEL),
.int_signal = GPIO_EC_IMU_INT_R_L,
.flags = MOTIONSENSE_FLAG_INT_SIGNAL,
.port = I2C_PORT_SENSOR,
@@ -188,7 +189,8 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_BASE,
.drv = &lsm6dso_drv,
.mutex = &g_base_accel_mutex,
- .drv_data = &lsm6dso_data,
+ .drv_data = LSM6DSO_ST_DATA(lsm6dso_data,
+ MOTIONSENSE_TYPE_GYRO),
.int_signal = GPIO_EC_IMU_INT_R_L,
.flags = MOTIONSENSE_FLAG_INT_SIGNAL,
.port = I2C_PORT_SENSOR,