summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2016-11-04 17:09:50 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-11-09 04:41:10 -0800
commit3857a3487340b246e66bcc3d146b36db0daf62e4 (patch)
treefa25bfa7364ef85dc3a2391c1813a1e5176956dd
parentde0f53afef1822cd32c917d91452ff6eec5fd17f (diff)
downloadchrome-ec-stabilize-8975.B.tar.gz
hammer: Add elan trackpad supportstabilize-8975.B
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 <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-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)