summaryrefslogtreecommitdiff
path: root/driver/fingerprint
diff options
context:
space:
mode:
Diffstat (limited to 'driver/fingerprint')
-rw-r--r--driver/fingerprint/elan/elan_private.c55
-rw-r--r--driver/fingerprint/elan/elan_sensor.h20
-rw-r--r--driver/fingerprint/elan/elan_sensor_pal.c3
-rw-r--r--driver/fingerprint/elan/elan_sensor_pal.h2
-rw-r--r--driver/fingerprint/fpc/bep/fpc1025_private.h12
-rw-r--r--driver/fingerprint/fpc/bep/fpc_private.c56
-rw-r--r--driver/fingerprint/fpc/fpc_sensor.c2
-rw-r--r--driver/fingerprint/fpc/libfp/fpc1145_private.h10
-rw-r--r--driver/fingerprint/fpc/libfp/fpc_private.c50
-rw-r--r--driver/fingerprint/fpsensor.h6
10 files changed, 71 insertions, 145 deletions
diff --git a/driver/fingerprint/elan/elan_private.c b/driver/fingerprint/elan/elan_private.c
index bb6fad4972..555ad14ba0 100644
--- a/driver/fingerprint/elan/elan_private.c
+++ b/driver/fingerprint/elan/elan_private.c
@@ -34,17 +34,17 @@ static struct ec_response_fp_info ec_fp_sensor_info = {
.model_id = MID,
.version = VERSION,
/* Image frame characteristics */
- .frame_size = FP_SENSOR_RES_X_ELAN * FP_SENSOR_RES_Y_ELAN,
+ .frame_size = FP_SENSOR_RES_X * FP_SENSOR_RES_Y,
.pixel_format = V4L2_PIX_FMT_GREY,
- .width = FP_SENSOR_RES_X_ELAN,
- .height = FP_SENSOR_RES_Y_ELAN,
+ .width = FP_SENSOR_RES_X,
+ .height = FP_SENSOR_RES_Y,
.bpp = FP_SENSOR_RES_BPP,
};
/**
* set fingerprint sensor into power saving mode
*/
-void fp_sensor_low_power_elan(void)
+void fp_sensor_low_power(void)
{
elan_woe_mode();
}
@@ -52,7 +52,7 @@ void fp_sensor_low_power_elan(void)
/**
* Reset and initialize the sensor IC
*/
-int fp_sensor_init_elan(void)
+int fp_sensor_init(void)
{
CPRINTF("========%s=======\n", __func__);
@@ -70,7 +70,7 @@ int fp_sensor_init_elan(void)
/**
* Deinitialize the sensor IC
*/
-int fp_sensor_deinit_elan(void)
+int fp_sensor_deinit(void)
{
CPRINTF("========%s=======\n", __func__);
return elan_fp_deinit();
@@ -83,7 +83,7 @@ int fp_sensor_deinit_elan(void)
*
* @return EC_SUCCESS on success otherwise error.
*/
-int fp_sensor_get_info_elan(struct ec_response_fp_info *resp)
+int fp_sensor_get_info(struct ec_response_fp_info *resp)
{
int ret = 0;
@@ -119,8 +119,8 @@ int fp_sensor_get_info_elan(struct ec_response_fp_info *resp)
* - EC_MKBP_FP_ERR_MATCH_LOW_COVERAGE when matching could not be performed
* due to finger covering too little area of the sensor
*/
-int fp_finger_match_elan(void *templ, uint32_t templ_count, uint8_t *image,
- int32_t *match_index, uint32_t *update_bitmap)
+int fp_finger_match(void *templ, uint32_t templ_count, uint8_t *image,
+ int32_t *match_index, uint32_t *update_bitmap)
{
CPRINTF("========%s=======\n", __func__);
return elan_match(templ, templ_count, image, match_index,
@@ -133,7 +133,7 @@ int fp_finger_match_elan(void *templ, uint32_t templ_count, uint8_t *image,
* @return 0 on success.
*
*/
-int fp_enrollment_begin_elan(void)
+int fp_enrollment_begin(void)
{
CPRINTF("========%s=======\n", __func__);
return elan_enrollment_begin();
@@ -149,7 +149,7 @@ int fp_enrollment_begin_elan(void)
*
* @return 0 on success or a negative error code.
*/
-int fp_enrollment_finish_elan(void *templ)
+int fp_enrollment_finish(void *templ)
{
CPRINTF("========%s=======\n", __func__);
return elan_enrollment_finish(templ);
@@ -170,7 +170,7 @@ int fp_enrollment_finish_elan(void *templ)
* - EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE when image could not be used due to
* finger covering too little area of the sensor
*/
-int fp_finger_enroll_elan(uint8_t *image, int *completion)
+int fp_finger_enroll(uint8_t *image, int *completion)
{
CPRINTF("========%s=======\n", __func__);
return elan_enroll(image, completion);
@@ -182,7 +182,7 @@ int fp_finger_enroll_elan(uint8_t *image, int *completion)
* fp_sensor_configure_detect needs to be called to restore finger detection
* functionality.
*/
-void fp_sensor_configure_detect_elan(void)
+void fp_sensor_configure_detect(void)
{
CPRINTF("========%s=======\n", __func__);
elan_woe_mode();
@@ -211,7 +211,7 @@ void fp_sensor_configure_detect_elan(void)
* - FP_SENSOR_TOO_FAST on finger removed before image was captured
* - FP_SENSOR_LOW_SENSOR_COVERAGE on sensor not fully covered by finger
*/
-int fp_sensor_acquire_image_with_mode_elan(uint8_t *image_data, int mode)
+int fp_sensor_acquire_image_with_mode(uint8_t *image_data, int mode)
{
CPRINTF("========%s=======\n", __func__);
return elan_sensor_acquire_image_with_mode(image_data, mode);
@@ -225,7 +225,7 @@ int fp_sensor_acquire_image_with_mode_elan(uint8_t *image_data, int mode)
* - FINGER_PARTIAL
* - FINGER_PRESENT
*/
-enum finger_state fp_sensor_finger_status_elan(void)
+enum finger_state fp_sensor_finger_status(void)
{
CPRINTF("========%s=======\n", __func__);
return elan_sensor_finger_status();
@@ -240,31 +240,8 @@ enum finger_state fp_sensor_finger_status_elan(void)
* @return EC_ERROR_HW_INTERNAL on error (such as finger on sensor)
* @return EC_SUCCESS on success
*/
-int fp_maintenance_elan(void)
+int fp_maintenance(void)
{
CPRINTF("========%s=======\n", __func__);
return elan_fp_maintenance(&errors);
}
-
-struct fp_sensor_interface fp_driver_elan = {
- .sensor_type = FP_SENSOR_TYPE_ELAN,
- .fp_sensor_init = &fp_sensor_init_elan,
- .fp_sensor_deinit = &fp_sensor_deinit_elan,
- .fp_sensor_get_info = &fp_sensor_get_info_elan,
- .fp_sensor_low_power = &fp_sensor_low_power_elan,
- .fp_sensor_configure_detect_ = &fp_sensor_configure_detect_elan,
- .fp_sensor_finger_status_ = &fp_sensor_finger_status_elan,
- .fp_sensor_acquire_image_with_mode_ =
- &fp_sensor_acquire_image_with_mode_elan,
- .fp_finger_enroll = &fp_finger_enroll_elan,
- .fp_finger_match = &fp_finger_match_elan,
- .fp_enrollment_begin = &fp_enrollment_begin_elan,
- .fp_enrollment_finish = &fp_enrollment_finish_elan,
- .fp_maintenance = &fp_maintenance_elan,
- .algorithm_template_size = FP_ALGORITHM_TEMPLATE_SIZE_ELAN,
- .encrypted_template_size =
- FP_ALGORITHM_TEMPLATE_SIZE_ELAN + FP_POSITIVE_MATCH_SALT_BYTES +
- sizeof(struct ec_fp_template_encryption_metadata),
- .res_x = FP_SENSOR_RES_X_ELAN,
- .res_y = FP_SENSOR_RES_Y_ELAN
-};
diff --git a/driver/fingerprint/elan/elan_sensor.h b/driver/fingerprint/elan/elan_sensor.h
index 7b6134817a..490b1acf16 100644
--- a/driver/fingerprint/elan/elan_sensor.h
+++ b/driver/fingerprint/elan/elan_sensor.h
@@ -9,23 +9,23 @@
/* Sensor pixel resolution */
#if defined(CONFIG_FP_SENSOR_ELAN80)
-#define FP_SENSOR_IMAGE_SIZE_ELAN (80 * 80)
-#define FP_SENSOR_RES_X_ELAN 80
-#define FP_SENSOR_RES_Y_ELAN 80
+#define FP_SENSOR_IMAGE_SIZE (80 * 80)
+#define FP_SENSOR_RES_X 80
+#define FP_SENSOR_RES_Y 80
#if defined(CHIP_FAMILY_STM32F4)
-#define FP_ALGORITHM_TEMPLATE_SIZE_ELAN 15000
+#define FP_ALGORITHM_TEMPLATE_SIZE 15000
#elif defined(CHIP_FAMILY_STM32H7)
-#define FP_ALGORITHM_TEMPLATE_SIZE_ELAN 40960
+#define FP_ALGORITHM_TEMPLATE_SIZE 40960
#endif
#define FP_MAX_FINGER_COUNT 3
#elif defined(CONFIG_FP_SENSOR_ELAN515)
-#define FP_SENSOR_IMAGE_SIZE_ELAN (52 * 150)
-#define FP_SENSOR_RES_X_ELAN 52
-#define FP_SENSOR_RES_Y_ELAN 150
+#define FP_SENSOR_IMAGE_SIZE (52 * 150)
+#define FP_SENSOR_RES_X 52
+#define FP_SENSOR_RES_Y 150
#if defined(CHIP_FAMILY_STM32F4)
-#define FP_ALGORITHM_TEMPLATE_SIZE_ELAN 15000
+#define FP_ALGORITHM_TEMPLATE_SIZE 15000
#elif defined(CHIP_FAMILY_STM32H7)
-#define FP_ALGORITHM_TEMPLATE_SIZE_ELAN 67000
+#define FP_ALGORITHM_TEMPLATE_SIZE 67000
#endif
#define FP_MAX_FINGER_COUNT 3
#endif
diff --git a/driver/fingerprint/elan/elan_sensor_pal.c b/driver/fingerprint/elan/elan_sensor_pal.c
index a185e655c4..b59368b835 100644
--- a/driver/fingerprint/elan/elan_sensor_pal.c
+++ b/driver/fingerprint/elan/elan_sensor_pal.c
@@ -225,8 +225,7 @@ int elan_fp_maintenance(uint16_t *error_state)
*error_state &= 0xFC00;
sensor_info.num_defective_pixels = 0;
sensor_info.sensor_error_code = 0;
- /* TODO(b/184289118): Rename to fp_sensor_maintenance_elan. */
- rv = elan_fp_sensor_maintenance(&sensor_info);
+ rv = fp_sensor_maintenance(&sensor_info);
LOGE_SA("Maintenance took %d ms", time_since32(start) / MSEC);
if (rv != 0) {
diff --git a/driver/fingerprint/elan/elan_sensor_pal.h b/driver/fingerprint/elan/elan_sensor_pal.h
index d47dd3bee0..067b693245 100644
--- a/driver/fingerprint/elan/elan_sensor_pal.h
+++ b/driver/fingerprint/elan/elan_sensor_pal.h
@@ -126,7 +126,7 @@ void elan_execute_reset(void);
* @return 0 on success.
* negative value on error.
*/
-int elan_fp_sensor_maintenance(fp_sensor_info_t *fp_sensor_info);
+int fp_sensor_maintenance(fp_sensor_info_t *fp_sensor_info);
/**
* @brief Set sensor reset state.
diff --git a/driver/fingerprint/fpc/bep/fpc1025_private.h b/driver/fingerprint/fpc/bep/fpc1025_private.h
index 42dc44130c..2da127741f 100644
--- a/driver/fingerprint/fpc/bep/fpc1025_private.h
+++ b/driver/fingerprint/fpc/bep/fpc1025_private.h
@@ -13,8 +13,8 @@
#define FP_SENSOR_NAME "FPC1025"
/* Sensor pixel resolution */
-#define FP_SENSOR_RES_X_FPC (160) /**< Sensor width */
-#define FP_SENSOR_RES_Y_FPC (160) /**< Sensor height */
+#define FP_SENSOR_RES_X (160) /**< Sensor width */
+#define FP_SENSOR_RES_Y (160) /**< Sensor height */
#define FP_SENSOR_RES_BPP (8) /**< Resolution bits per pixel */
/*
@@ -22,8 +22,8 @@
*
* Value from fpc_bep_image_get_buffer_size(): (160*160)+660
*/
-#define FP_SENSOR_IMAGE_SIZE_FPC (26260)
-#define FP_SENSOR_REAL_IMAGE_SIZE (FP_SENSOR_RES_X_FPC * FP_SENSOR_RES_Y_FPC)
+#define FP_SENSOR_IMAGE_SIZE (26260)
+#define FP_SENSOR_REAL_IMAGE_SIZE (FP_SENSOR_RES_X * FP_SENSOR_RES_Y)
/* Offset of image data in fp_buffer */
#define FP_SENSOR_IMAGE_OFFSET (400)
@@ -41,11 +41,9 @@
*
* Template size + alignment padding + size of template size variable
*/
-#define FP_ALGORITHM_TEMPLATE_SIZE_FPC (5088 + 0 + 4)
+#define FP_ALGORITHM_TEMPLATE_SIZE (5088 + 0 + 4)
/* Max number of templates stored / matched against */
-#ifndef FP_MAX_FINGER_COUNT
#define FP_MAX_FINGER_COUNT (5)
-#endif
#endif /* __CROS_EC_FPC1025_PRIVATE_H */
diff --git a/driver/fingerprint/fpc/bep/fpc_private.c b/driver/fingerprint/fpc/bep/fpc_private.c
index 7df21c223c..36ca0fe1b9 100644
--- a/driver/fingerprint/fpc/bep/fpc_private.c
+++ b/driver/fingerprint/fpc/bep/fpc_private.c
@@ -8,7 +8,6 @@
#include "fpc_bio_algorithm.h"
#include "fpsensor.h"
-#include "fpsensor_fpc.h"
#include "gpio.h"
#include "spi.h"
#include "system.h"
@@ -43,10 +42,10 @@ static struct ec_response_fp_info ec_fp_sensor_info = {
.model_id = 1,
.version = 1,
/* Image frame characteristics */
- .frame_size = FP_SENSOR_IMAGE_SIZE_FPC,
+ .frame_size = FP_SENSOR_IMAGE_SIZE,
.pixel_format = V4L2_PIX_FMT_GREY,
- .width = FP_SENSOR_RES_X_FPC,
- .height = FP_SENSOR_RES_Y_FPC,
+ .width = FP_SENSOR_RES_X,
+ .height = FP_SENSOR_RES_Y,
.bpp = FP_SENSOR_RES_BPP,
};
@@ -64,12 +63,12 @@ extern const fpc_bep_algorithm_t fpc_bep_algorithm_pfe_1025;
const fpc_sensor_info_t fpc_sensor_info = {
.sensor = &fpc_bep_sensor_1025,
- .image_buffer_size = FP_SENSOR_IMAGE_SIZE_FPC,
+ .image_buffer_size = FP_SENSOR_IMAGE_SIZE,
};
const fpc_bio_info_t fpc_bio_info = {
.algorithm = &fpc_bep_algorithm_pfe_1025,
- .template_size = FP_ALGORITHM_TEMPLATE_SIZE_FPC,
+ .template_size = FP_ALGORITHM_TEMPLATE_SIZE,
};
#elif defined(CONFIG_FP_SENSOR_FPC1035)
@@ -110,7 +109,7 @@ static int fpc_send_cmd(const uint8_t cmd)
SPI_READBACK_ALL);
}
-void fp_sensor_low_power_fpc(void)
+void fp_sensor_low_power(void)
{
fpc_send_cmd(FPC_CMD_DEEPSLEEP);
}
@@ -140,7 +139,7 @@ static int fpc_check_hwid(void)
}
/* Reset and initialize the sensor IC */
-int fp_sensor_init_fpc(void)
+int fp_sensor_init(void)
{
int rc;
@@ -173,13 +172,13 @@ int fp_sensor_init_fpc(void)
}
/* Go back to low power */
- fp_sensor_low_power_fpc();
+ fp_sensor_low_power();
return EC_SUCCESS;
}
/* Deinitialize the sensor IC */
-int fp_sensor_deinit_fpc(void)
+int fp_sensor_deinit(void)
{
int rc;
@@ -194,7 +193,7 @@ int fp_sensor_deinit_fpc(void)
return rc;
}
-int fp_sensor_get_info_fpc(struct ec_response_fp_info *resp)
+int fp_sensor_get_info(struct ec_response_fp_info *resp)
{
int rc;
@@ -213,8 +212,8 @@ int fp_sensor_get_info_fpc(struct ec_response_fp_info *resp)
return EC_SUCCESS;
}
-int fp_finger_match_fpc(void *templ, uint32_t templ_count, uint8_t *image,
- int32_t *match_index, uint32_t *update_bitmap)
+int fp_finger_match(void *templ, uint32_t templ_count, uint8_t *image,
+ int32_t *match_index, uint32_t *update_bitmap)
{
int rc;
@@ -227,7 +226,7 @@ int fp_finger_match_fpc(void *templ, uint32_t templ_count, uint8_t *image,
return rc;
}
-int fp_enrollment_begin_fpc(void)
+int fp_enrollment_begin(void)
{
int rc;
bio_enrollment_t bio_enroll = enroll_ctx;
@@ -239,7 +238,7 @@ int fp_enrollment_begin_fpc(void)
return rc;
}
-int fp_enrollment_finish_fpc(void *templ)
+int fp_enrollment_finish(void *templ)
{
int rc;
bio_enrollment_t bio_enroll = enroll_ctx;
@@ -252,7 +251,7 @@ int fp_enrollment_finish_fpc(void *templ)
return rc;
}
-int fp_finger_enroll_fpc(uint8_t *image, int *completion)
+int fp_finger_enroll(uint8_t *image, int *completion)
{
int rc;
bio_enrollment_t bio_enroll = enroll_ctx;
@@ -269,30 +268,7 @@ int fp_finger_enroll_fpc(uint8_t *image, int *completion)
return rc;
}
-int fp_maintenance_fpc(void)
+int fp_maintenance(void)
{
return fpc_fp_maintenance(&errors);
}
-
-struct fp_sensor_interface fp_driver_fpc = {
- .sensor_type = FP_SENSOR_TYPE_FPC,
- .fp_sensor_init = &fp_sensor_init_fpc,
- .fp_sensor_deinit = &fp_sensor_deinit_fpc,
- .fp_sensor_get_info = &fp_sensor_get_info_fpc,
- .fp_sensor_low_power = &fp_sensor_low_power_fpc,
- .fp_sensor_configure_detect_ = &fp_sensor_configure_detect,
- .fp_sensor_finger_status_ = &fp_sensor_finger_status,
- .fp_sensor_acquire_image_with_mode_ =
- &fp_sensor_acquire_image_with_mode,
- .fp_finger_enroll = &fp_finger_enroll_fpc,
- .fp_finger_match = &fp_finger_match_fpc,
- .fp_enrollment_begin = &fp_enrollment_begin_fpc,
- .fp_enrollment_finish = &fp_enrollment_finish_fpc,
- .fp_maintenance = &fp_maintenance_fpc,
- .algorithm_template_size = FP_ALGORITHM_TEMPLATE_SIZE_FPC,
- .encrypted_template_size =
- FP_ALGORITHM_TEMPLATE_SIZE_FPC + FP_POSITIVE_MATCH_SALT_BYTES +
- sizeof(struct ec_fp_template_encryption_metadata),
- .res_x = FP_SENSOR_RES_X_FPC,
- .res_y = FP_SENSOR_RES_Y_FPC
-};
diff --git a/driver/fingerprint/fpc/fpc_sensor.c b/driver/fingerprint/fpc/fpc_sensor.c
index 9184492382..a15502521f 100644
--- a/driver/fingerprint/fpc/fpc_sensor.c
+++ b/driver/fingerprint/fpc/fpc_sensor.c
@@ -33,7 +33,7 @@ int fpc_fp_maintenance(uint16_t *error_state)
if (error_state == NULL)
return EC_ERROR_INVAL;
- rv = fp_sensor_maintenance((uint8_t *)&fp_buffer, &sensor_info);
+ rv = fp_sensor_maintenance(fp_buffer, &sensor_info);
CPRINTS("Maintenance took %d ms", time_since32(start) / MSEC);
if (rv != 0) {
diff --git a/driver/fingerprint/fpc/libfp/fpc1145_private.h b/driver/fingerprint/fpc/libfp/fpc1145_private.h
index 69984c864a..399c75118b 100644
--- a/driver/fingerprint/fpc/libfp/fpc1145_private.h
+++ b/driver/fingerprint/fpc/libfp/fpc1145_private.h
@@ -21,9 +21,9 @@
#define FP_SENSOR_NAME "FPC1145"
/* Sensor pixel resolution */
-#define FP_SENSOR_RES_Y_FPC 192
-#define FP_SENSOR_RES_X_FPC 56
-#define FP_SENSOR_RES_BPP 8
+#define FP_SENSOR_RES_Y 192
+#define FP_SENSOR_RES_X 56
+#define FP_SENSOR_RES_BPP 8
/* Acquired finger frame definitions */
#define FP_SENSOR_IMAGE_SIZE_MODE_VENDOR (35460)
@@ -35,7 +35,7 @@
*/
#define FP_SENSOR_IMAGE_SIZE_MODE_QUAL (24408)
-#define FP_SENSOR_IMAGE_SIZE_FPC FP_SENSOR_IMAGE_SIZE_MODE_VENDOR
+#define FP_SENSOR_IMAGE_SIZE FP_SENSOR_IMAGE_SIZE_MODE_VENDOR
#define FP_SENSOR_IMAGE_OFFSET 2340
/* Opaque FPC context */
@@ -43,7 +43,7 @@
/* Algorithm buffer sizes */
#define FP_ALGORITHM_ENROLLMENT_SIZE 28
-#define FP_ALGORITHM_TEMPLATE_SIZE_FPC 47552
+#define FP_ALGORITHM_TEMPLATE_SIZE 47552
/* Max number of templates stored / matched against */
#define FP_MAX_FINGER_COUNT 5
diff --git a/driver/fingerprint/fpc/libfp/fpc_private.c b/driver/fingerprint/fpc/libfp/fpc_private.c
index a20ff858d3..8c11849c8f 100644
--- a/driver/fingerprint/fpc/libfp/fpc_private.c
+++ b/driver/fingerprint/fpc/libfp/fpc_private.c
@@ -10,7 +10,6 @@
#include "fpc_bio_algorithm.h"
#include "fpc_private.h"
#include "fpsensor.h"
-#include "fpsensor_fpc.h"
#include "gpio.h"
#include "link_defs.h"
#include "spi.h"
@@ -56,10 +55,10 @@ static struct ec_response_fp_info fpc1145_info = {
.model_id = 1,
.version = 1,
/* Image frame characteristics */
- .frame_size = FP_SENSOR_IMAGE_SIZE_FPC,
+ .frame_size = FP_SENSOR_IMAGE_SIZE,
.pixel_format = V4L2_PIX_FMT_GREY,
- .width = FP_SENSOR_RES_X_FPC,
- .height = FP_SENSOR_RES_Y_FPC,
+ .width = FP_SENSOR_RES_X,
+ .height = FP_SENSOR_RES_Y,
.bpp = FP_SENSOR_RES_BPP,
};
@@ -88,7 +87,7 @@ static int fpc_send_cmd(const uint8_t cmd)
SPI_READBACK_ALL);
}
-void fp_sensor_low_power_fpc(void)
+void fp_sensor_low_power(void)
{
/*
* TODO(b/117620462): verify that sleep mode is WAI (no increased
@@ -176,7 +175,7 @@ static int fpc_pulse_hw_reset(void)
}
/* Reset and initialize the sensor IC */
-int fp_sensor_init_fpc(void)
+int fp_sensor_init(void)
{
int res;
int attempt;
@@ -246,13 +245,13 @@ int fp_sensor_init_fpc(void)
errors |= FP_ERROR_INIT_FAIL;
/* Go back to low power */
- fp_sensor_low_power_fpc();
+ fp_sensor_low_power();
return EC_SUCCESS;
}
/* Deinitialize the sensor IC */
-int fp_sensor_deinit_fpc(void)
+int fp_sensor_deinit(void)
{
/*
* TODO(tomhughes): libfp doesn't have fp_sensor_close like BEP does.
@@ -263,7 +262,7 @@ int fp_sensor_deinit_fpc(void)
return EC_SUCCESS;
}
-int fp_sensor_get_info_fpc(struct ec_response_fp_info *resp)
+int fp_sensor_get_info(struct ec_response_fp_info *resp)
{
int rc;
@@ -280,14 +279,14 @@ int fp_sensor_get_info_fpc(struct ec_response_fp_info *resp)
return EC_SUCCESS;
}
-int fp_finger_match_fpc(void *templ, uint32_t templ_count, uint8_t *image,
+int fp_finger_match(void *templ, uint32_t templ_count, uint8_t *image,
int32_t *match_index, uint32_t *update_bitmap)
{
return bio_template_image_match_list(templ, templ_count, image,
match_index, update_bitmap);
}
-int fp_enrollment_begin_fpc(void)
+int fp_enrollment_begin(void)
{
int rc;
bio_enrollment_t p = enroll_ctx;
@@ -298,14 +297,14 @@ int fp_enrollment_begin_fpc(void)
return rc;
}
-int fp_enrollment_finish_fpc(void *templ)
+int fp_enrollment_finish(void *templ)
{
bio_template_t pt = templ;
return bio_enrollment_finish(enroll_ctx, templ ? &pt : NULL);
}
-int fp_finger_enroll_fpc(uint8_t *image, int *completion)
+int fp_finger_enroll(uint8_t *image, int *completion)
{
int rc = bio_enrollment_add_image(enroll_ctx, image);
@@ -315,30 +314,7 @@ int fp_finger_enroll_fpc(uint8_t *image, int *completion)
return rc;
}
-int fp_maintenance_fpc(void)
+int fp_maintenance(void)
{
return fpc_fp_maintenance(&errors);
}
-
-struct fp_sensor_interface fp_driver_fpc = {
- .sensor_type = FP_SENSOR_TYPE_FPC,
- .fp_sensor_init = &fp_sensor_init_fpc,
- .fp_sensor_deinit = &fp_sensor_deinit_fpc,
- .fp_sensor_get_info = &fp_sensor_get_info_fpc,
- .fp_sensor_low_power = &fp_sensor_low_power_fpc,
- .fp_sensor_configure_detect_ = &fp_sensor_configure_detect,
- .fp_sensor_finger_status_ = &fp_sensor_finger_status,
- .fp_sensor_acquire_image_with_mode_ =
- &fp_sensor_acquire_image_with_mode,
- .fp_finger_enroll = &fp_finger_enroll_fpc,
- .fp_finger_match = &fp_finger_match_fpc,
- .fp_enrollment_begin = &fp_enrollment_begin_fpc,
- .fp_enrollment_finish = &fp_enrollment_finish_fpc,
- .fp_maintenance = &fp_maintenance_fpc,
- .algorithm_template_size = FP_ALGORITHM_TEMPLATE_SIZE_FPC,
- .encrypted_template_size =
- FP_ALGORITHM_TEMPLATE_SIZE_FPC + FP_POSITIVE_MATCH_SALT_BYTES +
- sizeof(struct ec_fp_template_encryption_metadata),
- .res_x = FP_SENSOR_RES_X_FPC,
- .res_y = FP_SENSOR_RES_Y_FPC
-};
diff --git a/driver/fingerprint/fpsensor.h b/driver/fingerprint/fpsensor.h
index 9827c2caf6..ac7e31fb6a 100644
--- a/driver/fingerprint/fpsensor.h
+++ b/driver/fingerprint/fpsensor.h
@@ -10,15 +10,15 @@
#define HAVE_FP_PRIVATE_DRIVER
#if defined(CONFIG_FP_SENSOR_ELAN80) || defined(CONFIG_FP_SENSOR_ELAN515)
#include "elan/elan_sensor.h"
-#endif
-#if defined(CONFIG_FP_SENSOR_FPC1025) || defined(CONFIG_FP_SENSOR_FPC1035) || \
- defined(CONFIG_FP_SENSOR_FPC1145)
+#else
#include "fpc/fpc_sensor.h"
#endif
#else
/* These values are used by the host (emulator) tests. */
+#define FP_SENSOR_IMAGE_SIZE 0
#define FP_SENSOR_RES_X 0
#define FP_SENSOR_RES_Y 0
+#define FP_ALGORITHM_TEMPLATE_SIZE 0
#define FP_MAX_FINGER_COUNT 5
#endif