diff options
author | Scott Collyer <scollyer@google.com> | 2018-12-19 11:05:59 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-30 13:06:36 -0800 |
commit | f0efcfb98fa5fca8a7c56b10ea48b808cc0f144a (patch) | |
tree | 669b3c983412c2ff8e28882646179f5e3b72b094 /board | |
parent | 01f8d598f8bbd5f9d7400d17284e3dbac270d491 (diff) | |
download | chrome-ec-f0efcfb98fa5fca8a7c56b10ea48b808cc0f144a.tar.gz |
hatch: Add support for keyboard scan
This CL adds config options and GPIO alternate function definitions
required for adding keyboard scan functionality.
BRANCH=none
BUG=b:122251649
TEST=make buildall
Change-Id: I9511f936e12d25276fa2685afbf7edaa6330d2cf
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1387589
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Zack Yang <zack_yang@compal.corp-partner.google.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/hatch/ec.tasklist | 1 | ||||
-rw-r--r-- | board/hatch/gpio.inc | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/board/hatch/ec.tasklist b/board/hatch/ec.tasklist index 912bcdc2b7..c7d1ef8c9e 100644 --- a/board/hatch/ec.tasklist +++ b/board/hatch/ec.tasklist @@ -29,6 +29,7 @@ TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, TASK_STACK_SIZE) \ diff --git a/board/hatch/gpio.inc b/board/hatch/gpio.inc index 49f47a5166..d277cf7fac 100644 --- a/board/hatch/gpio.inc +++ b/board/hatch/gpio.inc @@ -73,6 +73,16 @@ GPIO(I2C5_SDA, PIN(3, 6), GPIO_INPUT) /* EC_I2C_POWER_ GPIO(I2C7_SCL, PIN(B, 3), GPIO_INPUT) /* EC_I2C_EEPROM_SCL */ GPIO(I2C7_SDA, PIN(B, 2), GPIO_INPUT) /* EC_I2C_EEPROM_SDA */ +/* Keyboard pins */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) +GPIO(KBD_KSO2, PIN(1, 7), GPIO_OUT_LOW) /* KSO_02 inverted */ +ALTERNATE(PIN_MASK(3, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT) /* KSI_00-01 */ +ALTERNATE(PIN_MASK(2, 0xFC), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT) /* KSI_02-07 */ +ALTERNATE(PIN_MASK(2, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_00-01 */ +ALTERNATE(PIN_MASK(1, 0x7F), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_03-09 */ +ALTERNATE(PIN_MASK(0, 0xF0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_10-13 */ +ALTERNATE(PIN_MASK(8, 0x04), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_14 */ + /* Alternate functions GPIO definitions */ ALTERNATE(PIN_MASK(B, 0x30), 0, MODULE_I2C, (GPIO_INPUT | GPIO_SEL_1P8V)) /* I2C0 1.8V */ ALTERNATE(PIN_MASK(9, 0x07), 0, MODULE_I2C, 0) /* I2C1 SCL / I2C2 */ |