From 39b605e9f271795e93823353a8cc204595770c99 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 15 Feb 2017 11:28:18 +0100 Subject: Add minimal fpc1140 driver Add a basic driver for FPC1140 sensor similar to the kernel fpc1020 driver. Signed-off-by: Vincent Palatin BRANCH=none BUG=b:35648259 TEST=on Eve, run the FP sensor 'int_test' with the FP MCU pass-through. Change-Id: Ib042b890b5848f66cf6ab9284fd26e7b641f68c1 Reviewed-on: https://chromium-review.googlesource.com/454700 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin Tested-by: Todd Broch Reviewed-by: Todd Broch --- board/eve_fp/board.c | 8 -------- board/eve_fp/board.h | 1 + board/eve_fp/ec.tasklist | 1 + board/eve_fp/gpio.inc | 6 +++--- 4 files changed, 5 insertions(+), 11 deletions(-) (limited to 'board') diff --git a/board/eve_fp/board.c b/board/eve_fp/board.c index 7ad2ab50b4..3390dbb359 100644 --- a/board/eve_fp/board.c +++ b/board/eve_fp/board.c @@ -16,14 +16,6 @@ #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) -/* Interrupt line from the fingerprint senser */ -void fps_event(enum gpio_signal signal) -{ - /* HACK: Forward interrupt to AP */ - gpio_set_level(GPIO_AP_INT, gpio_get_level(GPIO_FPS_INT)); - CPRINTS("FPS %d\n", gpio_get_level(GPIO_FPS_INT)); -} - /* SPI devices */ const struct spi_device_t spi_devices[] = { /* Fingerprint sensor */ diff --git a/board/eve_fp/board.h b/board/eve_fp/board.h index b8a9e1c51a..d764194a3c 100644 --- a/board/eve_fp/board.h +++ b/board/eve_fp/board.h @@ -26,6 +26,7 @@ #define CONFIG_CMD_SPI_XFER #define CONFIG_HOST_COMMAND_STATUS #undef CONFIG_LID_SWITCH +#define CONFIG_MKBP_EVENT #define CONFIG_SPI #define CONFIG_SPI_MASTER #define CONFIG_STM_HWTIMER32 diff --git a/board/eve_fp/ec.tasklist b/board/eve_fp/ec.tasklist index 27e9de03aa..7975f145a3 100644 --- a/board/eve_fp/ec.tasklist +++ b/board/eve_fp/ec.tasklist @@ -18,6 +18,7 @@ */ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(FPC1140, fp_task, NULL, TASK_STACK_SIZE) \ TASK_NOTEST(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) diff --git a/board/eve_fp/gpio.inc b/board/eve_fp/gpio.inc index ee8da2a179..930b35ab24 100644 --- a/board/eve_fp/gpio.inc +++ b/board/eve_fp/gpio.inc @@ -6,12 +6,12 @@ /* Declare symbolic names for all the GPIOs that we care about. * Note: Those with interrupt handlers must be declared first. */ -GPIO_INT(FPS_INT, PIN(A, 1), GPIO_INT_BOTH, fps_event) +GPIO_INT(FPS_INT, PIN(A, 2), GPIO_INT_RISING, fps_event) GPIO_INT(SPI1_NSS, PIN(A, 4), GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) /* Outputs */ -GPIO(AP_INT, PIN(A, 2), GPIO_ODR_HIGH | GPIO_PULL_UP) -GPIO(FP_RST_ODL, PIN(A, 3), GPIO_ODR_HIGH) +GPIO(EC_INT_L, PIN(A, 1), GPIO_ODR_HIGH | GPIO_PULL_UP) +GPIO(FP_RST_ODL, PIN(A, 3), GPIO_ODR_LOW) GPIO(SPI3_NSS, PIN(A, 15), GPIO_OUT_HIGH) /* Unimplemented signals which we need to emulate for now */ -- cgit v1.2.1