diff options
author | Kevin K Wong <kevin.k.wong@intel.com> | 2015-11-18 23:59:42 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-25 18:15:38 -0800 |
commit | e24ac972e21d60a65d15e957605e8b78bd25e039 (patch) | |
tree | 51044b14b8c8b7b5966d7bd774f1499f55b931ef /common/motion_lid.c | |
parent | 767e132d133b6f1216d630bd3b59e893a59bcffa (diff) | |
download | chrome-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 'common/motion_lid.c')
-rw-r--r-- | common/motion_lid.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/motion_lid.c b/common/motion_lid.c index a563b1019b..df876563fe 100644 --- a/common/motion_lid.c +++ b/common/motion_lid.c @@ -233,6 +233,15 @@ int host_cmd_motion_lid(struct host_cmd_handler_args *args) break; + case MOTIONSENSE_CMD_LID_ANGLE: +#ifdef CONFIG_LID_ANGLE + out->lid_angle.value = motion_lid_get_angle(); + args->response_size = sizeof(out->lid_angle); +#else + return EC_RES_INVALID_PARAM; +#endif + break; + default: return EC_RES_INVALID_PARAM; } |