summaryrefslogtreecommitdiff
path: root/driver/fingerprint
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-06-12 11:27:22 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-06 19:49:10 +0000
commitd8181ef0bda7c7bd458348bd8f82a97da0278e16 (patch)
treed4097a3474cdc7615e704d089d8bc0ebc70bcccd /driver/fingerprint
parent8d89c3c0d8b5e9c5aed145d25343e04a4b81c156 (diff)
downloadchrome-ec-d8181ef0bda7c7bd458348bd8f82a97da0278e16.tar.gz
driver/fingerprint: Add fp_sensor_maintenance function
This function has always been in the fingerprint sensor binaries, but somewhere along the way we lost the the declaration. BRANCH=none BUG=b:76037094 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I06899f08c4a626f9d180ecdee6f73af0020b078c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321828 Reviewed-by: Yicheng Li <yichengli@chromium.org>
Diffstat (limited to 'driver/fingerprint')
-rw-r--r--driver/fingerprint/fpc/bep/fpc_private.h37
-rw-r--r--driver/fingerprint/fpc/libfp/fpc_private.h24
2 files changed, 61 insertions, 0 deletions
diff --git a/driver/fingerprint/fpc/bep/fpc_private.h b/driver/fingerprint/fpc/bep/fpc_private.h
new file mode 100644
index 0000000000..5334779672
--- /dev/null
+++ b/driver/fingerprint/fpc/bep/fpc_private.h
@@ -0,0 +1,37 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Private sensor interface */
+
+#ifndef __CROS_EC_FPC_PRIVATE_H
+#define __CROS_EC_FPC_PRIVATE_H
+
+#include <stdint.h>
+
+typedef struct {
+ uint32_t num_defective_pixels;
+} fp_sensor_info_t;
+
+/**
+ * fp_sensor_maintenance runs a test for defective pixels and should
+ * be triggered periodically by the client. Internally, a defective
+ * pixel list is maintained and the algorithm will compensate for
+ * any defect pixels when matching towards a template.
+ *
+ * The defective pixel update will abort and return an error if any of
+ * the finger detect zones are covered. A client can call
+ * fp_sensor_finger_status to determine the current status.
+ *
+ * @param[in] image_data pointer to FP_SENSOR_IMAGE_SIZE bytes of memory
+ * @param[out] fp_sensor_info Structure containing output data.
+ *
+ * @return
+ * - 0 on success
+ * - negative value on error
+ */
+int fp_sensor_maintenance(uint8_t *image_data,
+ fp_sensor_info_t *fp_sensor_info);
+
+#endif /* __CROS_EC_FPC_PRIVATE_H */
diff --git a/driver/fingerprint/fpc/libfp/fpc_private.h b/driver/fingerprint/fpc/libfp/fpc_private.h
index 6ec09ee0ee..18feff3a49 100644
--- a/driver/fingerprint/fpc/libfp/fpc_private.h
+++ b/driver/fingerprint/fpc/libfp/fpc_private.h
@@ -101,4 +101,28 @@ int fp_sensor_open(void *ctx, uint32_t ctx_size);
*/
const char *fp_sensor_get_version(void);
+typedef struct {
+ uint32_t num_defective_pixels;
+} fp_sensor_info_t;
+
+/**
+ * fp_sensor_maintenance runs a test for defective pixels and should
+ * be triggered periodically by the client. Internally, a defective
+ * pixel list is maintained and the algorithm will compensate for
+ * any defect pixels when matching towards a template.
+ *
+ * The defective pixel update will abort and return an error if any of
+ * the finger detect zones are covered. A client can call
+ * fp_sensor_finger_status to determine the current status.
+ *
+ * @param[in] image_data pointer to FP_SENSOR_IMAGE_SIZE bytes of memory
+ * @param[out] fp_sensor_info Structure containing output data.
+ *
+ * @return
+ * - 0 on success
+ * - negative value on error
+ */
+int fp_sensor_maintenance(uint8_t *image_data,
+ fp_sensor_info_t *fp_sensor_info);
+
#endif /* __CROS_EC_FPC_PRIVATE_H */