summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-01-10 00:12:55 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-13 20:35:38 +0000
commit1e3197dd934a18a5d6bd7f67f1e9c3a5ffe1b1eb (patch)
treede12bf5edb6d84469ce98eb197fd992ef68c673e /board
parentaf0a64cc36072d283149ea40967cdc3ce71cf52a (diff)
downloadchrome-ec-1e3197dd934a18a5d6bd7f67f1e9c3a5ffe1b1eb.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>
Diffstat (limited to 'board')
-rw-r--r--board/drallion_ish/board.c13
-rw-r--r--board/kohaku/board.c13
-rw-r--r--board/treeya/board.c8
3 files changed, 5 insertions, 29 deletions
diff --git a/board/drallion_ish/board.c b/board/drallion_ish/board.c
index 659e9c0529..a36b4e5644 100644
--- a/board/drallion_ish/board.c
+++ b/board/drallion_ish/board.c
@@ -42,13 +42,6 @@ static struct lsm6dsm_data lsm6dsm_a_data = LSM6DSM_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 144c316806..0afbf6eaf0 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 b7aad5deaa..8279a76cc6 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,