summaryrefslogtreecommitdiff
path: root/board/coral/board.h
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-10-10 16:14:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-12 00:09:34 -0700
commitdfe7473ed8fefe6b6bb15324fa835aafde4b0ffb (patch)
tree8fe6c9e41af8d71686e36f9a3244eb5242c27a1a /board/coral/board.h
parentc478733f19b0de89364e996604a2ac73d1d95ea7 (diff)
downloadchrome-ec-dfe7473ed8fefe6b6bb15324fa835aafde4b0ffb.tar.gz
coral: Use SKU ID to initialize motion_sensor_count
This CL adds the config option CONFIG_DYNAMIC_MOTION_SENSOR_COUNT and SKU table which contains the form factor for all known SKUs. Once the SKU ID is known, the variable motion_sensor_count is set based on CLAMSHELL or CONVERTIBLE designation in the SKU table. If there isn't a matching SKU ID in the table then motion_sensor_count will be initialized to the ARRAY_LENGTH of motion_sensors. BUG=b:38271876 BRANCH=None TEST=Manual Tested with Robo360 (SKU ID 71) and verified the motion sensor count and that the motion senors were initialized in the EC console log. [0.088188 Motion Sensor Init: count = 3] [0.346097 Lid Accel: MS Done Init type:0x0 range:2] [0.370386 Base Accel: MS Done Init type:0x0 range:2] [0.386790 Base Gyro: MS Done Init type:0x1 range:1000] Tested with Santa EVT (SKU ID 3) and verified motion_sensor_count is 0 and no EC console messages showing sensor initialization failures. Change-Id: Ia3d60f8c8dd4435dd7cfb80a860f809de2fb931e Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/711195 Commit-Ready: Aaron Durbin <adurbin@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'board/coral/board.h')
-rw-r--r--board/coral/board.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/board/coral/board.h b/board/coral/board.h
index 59d879c690..4fadb6728a 100644
--- a/board/coral/board.h
+++ b/board/coral/board.h
@@ -208,6 +208,7 @@
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
+#define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT
/* FIFO size is in power of 2. */
#define CONFIG_ACCEL_FIFO 1024
@@ -278,7 +279,7 @@ enum temp_sensor_id {
* For BMI160, accel, gyro and compass sensors must be next to each other.
*/
enum sensor_id {
- LID_ACCEL = 0,
+ LID_ACCEL,
BASE_ACCEL,
BASE_GYRO,
LID_ALS,