summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@chromium.org>2019-07-03 03:56:32 +0000
committerCommit Bot <commit-bot@chromium.org>2019-07-23 11:27:00 +0000
commit0ae8c5584d3648c76bd8e8fca0a27ae20d1bb761 (patch)
treebbf1c951665bbb53e4f87d56e010265d9ad5f3f5
parent11a7759925b607ef9c68c0d40224194df194efc6 (diff)
downloadchrome-ec-0ae8c5584d3648c76bd8e8fca0a27ae20d1bb761.tar.gz
krane: Fix g-sensor reference point for all revisions
This should apply to all Kranes. BUG=b:131081336 TEST=factory accelometer test BRANCH=master Change-Id: I44313d73bf6dd484101973e153c6b5209128a789 Signed-off-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1687832 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--board/kukui/board.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/board/kukui/board.c b/board/kukui/board.c
index 23261f7089..e31e6092be 100644
--- a/board/kukui/board.c
+++ b/board/kukui/board.c
@@ -437,21 +437,20 @@ static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = {
},
};
-#ifdef BOARD_KRANE
/* Matrix to rotate accelerometer into standard reference frame */
-static const mat33_fp_t lid_standard_ref_rev3 = {
- {0, FLOAT_TO_FP(-1), 0},
+#ifdef BOARD_KUKUI
+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)}
};
-#endif /* BOARD_KRANE */
-
-/* Matrix to rotate accelerometer into standard reference frame */
+#else
static const mat33_fp_t lid_standard_ref = {
+ {0, FLOAT_TO_FP(-1), 0},
{FLOAT_TO_FP(1), 0, 0},
- {0, FLOAT_TO_FP(1), 0},
{0, 0, FLOAT_TO_FP(1)}
};
+#endif /* BOARD_KUKUI */
#ifdef CONFIG_MAG_BMI160_BMM150
/* Matrix to rotate accelrator into standard reference frame */
@@ -576,24 +575,8 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
const struct motion_sensor_t *motion_als_sensors[] = {
&motion_sensors[CLEAR_ALS],
};
-
#endif /* SECTION_IS_RW */
-#ifdef BOARD_KRANE
-static void fix_krane(void)
-{
- if (board_get_version() != 3)
- return;
-
-#ifdef SECTION_IS_RW
- /* Fix reference point */
- motion_sensors[LID_ACCEL].rot_standard_ref = &lid_standard_ref_rev3;
- motion_sensors[LID_GYRO].rot_standard_ref = &lid_standard_ref_rev3;
-#endif /* SECTION_IS_RW */
-}
-DECLARE_HOOK(HOOK_INIT, fix_krane, HOOK_PRIO_INIT_ADC + 1);
-#endif /* BOARD_KRANE */
-
int board_allow_i2c_passthru(int port)
{
return (port == I2C_PORT_VIRTUAL_BATTERY);