summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2018-09-21 16:06:13 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-12-08 02:41:02 +0000
commit6379d291250c270117f0a680f3bfe287621997f0 (patch)
tree8939017093137d806b1162b4439d94fb582df610
parent9e8d13b5217c3d2818fcaa8e3be4c360bc2b5bc9 (diff)
downloadchrome-ec-6379d291250c270117f0a680f3bfe287621997f0.tar.gz
fpsensor: Add support for sensor reset command
Update the "reset_sensor" option of the FP_MODE EC command to actually reset the FP sensor. A reset_sensor is essentially the same as performing a re-initialization of the sensor, so this amounts to calling fp_sensor_init() again. BUG=b:110805729 BRANCH=nocturne TEST=Run updated biod and inspect cros_fp.log to ensure that the sensor reinitialization code runs after login. Change-Id: Ib639b64089368b38db154da4a99d4def70c48229 Signed-off-by: Prashant Malani <pmalani@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1239623 Commit-Ready: Nicolas Norvez <norvez@chromium.org> Tested-by: Nicolas Norvez <norvez@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1364321 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org>
-rw-r--r--include/ec_commands.h3
-rw-r--r--util/ectool.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 57e2c0d5de..e94b0c28d5 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -4886,6 +4886,8 @@ struct __ec_align2 ec_params_fp_passthru {
#define FP_MODE_ENROLL_IMAGE (1<<5)
/* Try to match the current finger image */
#define FP_MODE_MATCH (1<<6)
+/* Reset and re-initialize the sensor. */
+#define FP_MODE_RESET_SENSOR (1<<7)
/* special value: don't change anything just read back current mode */
#define FP_MODE_DONT_CHANGE (1<<31)
@@ -4896,6 +4898,7 @@ struct __ec_align2 ec_params_fp_passthru {
FP_MODE_ENROLL_SESSION | \
FP_MODE_ENROLL_IMAGE | \
FP_MODE_MATCH | \
+ FP_MODE_RESET_SENSOR | \
FP_MODE_DONT_CHANGE)
/* Capture types defined in bits [30..28] */
diff --git a/util/ectool.c b/util/ectool.c
index 3471d3406c..1baff35ad1 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1288,6 +1288,8 @@ int cmd_fp_mode(int argc, char *argv[])
mode |= FP_MODE_ENROLL_IMAGE | FP_MODE_ENROLL_SESSION;
else if (!strncmp(argv[i], "match", 5))
mode |= FP_MODE_MATCH;
+ else if (!strncmp(argv[i], "reset_sensor", 12))
+ mode = FP_MODE_RESET_SENSOR;
else if (!strncmp(argv[i], "reset", 5))
mode = 0;
else if (!strncmp(argv[i], "capture", 7))