diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2013-12-10 10:33:12 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-12-13 02:44:10 +0000 |
commit | 22f82e28dc0788debd10499f2c93ab392cbb09bf (patch) | |
tree | d66049fdcc2a861d1b5af3ae6b2d1e08d0972e0e /board/mec1322_evb/board.c | |
parent | d3fdf5e6f3243484328d3d954a1924b355ff9c21 (diff) | |
download | chrome-ec-22f82e28dc0788debd10499f2c93ab392cbb09bf.tar.gz |
mec1322: keyboard scan support
This adds keyboard scan module driver. Keyboard scan task is not enabled
yet as the LPC layer is not finished and thus i8042 protocol cannot be
enabled.
Since KSO00-KSO03 are used as JTAG, we use KSO04-KSO16 so as to preserve
JTAG functionality. Unfortunately we don't have enough KSO pins, so
trace debug port must be disabled, as done in this CL.
BUG=chrome-os-partner:24107
TEST=Set 'ksstate on'. Short KSI pins and KSO pins, and see
corresponding key shown as pressed.
TEST=Check keypress is detected when console shows 'KB wait'.
BRANCH=None
Change-Id: I366a27453ef95030d251e525313eb4627eb4340f
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/179319
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'board/mec1322_evb/board.c')
-rw-r--r-- | board/mec1322_evb/board.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/board/mec1322_evb/board.c b/board/mec1322_evb/board.c index ced2c5ab27..f70fe5749d 100644 --- a/board/mec1322_evb/board.c +++ b/board/mec1322_evb/board.c @@ -10,6 +10,9 @@ #include "registers.h" #include "util.h" +#define GPIO_KB_INPUT GPIO_INPUT +#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH | GPIO_PULL_UP) + /* GPIO signal list. Must match order from enum gpio_signal. */ const struct gpio_info gpio_list[] = { {"LED1", GPIO_PORT(15), (1 << 4), GPIO_ODR_LOW, NULL}, @@ -28,6 +31,13 @@ const struct gpio_alt_func gpio_alt_funcs[] = { {GPIO_PORT(3), (1 << 4), 3, MODULE_PWM_FAN}, {GPIO_PORT(14), (1 << 0), 3, MODULE_PWM_FAN}, {GPIO_PORT(1), 0x60, 2, MODULE_I2C}, /* I2C0 */ + {GPIO_PORT(0), 0xfe, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT}, + {GPIO_PORT(1), 0x03, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT}, + {GPIO_PORT(3), 0x04, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT}, + {GPIO_PORT(4), 0x0d, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT}, + {GPIO_PORT(10), 0xd8, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT}, + {GPIO_PORT(12), 0x60, 2, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT}, + {GPIO_PORT(14), 0x14, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT}, }; const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); |