summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-01-10 00:12:55 -0800
committerCommit Bot <commit-bot@chromium.org>2021-10-12 15:10:28 +0000
commitb9124243c52d6ac5a7d687da581724025fe090cf (patch)
tree0264ccd5812f70706d8df193b53004c88b413a0d
parent8c2d908dce26a5c43982d83bc14f75c9f205ed6d (diff)
downloadchrome-ec-b9124243c52d6ac5a7d687da581724025fe090cf.tar.gz
board: sensor: remove identity matrices
Use NULL instead of defining an identity matrix. BUG=none BRANCH=none TEST=make buildall Change-Id: I9aad9f2de162cb10a25ae51561ca4949521a1f9b Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1995023 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> (cherry picked from commit 1e3197dd934a18a5d6bd7f67f1e9c3a5ffe1b1eb) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3193840 Tested-by: Rong Chang <rongchang@chromium.org> Auto-Submit: Rong Chang <rongchang@chromium.org> Commit-Queue: Rong Chang <rongchang@chromium.org>
-rw-r--r--baseboard/grunt/baseboard.c18
-rw-r--r--baseboard/zork/baseboard.c18
-rw-r--r--board/drallion_ish/board.c13
-rw-r--r--board/kohaku/board.c13
-rw-r--r--board/treeya/board.c8
5 files changed, 11 insertions, 59 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index d435ee7d4c..18b5f80767 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -535,18 +535,6 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
-mat33_fp_t grunt_base_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
-mat33_fp_t lid_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
/* sensor private data */
static struct kionix_accel_data g_kx022_data;
static struct bmi160_drv_data_t g_bmi160_data;
@@ -564,7 +552,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv_data = &g_kx022_data,
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = KX022_ADDR1_FLAGS,
- .rot_standard_ref = (const mat33_fp_t *)&lid_standard_ref,
+ .rot_standard_ref = NULL,
.default_range = 2, /* g, enough for laptop. */
.min_frequency = KX022_ACCEL_MIN_FREQ,
.max_frequency = KX022_ACCEL_MAX_FREQ,
@@ -593,7 +581,7 @@ struct motion_sensor_t motion_sensors[] = {
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = BMI160_ADDR0_FLAGS,
.default_range = 2, /* g, enough for laptop */
- .rot_standard_ref = (const mat33_fp_t *)&grunt_base_standard_ref,
+ .rot_standard_ref = NULL,
.min_frequency = BMI160_ACCEL_MIN_FREQ,
.max_frequency = BMI160_ACCEL_MAX_FREQ,
.config = {
@@ -621,7 +609,7 @@ struct motion_sensor_t motion_sensors[] = {
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = BMI160_ADDR0_FLAGS,
.default_range = 1000, /* dps */
- .rot_standard_ref = (const mat33_fp_t *)&grunt_base_standard_ref,
+ .rot_standard_ref = NULL,
.min_frequency = BMI160_GYRO_MIN_FREQ,
.max_frequency = BMI160_GYRO_MAX_FREQ,
},
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index a24961337f..8b931f9bb1 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -606,18 +606,6 @@ static void setup_fans(void)
static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
-mat33_fp_t zork_base_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
-mat33_fp_t lid_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
/* sensor private data */
static struct kionix_accel_data g_kx022_data;
static struct bmi160_drv_data_t g_bmi160_data;
@@ -635,7 +623,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv_data = &g_kx022_data,
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = KX022_ADDR1_FLAGS,
- .rot_standard_ref = (const mat33_fp_t *)&lid_standard_ref,
+ .rot_standard_ref = NULL,
.default_range = 2, /* g, enough for laptop. */
.min_frequency = KX022_ACCEL_MIN_FREQ,
.max_frequency = KX022_ACCEL_MAX_FREQ,
@@ -664,7 +652,7 @@ struct motion_sensor_t motion_sensors[] = {
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = BMI160_ADDR0_FLAGS,
.default_range = 2, /* g, enough for laptop */
- .rot_standard_ref = (const mat33_fp_t *)&zork_base_standard_ref,
+ .rot_standard_ref = NULL,
.min_frequency = BMI160_ACCEL_MIN_FREQ,
.max_frequency = BMI160_ACCEL_MAX_FREQ,
.config = {
@@ -692,7 +680,7 @@ struct motion_sensor_t motion_sensors[] = {
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = BMI160_ADDR0_FLAGS,
.default_range = 1000, /* dps */
- .rot_standard_ref = (const mat33_fp_t *)&zork_base_standard_ref,
+ .rot_standard_ref = NULL,
.min_frequency = BMI160_GYRO_MIN_FREQ,
.max_frequency = BMI160_GYRO_MAX_FREQ,
},
diff --git a/board/drallion_ish/board.c b/board/drallion_ish/board.c
index 9e0aed56d6..8c8a210c63 100644
--- a/board/drallion_ish/board.c
+++ b/board/drallion_ish/board.c
@@ -42,13 +42,6 @@ static struct lsm6dsm_data lsm6dsm_a_data;
static struct stprivate_data g_lis2dh_data;
static struct lis2mdl_private_data lis2mdl_a_data;
-/* Matrix to rotate lid sensor into standard reference frame */
-const mat33_fp_t lid_rot_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
/* Drivers */
struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
@@ -65,7 +58,7 @@ struct motion_sensor_t motion_sensors[] = {
.flags = MOTIONSENSE_FLAG_INT_SIGNAL,
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = LSM6DSM_ADDR0_FLAGS,
- .rot_standard_ref = &lid_rot_ref,
+ .rot_standard_ref = NULL,
.default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */
.min_frequency = LSM6DSM_ODR_MIN_VAL,
.max_frequency = LSM6DSM_ODR_MAX_VAL,
@@ -96,7 +89,7 @@ struct motion_sensor_t motion_sensors[] = {
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = LSM6DSM_ADDR0_FLAGS,
.default_range = 1000 | ROUND_UP_FLAG, /* dps */
- .rot_standard_ref = &lid_rot_ref,
+ .rot_standard_ref = NULL,
.min_frequency = LSM6DSM_ODR_MIN_VAL,
.max_frequency = LSM6DSM_ODR_MAX_VAL,
},
@@ -141,7 +134,7 @@ struct motion_sensor_t motion_sensors[] = {
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = LIS2MDL_ADDR_FLAGS,
.default_range = 1 << 11, /* 16LSB / uT, fixed */
- .rot_standard_ref = &lid_rot_ref,
+ .rot_standard_ref = NULL,
.min_frequency = LIS2MDL_ODR_MIN_VAL,
.max_frequency = LIS2MDL_ODR_MAX_VAL,
},
diff --git a/board/kohaku/board.c b/board/kohaku/board.c
index 2559abbec7..d99fd830aa 100644
--- a/board/kohaku/board.c
+++ b/board/kohaku/board.c
@@ -228,17 +228,6 @@ static const mat33_fp_t base_standard_ref = {
{ 0, 0, FLOAT_TO_FP(1)}
};
-/*
- * TODO(b/124337208): P0 boards don't have this sensor mounted so the rotation
- * matrix can't be tested properly. This needs to be revisited after EVT to make
- * sure the rotaiton matrix for the lid sensor is correct.
- */
-static const mat33_fp_t lid_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
.name = "Lid Accel",
@@ -251,7 +240,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv_data = &g_bma255_data,
.port = I2C_PORT_ACCEL,
.i2c_spi_addr_flags = BMA2x2_I2C_ADDR1_FLAGS,
- .rot_standard_ref = &lid_standard_ref,
+ .rot_standard_ref = NULL,
.min_frequency = BMA255_ACCEL_MIN_FREQ,
.max_frequency = BMA255_ACCEL_MAX_FREQ,
.default_range = 2, /* g, to support lid angle calculation. */
diff --git a/board/treeya/board.c b/board/treeya/board.c
index cf96579ac9..65c825b488 100644
--- a/board/treeya/board.c
+++ b/board/treeya/board.c
@@ -59,12 +59,6 @@ static const mat33_fp_t lsm6dsm_base_standard_ref = {
{ 0, 0, FLOAT_TO_FP(1)}
};
-static const mat33_fp_t lis2dwl_lid_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
static const mat33_fp_t treeya_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
@@ -82,7 +76,7 @@ struct motion_sensor_t lid_accel_1 = {
.drv_data = &g_lis2dwl_data,
.port = I2C_PORT_ACCEL,
.i2c_spi_addr_flags = LIS2DWL_ADDR1_FLAGS,
- .rot_standard_ref = &lis2dwl_lid_standard_ref,
+ .rot_standard_ref = NULL,
.default_range = 2, /* g */
.min_frequency = LIS2DW12_ODR_MIN_VAL,
.max_frequency = LIS2DW12_ODR_MAX_VAL,