summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/hammer/board.c2
-rw-r--r--board/hammer/board.h5
-rw-r--r--board/hammer/ec.tasklist1
-rw-r--r--board/hammer/gpio.inc5
4 files changed, 12 insertions, 1 deletions
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)