diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-06-12 11:06:12 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-21 16:31:17 -0700 |
commit | 329638a06ae4a7088ccea5a8453342e0a18702b0 (patch) | |
tree | 323af5960de009aa67f682a9fd9092c5f41053c7 | |
parent | b324b1d48dc1d684cb110199717b16677d817340 (diff) | |
download | chrome-ec-329638a06ae4a7088ccea5a8453342e0a18702b0.tar.gz |
Nami: Change rotation for accels and gyro for Akali
This sets the rotations for the lid and base accels and the gyro for
Akali to match the new orientations.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:109710669
BRANCH=none
TEST=Verify angle readings on EC console follow lid positions on
Akali360 (ver. 0x101).
Change-Id: Ie5fc7e1731a4db0e4fbd1267df91a9658949eb93
Reviewed-on: https://chromium-review.googlesource.com/1109413
Commit-Ready: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com>
Tested-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com>
Reviewed-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com>
Reviewed-by: Gwendal Grignou <gwendal@google.com>
-rw-r--r-- | board/nami/board.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index a7460aa372..b4247e15e1 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -549,10 +549,10 @@ const matrix_3x3_t lid_standard_ref = { { 0, 0, FLOAT_TO_FP(-1)} }; -const matrix_3x3_t lid_Rx180_Ry180 = { - { FLOAT_TO_FP(-1), 0, 0 }, +const matrix_3x3_t rotation_x180_z90 = { { 0, FLOAT_TO_FP(-1), 0 }, - { 0, 0, FLOAT_TO_FP(1) } + { FLOAT_TO_FP(-1), 0, 0 }, + { 0, 0, FLOAT_TO_FP(-1) } }; const struct motion_sensor_t lid_accel_1 = { @@ -566,7 +566,7 @@ const struct motion_sensor_t lid_accel_1 = { .drv_data = &g_kx022_data, .port = I2C_PORT_ACCEL, .addr = KX022_ADDR1, - .rot_standard_ref = &lid_Rx180_Ry180, + .rot_standard_ref = &rotation_x180_z90, .min_frequency = KX022_ACCEL_MIN_FREQ, .max_frequency = KX022_ACCEL_MAX_FREQ, .default_range = 2, /* g, to support tablet mode */ @@ -738,9 +738,11 @@ static void setup_motion_sensors(void) if (oem != PROJECT_NAMI) /* Only Nami has ALS */ motion_sensor_count = ARRAY_SIZE(motion_sensors) - 1; - if (oem == PROJECT_AKALI) - /* Akali uses KX022 */ + if (oem == PROJECT_AKALI) { motion_sensors[LID_ACCEL] = lid_accel_1; + motion_sensors[BASE_ACCEL].rot_standard_ref = NULL; + motion_sensors[BASE_GYRO].rot_standard_ref = NULL; + } } static void board_init(void) |