From 3857a3487340b246e66bcc3d146b36db0daf62e4 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Fri, 4 Nov 2016 17:09:50 +0800 Subject: hammer: Add elan trackpad support BRANCH=none BUG=chrome-os-partner:59083 TEST=make BOARD=hammer -j && bash flash_hammer Change-Id: I8b0e2f3e33f48622097ce698c9548d3e96ac75f1 Reviewed-on: https://chromium-review.googlesource.com/407741 Commit-Ready: Nicolas Boichat Tested-by: Nicolas Boichat Reviewed-by: Nicolas Boichat --- board/hammer/board.c | 2 +- board/hammer/board.h | 5 +++++ board/hammer/ec.tasklist | 1 + board/hammer/gpio.inc | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/board/hammer/board.c b/board/hammer/board.c index 3aef27269c..d993f1646b 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -6,6 +6,7 @@ #include "common.h" #include "ec_version.h" +#include "touchpad_elan.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" @@ -64,7 +65,6 @@ const struct section_descriptor board_rw_sections[] = { const struct section_descriptor * const rw_sections = board_rw_sections; const int num_rw_sections = ARRAY_SIZE(board_rw_sections); - /****************************************************************************** * Initialize board. */ diff --git a/board/hammer/board.h b/board/hammer/board.h index 37c014ec0b..846ef5ed91 100644 --- a/board/hammer/board.h +++ b/board/hammer/board.h @@ -68,6 +68,11 @@ #define CONFIG_SHA256 #define CONFIG_RSA_KEY_SIZE 2048 +/* Enable elan trackpad driver */ +#define CONFIG_TOUCHPAD_ELAN +#define CONFIG_TOUCHPAD_I2C_PORT 0 +#define CONFIG_TOUCHPAD_I2C_ADDR (0x15 << 1) + #ifndef __ASSEMBLER__ /* Timer selection */ diff --git a/board/hammer/ec.tasklist b/board/hammer/ec.tasklist index 73f46d37d4..fdac481907 100644 --- a/board/hammer/ec.tasklist +++ b/board/hammer/ec.tasklist @@ -18,4 +18,5 @@ */ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(TOUCHPAD, elan_tp_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) diff --git a/board/hammer/gpio.inc b/board/hammer/gpio.inc index 5825d08310..8bba90b5da 100644 --- a/board/hammer/gpio.inc +++ b/board/hammer/gpio.inc @@ -5,6 +5,11 @@ * found in the LICENSE file. */ +/* Declare symbolic names for all the GPIOs that we care about. + * Note: Those with interrupt handlers must be declared first. */ + +GPIO_INT(TOUCHPAD_INT, PIN(A, 1), GPIO_INT_FALLING | GPIO_PULL_UP, elan_tp_interrupt) + /* I2C pins should be configured as inputs until I2C module is */ /* initialized. This will avoid driving the lines unintentionally.*/ GPIO(MASTER_I2C_SCL, PIN(B, 8), GPIO_INPUT) -- cgit v1.2.1