Commit 716bf50e authored by Gwendal Grignou's avatar Gwendal Grignou Committed by Lee Jones

mfd: cros_ec: Add fingerprint API

Add support for fingerprint sensors managed by embedded controller.
Signed-off-by: default avatarGwendal Grignou <gwendal@chromium.org>
Acked-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: default avatarBenson Leung <bleung@chromium.org>
Reviewed-by: default avatarFabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 784dd15c
...@@ -3339,6 +3339,40 @@ struct ec_response_get_next_event_v1 { ...@@ -3339,6 +3339,40 @@ struct ec_response_get_next_event_v1 {
#define EC_MKBP_TABLET_MODE 1 #define EC_MKBP_TABLET_MODE 1
#define EC_MKBP_BASE_ATTACHED 2 #define EC_MKBP_BASE_ATTACHED 2
/* Fingerprint events in 'fp_events' for EC_MKBP_EVENT_FINGERPRINT */
#define EC_MKBP_FP_RAW_EVENT(fp_events) ((fp_events) & 0x00FFFFFF)
#define EC_MKBP_FP_ERRCODE(fp_events) ((fp_events) & 0x0000000F)
#define EC_MKBP_FP_ENROLL_PROGRESS_OFFSET 4
#define EC_MKBP_FP_ENROLL_PROGRESS(fpe) (((fpe) & 0x00000FF0) \
>> EC_MKBP_FP_ENROLL_PROGRESS_OFFSET)
#define EC_MKBP_FP_MATCH_IDX_OFFSET 12
#define EC_MKBP_FP_MATCH_IDX_MASK 0x0000F000
#define EC_MKBP_FP_MATCH_IDX(fpe) (((fpe) & EC_MKBP_FP_MATCH_IDX_MASK) \
>> EC_MKBP_FP_MATCH_IDX_OFFSET)
#define EC_MKBP_FP_ENROLL BIT(27)
#define EC_MKBP_FP_MATCH BIT(28)
#define EC_MKBP_FP_FINGER_DOWN BIT(29)
#define EC_MKBP_FP_FINGER_UP BIT(30)
#define EC_MKBP_FP_IMAGE_READY BIT(31)
/* code given by EC_MKBP_FP_ERRCODE() when EC_MKBP_FP_ENROLL is set */
#define EC_MKBP_FP_ERR_ENROLL_OK 0
#define EC_MKBP_FP_ERR_ENROLL_LOW_QUALITY 1
#define EC_MKBP_FP_ERR_ENROLL_IMMOBILE 2
#define EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE 3
#define EC_MKBP_FP_ERR_ENROLL_INTERNAL 5
/* Can be used to detect if image was usable for enrollment or not. */
#define EC_MKBP_FP_ERR_ENROLL_PROBLEM_MASK 1
/* code given by EC_MKBP_FP_ERRCODE() when EC_MKBP_FP_MATCH is set */
#define EC_MKBP_FP_ERR_MATCH_NO 0
#define EC_MKBP_FP_ERR_MATCH_NO_INTERNAL 6
#define EC_MKBP_FP_ERR_MATCH_NO_TEMPLATES 7
#define EC_MKBP_FP_ERR_MATCH_NO_LOW_QUALITY 2
#define EC_MKBP_FP_ERR_MATCH_NO_LOW_COVERAGE 4
#define EC_MKBP_FP_ERR_MATCH_YES 1
#define EC_MKBP_FP_ERR_MATCH_YES_UPDATED 3
#define EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED 5
/*****************************************************************************/ /*****************************************************************************/
/* Temperature sensor commands */ /* Temperature sensor commands */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment