summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2015-11-18 23:59:42 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-25 18:15:38 -0800
commite24ac972e21d60a65d15e957605e8b78bd25e039 (patch)
tree51044b14b8c8b7b5966d7bd774f1499f55b931ef /include
parent767e132d133b6f1216d630bd3b59e893a59bcffa (diff)
downloadchrome-ec-e24ac972e21d60a65d15e957605e8b78bd25e039.tar.gz
ectool: provide lid angle info
Added new host command to support returning lid angle. New output from ectool: System with lid angle support: ------------------------------------------ localhost ~ # ectool motionsense lid_angle Lid angle: 72 System without lid angle support: ------------------------------------------ localhost ~ # ectool motionsense lid_angle EC result 3 (INVALID_PARAM) BUG=none BRANCH=none TEST=run "ectool motionsense lid_angle" verify the value matches the physical lid angle position Change-Id: I4179172c778f643640561e819216f7adfee679d2 Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/313345 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/ec_commands.h21
-rw-r--r--include/motion_lid.h3
2 files changed, 21 insertions, 3 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 54f91e3054..7901745e9e 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -1713,6 +1713,11 @@ enum motionsense_command {
*/
MOTIONSENSE_CMD_SET_ACTIVITY = 13,
+ /*
+ * Lid Angle
+ */
+ MOTIONSENSE_CMD_LID_ANGLE = 14,
+
/* Number of motionsense sub-commands. */
MOTIONSENSE_NUM_CMDS
};
@@ -1827,6 +1832,8 @@ struct ec_motion_sense_activity {
/* Set Calibration information */
#define MOTION_SENSE_SET_OFFSET 1
+#define LID_ANGLE_UNRELIABLE 500
+
struct ec_params_motion_sense {
uint8_t cmd;
union {
@@ -1915,6 +1922,10 @@ struct ec_params_motion_sense {
} fifo_read;
struct ec_motion_sense_activity set_activity;
+
+ /* Used for MOTIONSENSE_CMD_LID_ANGLE */
+ struct {
+ } lid_angle;
};
} __packed;
@@ -1978,6 +1989,16 @@ struct ec_response_motion_sense {
struct {
} set_activity;
+
+
+ /* Used for MOTIONSENSE_CMD_LID_ANGLE */
+ struct {
+ /*
+ * Angle between 0 and 360 degree if available,
+ * LID_ANGLE_UNRELIABLE otherwise.
+ */
+ uint16_t value;
+ } lid_angle;
};
} __packed;
diff --git a/include/motion_lid.h b/include/motion_lid.h
index b005688bb7..21803e6260 100644
--- a/include/motion_lid.h
+++ b/include/motion_lid.h
@@ -10,9 +10,6 @@
#include "host_command.h"
-/* Anything outside of lid angle range [-180, 180] should work. */
-#define LID_ANGLE_UNRELIABLE 500
-
/**
* This structure defines all of the data needed to specify the orientation
* of the base and lid accelerometers in order to calculate the lid angle.