summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-09-17 11:42:43 -0700
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-11-18 22:55:45 +0000
commit8a31aab6f9327610910505d762e83716c85fb167 (patch)
treeee847f318bb56edfab3b93252562e760a28b7e91 /board
parent106942823df924d6797302c053aa7ee84a6b4786 (diff)
downloadchrome-ec-8a31aab6f9327610910505d762e83716c85fb167.tar.gz
motion: add config option to use the old accelerometer ref frame
Add config option to use the old accelerometer reference frame, which is used on samus and products using 3.14 or earlier kernel. This fixes samus so that the lid angle calculation is correct again. This also moves the accel_orientation structure out of the board directory and into common code, since it purely is a function of the reference frame being used. BUG=chrome-os-partner:43494 BRANCH=none TEST=test on samus, verify lid angle calculation is correct once again. also, enable the motion_lid test and verify that it passes. Change-Id: I948a74a71964b54c68be66e828a030ddd0418947 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/300510 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> (cherry picked from commit 5717b3150c8a8d43e07ce2dc8065c3515d3651f7) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/313150
Diffstat (limited to 'board')
-rw-r--r--board/cyan/board.c16
-rw-r--r--board/host/board.c17
-rw-r--r--board/kunimitsu/board.c16
-rw-r--r--board/samus/board.c16
-rw-r--r--board/samus/board.h1
-rw-r--r--board/strago/board.c16
6 files changed, 1 insertions, 81 deletions
diff --git a/board/cyan/board.c b/board/cyan/board.c
index 72d7d2c667..722e146652 100644
--- a/board/cyan/board.c
+++ b/board/cyan/board.c
@@ -151,22 +151,6 @@ struct motion_sensor_t motion_sensors[] = {
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
-/* Define the accelerometer orientation matrices. */
-const struct accel_orientation acc_orient = {
- /* Hinge aligns with x axis. */
- .rot_hinge_90 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)},
- { 0, FLOAT_TO_FP(-1), 0}
- },
- .rot_hinge_180 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(-1)}
- },
- .hinge_axis = {1, 0, 0},
-};
-
/*
* In S3, power rail for sensors (+V3p3S) goes down asynchronous to EC. We need
* to execute this routine first and set the sensor state to "Not Initialized".
diff --git a/board/host/board.c b/board/host/board.c
index 7ed0e37f28..e0799aeaa4 100644
--- a/board/host/board.c
+++ b/board/host/board.c
@@ -53,20 +53,3 @@ const struct button_config buttons[] = {
};
BUILD_ASSERT(ARRAY_SIZE(buttons) == CONFIG_BUTTON_COUNT);
#endif
-
-/* Define the accelerometer orientation matrices. */
-const struct accel_orientation acc_orient = {
- /* Hinge aligns with y axis. */
- .rot_hinge_90 = {
- { 0, 0, 1},
- { 0, 1, 0},
- { -1, 0, 0}
- },
- .rot_hinge_180 = {
- {-1, 0, 0},
- { 0, 1, 0},
- { 0, 0, -1}
- },
- .hinge_axis = {0, 1, 0},
-};
-
diff --git a/board/kunimitsu/board.c b/board/kunimitsu/board.c
index a1a26010bd..ad8336048a 100644
--- a/board/kunimitsu/board.c
+++ b/board/kunimitsu/board.c
@@ -186,22 +186,6 @@ struct motion_sensor_t motion_sensors[] = {
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
-/* Define the accelerometer orientation matrices. */
-const struct accel_orientation acc_orient = {
- /* Hinge aligns with x axis. */
- .rot_hinge_90 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)},
- { 0, FLOAT_TO_FP(-1), 0}
- },
- .rot_hinge_180 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(-1)}
- },
- .hinge_axis = {1, 0, 0},
-};
-
/*
* In S3, power rail for sensors (+V3p3S) goes down asynchronous to EC. We need
* to execute this routine first and set the sensor state to "Not Initialized".
diff --git a/board/samus/board.c b/board/samus/board.c
index 799144391d..623b3ac712 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -399,19 +399,3 @@ struct motion_sensor_t motion_sensors[] = {
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
-
-/* Define the accelerometer orientation matrices. */
-const struct accel_orientation acc_orient = {
- /* Hinge aligns with y axis. */
- .rot_hinge_90 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
- },
- .rot_hinge_180 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
- },
- .hinge_axis = {0, 1, 0},
-};
diff --git a/board/samus/board.h b/board/samus/board.h
index 9a2022906c..c351bcfd1c 100644
--- a/board/samus/board.h
+++ b/board/samus/board.h
@@ -17,6 +17,7 @@
/* Optional features */
#define CONFIG_ACCELGYRO_LSM6DS0
#define CONFIG_ACCEL_KXCJ9
+#define CONFIG_ACCEL_STD_REF_FRAME_OLD
#define CONFIG_ALS
#define CONFIG_ALS_ISL29035
#define CONFIG_BOARD_VERSION
diff --git a/board/strago/board.c b/board/strago/board.c
index 91182208ad..28d1f43ea0 100644
--- a/board/strago/board.c
+++ b/board/strago/board.c
@@ -165,22 +165,6 @@ struct motion_sensor_t motion_sensors[] = {
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
-/* Define the accelerometer orientation matrices. */
-const struct accel_orientation acc_orient = {
- /* Hinge aligns with x axis. */
- .rot_hinge_90 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)},
- { 0, FLOAT_TO_FP(-1), 0}
- },
- .rot_hinge_180 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(-1)}
- },
- .hinge_axis = {1, 0, 0},
-};
-
/*
* In S3, power rail for sensors (+V3p3S) goes down asynchronous to EC. We need
* to execute this routine first and set the sensor state to "Not Initialized".