From ca948d79a7030df97b8f4fea16292b60fa60fd03 Mon Sep 17 00:00:00 2001 From: Sue Chen Date: Wed, 16 Dec 2020 14:24:52 +0800 Subject: ezkinil: fix ICM40608 orientation of x and y axes For the definition of orientation is different between BMI160 and ICM40608 so add base_standard_ref_1 for ICM40608. BUG=b:175169469 BRANCH=zork TEST="ectool motionsense" shows correct Senser 1 data. Signed-off-by: Sue Chen Change-Id: I81716bf44f80f7939cce2a8501a3b52a0295cc05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594729 Reviewed-by: Edward Hill Commit-Queue: Edward Hill --- board/ezkinil/board.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'board/ezkinil') diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c index 2db679ada4..20d1723043 100644 --- a/board/ezkinil/board.c +++ b/board/ezkinil/board.c @@ -60,6 +60,11 @@ const mat33_fp_t base_standard_ref = { { FLOAT_TO_FP(-1), 0, 0}, { 0, 0, FLOAT_TO_FP(-1)} }; +const mat33_fp_t base_standard_ref_1 = { + { FLOAT_TO_FP(1), 0, 0}, + { 0, FLOAT_TO_FP(-1), 0}, + { 0, 0, FLOAT_TO_FP(-1)} +}; const mat33_fp_t lid_standard_ref = { { FLOAT_TO_FP(-1), 0, 0}, { 0, FLOAT_TO_FP(-1), 0}, @@ -156,7 +161,7 @@ struct motion_sensor_t icm426xx_base_accel = { .port = I2C_PORT_SENSOR, .i2c_spi_addr_flags = ICM426XX_ADDR0_FLAGS, .default_range = 2, /* g, enough for laptop */ - .rot_standard_ref = &base_standard_ref, + .rot_standard_ref = &base_standard_ref_1, .min_frequency = ICM426XX_ACCEL_MIN_FREQ, .max_frequency = ICM426XX_ACCEL_MAX_FREQ, .config = { @@ -184,7 +189,7 @@ struct motion_sensor_t icm426xx_base_gyro = { .port = I2C_PORT_SENSOR, .i2c_spi_addr_flags = ICM426XX_ADDR0_FLAGS, .default_range = 1000, /* dps */ - .rot_standard_ref = &base_standard_ref, + .rot_standard_ref = &base_standard_ref_1, .min_frequency = ICM426XX_GYRO_MIN_FREQ, .max_frequency = ICM426XX_GYRO_MAX_FREQ, }; -- cgit v1.2.1