summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2019-09-06 15:58:44 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-02 11:32:35 +0000
commit4f71afc84acc79f137ee086220743c3c42096f90 (patch)
tree36932a50fe1a7be15383804c4f82ff091b46b57b /include/ec_commands.h
parent63f8741f4605b163c06a3629da890c12051c3d7f (diff)
downloadchrome-ec-4f71afc84acc79f137ee086220743c3c42096f90.tar.gz
fpsensor: Add async FP_CMD_CONTEXT
Setting the context now triggers a reset of the sensor library (see I3e25bdf7eaaf99f3801547e11a6c524f924f4726), which in turn will end up calling fp_sensor_open to re-initialize the sensor. Since some calibration is performed in that command, it takes ~173 ms, which is close enough to the EC command timeout (200 ms) that it often fails. This change makes the command "asynchronous" so that userspace can poll for the result and avoid the command timeout. BRANCH=nocturne BUG=b:137288498 TEST=make buildall -j TEST=ectool --name=cros_fp fpcontext 01234567890123456789012345678901 Change-Id: I997bf9c5b9e90eceb5375dccffcb535529a86e47 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819115 Reviewed-by: Yicheng Li <yichengli@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 2ce5ca5271..f813b5e629 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -5917,6 +5917,18 @@ struct ec_params_fp_context {
uint32_t userid[FP_CONTEXT_USERID_WORDS];
} __ec_align4;
+enum fp_context_action {
+ FP_CONTEXT_ASYNC = 0,
+ FP_CONTEXT_GET_RESULT = 1,
+};
+
+/* Version 1 of the command is "asynchronous". */
+struct ec_params_fp_context_v1 {
+ uint8_t action; /**< enum fp_context_action */
+ uint8_t reserved[3]; /**< padding for alignment */
+ uint32_t userid[FP_CONTEXT_USERID_WORDS];
+} __ec_align4;
+
#define EC_CMD_FP_STATS 0x0407
#define FPSTATS_CAPTURE_INV BIT(0)