From 1d0e31a1e4983e4d99ce04490bd8378204d65708 Mon Sep 17 00:00:00 2001 From: elmo_lan Date: Tue, 13 Jul 2021 19:52:48 +0800 Subject: 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 Change-Id: I90f5c4daa51b63788f102c0689c59e566255ffc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3023757 Reviewed-by: Aseda Aboagye Reviewed-by: Boris Mittelberg Commit-Queue: Boris Mittelberg Tested-by: Boris Mittelberg --- board/redrix/sensors.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'board/redrix') 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, -- cgit v1.2.1