diff options
author | Nicolas Norvez <norvez@chromium.org> | 2018-07-20 14:04:21 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-23 21:04:45 -0700 |
commit | 78cdc78b0255eef0e36cd1ce611d3e5dd016fc60 (patch) | |
tree | 3a946f262aab5c78c0c31a704bb2566977b54452 /util | |
parent | 2559377b62c67f65acb818feeb56a6022e1defd6 (diff) | |
download | chrome-ec-78cdc78b0255eef0e36cd1ce611d3e5dd016fc60.tar.gz |
ectool: Handle "Dead pixels: UNKNOWN" in "fpinfo"
The "Dead pixels" entry printed out after the "fpinfo" command is always
returning 0 because b/76037094 hasn't been implemented yet. This is
misleading since people assume that the feature has been implemented.
Use the special value 0x3FF to report "UNKNOWN" rather than 0 dead
pixels in that case.
Signed-off-by: Nicolas Norvez <norvez@chromium.org>
BRANCH=None
BUG=b:111695472
TEST=check output of "ectool --name=cros_fp fpinfo", both before and
after updating the firmware
Change-Id: I12b12123dbe95aa9b629a7c2747533571f0f99f0
Reviewed-on: https://chromium-review.googlesource.com/1145738
Commit-Ready: Nicolas Norvez <norvez@chromium.org>
Tested-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/util/ectool.c b/util/ectool.c index cc4aaa8bdc..f1de218278 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -1253,6 +1253,7 @@ int cmd_fp_info(int argc, char *argv[]) int cmdver = ec_cmd_version_supported(EC_CMD_FP_INFO, 1) ? 1 : 0; int rsize = cmdver == 1 ? sizeof(r) : sizeof(struct ec_response_fp_info_v0); + uint16_t dead; rv = ec_command(EC_CMD_FP_INFO, cmdver, NULL, 0, &r, rsize); if (rv < 0) @@ -1261,12 +1262,18 @@ int cmd_fp_info(int argc, char *argv[]) printf("Fingerprint sensor: vendor %x product %x model %x version %x\n", r.vendor_id, r.product_id, r.model_id, r.version); printf("Image: size %dx%d %d bpp\n", r.width, r.height, r.bpp); - printf("Error flags: %s%s%s%s\nDead pixels: %u\n", + printf("Error flags: %s%s%s%s\n", r.errors & FP_ERROR_NO_IRQ ? "NO_IRQ " : "", r.errors & FP_ERROR_SPI_COMM ? "SPI_COMM " : "", r.errors & FP_ERROR_BAD_HWID ? "BAD_HWID " : "", - r.errors & FP_ERROR_INIT_FAIL ? "INIT_FAIL " : "", - FP_ERROR_DEAD_PIXELS(r.errors)); + r.errors & FP_ERROR_INIT_FAIL ? "INIT_FAIL " : ""); + dead = FP_ERROR_DEAD_PIXELS(r.errors); + if (dead == FP_ERROR_DEAD_PIXELS_UNKNOWN) { + printf("Dead pixels: UNKNOWN\n"); + } else { + printf("Dead pixels: %u\n", dead); + } + if (cmdver == 1) { printf("Templates: size %d count %d/%d dirty bitmap %x\n", r.template_size, r.template_valid, r.template_max, |