diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/big/board.c | 4 | ||||
-rw-r--r-- | board/big/gpio.inc | 3 | ||||
-rw-r--r-- | board/chell/board.c | 4 | ||||
-rw-r--r-- | board/chell/gpio.inc | 4 | ||||
-rw-r--r-- | board/glados/board.c | 3 | ||||
-rw-r--r-- | board/glados/gpio.inc | 3 | ||||
-rw-r--r-- | board/jerry/board.c | 5 | ||||
-rw-r--r-- | board/jerry/gpio.inc | 3 | ||||
-rw-r--r-- | board/kunimitsu/board.c | 3 | ||||
-rw-r--r-- | board/kunimitsu/gpio.inc | 3 | ||||
-rw-r--r-- | board/lars/board.c | 3 | ||||
-rw-r--r-- | board/lars/gpio.inc | 3 | ||||
-rw-r--r-- | board/llama/board.c | 3 | ||||
-rw-r--r-- | board/llama/gpio.inc | 3 | ||||
-rw-r--r-- | board/oak/board.c | 3 | ||||
-rw-r--r-- | board/oak/gpio.inc | 3 | ||||
-rw-r--r-- | board/pit/board.c | 4 | ||||
-rw-r--r-- | board/pit/gpio.inc | 3 | ||||
-rw-r--r-- | board/strago/board.c | 4 | ||||
-rw-r--r-- | board/strago/gpio.inc | 4 | ||||
-rw-r--r-- | board/wheatley/board.c | 3 |
21 files changed, 32 insertions, 39 deletions
diff --git a/board/big/board.c b/board/big/board.c index 037b115585..9ea56f474b 100644 --- a/board/big/board.c +++ b/board/big/board.c @@ -23,10 +23,6 @@ #include "util.h" #include "timer.h" #include "charger.h" - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - #include "gpio_list.h" /* power signal list. Must match order of enum power_signal. */ diff --git a/board/big/gpio.inc b/board/big/gpio.inc index ad80c47030..2ee4f16c06 100644 --- a/board/big/gpio.inc +++ b/board/big/gpio.inc @@ -5,6 +5,9 @@ * found in the LICENSE file. */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH + /* Inputs with interrupt handlers are first for efficiency */ GPIO_INT(POWER_BUTTON_L, PIN(B, 5), GPIO_INT_BOTH, power_button_interrupt) GPIO_INT(SOC1V8_XPSHOLD, PIN(A, 3), GPIO_INT_BOTH, power_signal_interrupt) diff --git a/board/chell/board.c b/board/chell/board.c index 759521eeb9..764dc393d5 100644 --- a/board/chell/board.c +++ b/board/chell/board.c @@ -41,10 +41,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) -#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) -#define GPIO_KB_OUTPUT_COL2 (GPIO_OUT_LOW) - #define I2C_ADDR_BD99992 0x60 /* Exchange status with PD MCU. */ diff --git a/board/chell/gpio.inc b/board/chell/gpio.inc index 5bb25820c5..4805b20496 100644 --- a/board/chell/gpio.inc +++ b/board/chell/gpio.inc @@ -79,6 +79,10 @@ GPIO(USB1_ENABLE, PIN(36), GPIO_OUT_LOW) GPIO(USB2_OTG_ID, PIN(13), GPIO_ODR_LOW) GPIO(USB2_OTG_VBUSSENSE, PIN(140), GPIO_OUT_LOW) +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) +#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) +#define GPIO_KB_OUTPUT_COL2 (GPIO_OUT_LOW) + /* Board version */ GPIO(BOARD_VERSION1, PIN(10), GPIO_INPUT) GPIO(BOARD_VERSION2, PIN(7), GPIO_INPUT) diff --git a/board/glados/board.c b/board/glados/board.c index 8bfd12a485..70ed60a5bb 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -47,9 +47,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) -#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) - #define I2C_ADDR_BD99992 0x60 /* Exchange status with PD MCU. */ diff --git a/board/glados/gpio.inc b/board/glados/gpio.inc index 6d97b5a047..a30f185764 100644 --- a/board/glados/gpio.inc +++ b/board/glados/gpio.inc @@ -123,6 +123,9 @@ GPIO(USB_C1_CHARGE_EN_L, PIN(210), GPIO_OUT_LOW) ALTERNATE(PIN_MASK(16, 0x24), 1, MODULE_UART, 0) /* KB pins */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) +#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) + /* KB ROW - GPIO000-GPIO005 */ ALTERNATE(PIN_MASK(0, 0x3f), 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT) /* KB ROW - GPIO100-GPIO104, GPIO106-GPIO107 */ diff --git a/board/jerry/board.c b/board/jerry/board.c index 10d3d75a4f..4fb7fcc6a3 100644 --- a/board/jerry/board.c +++ b/board/jerry/board.c @@ -23,13 +23,8 @@ #include "util.h" #include "timer.h" #include "charger.h" - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - #include "gpio_list.h" - /* power signal list. Must match order of enum power_signal. */ const struct power_signal_info power_signal_list[] = { {GPIO_SOC_POWER_GOOD, 1, "POWER_GOOD"}, diff --git a/board/jerry/gpio.inc b/board/jerry/gpio.inc index 0b698f8401..8d4581a461 100644 --- a/board/jerry/gpio.inc +++ b/board/jerry/gpio.inc @@ -14,6 +14,9 @@ GPIO_INT(SPI1_NSS, PIN(A, 4), GPIO_INT_BOTH, spi_event) GPIO_INT(AC_PRESENT, PIN(C, 6), GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) /* Keyboard inputs */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH + GPIO_INT(KB_IN00, PIN(C, 8), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN01, PIN(C, 9), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN02, PIN(C, 10), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) diff --git a/board/kunimitsu/board.c b/board/kunimitsu/board.c index 897d9b6cae..be6ac09550 100644 --- a/board/kunimitsu/board.c +++ b/board/kunimitsu/board.c @@ -49,9 +49,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) -#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) - #define TPS650830_I2C_ADDR TPS650830_I2C_ADDR1 /* Exchange status with PD MCU. */ diff --git a/board/kunimitsu/gpio.inc b/board/kunimitsu/gpio.inc index 5f95d8f9a1..531abc67ab 100644 --- a/board/kunimitsu/gpio.inc +++ b/board/kunimitsu/gpio.inc @@ -105,6 +105,9 @@ GPIO(CHARGE_LED2, PIN(156), GPIO_OUT_LOW) ALTERNATE(PIN_MASK(16, 0x24), 1, MODULE_UART, 0) /* KB pins */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) +#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) + /* KB ROW - GPIO000-GPIO005 */ ALTERNATE(PIN_MASK(0, 0x3f), 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT) /* KB ROW - GPIO100-GPIO104, GPIO106-GPIO107 */ diff --git a/board/lars/board.c b/board/lars/board.c index bf43208f5b..929828fb98 100644 --- a/board/lars/board.c +++ b/board/lars/board.c @@ -46,9 +46,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) -#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) - #define TPS650830_I2C_ADDR TPS650830_I2C_ADDR1 /* Exchange status with PD MCU. */ diff --git a/board/lars/gpio.inc b/board/lars/gpio.inc index 25dda4051e..00f28bd79b 100644 --- a/board/lars/gpio.inc +++ b/board/lars/gpio.inc @@ -112,6 +112,9 @@ ALTERNATE(PIN_MASK(11, 0x40), 1, MODULE_LPC, GPIO_INT_BOTH) ALTERNATE(PIN_MASK(12, 0x01), 1, MODULE_LPC, 0) /* KB pins */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) +#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) + /* KB ROW - GPIO000-GPIO005 */ ALTERNATE(PIN_MASK(0, 0x3f), 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT) /* KB ROW - GPIO100-GPIO104, GPIO106-GPIO107 */ diff --git a/board/llama/board.c b/board/llama/board.c index a8e422b4f9..625f53cdb2 100644 --- a/board/llama/board.c +++ b/board/llama/board.c @@ -27,9 +27,6 @@ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) #define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - #include "gpio_list.h" /* power signal list. Must match order of enum power_signal. */ diff --git a/board/llama/gpio.inc b/board/llama/gpio.inc index d49812445e..12e400c916 100644 --- a/board/llama/gpio.inc +++ b/board/llama/gpio.inc @@ -13,6 +13,9 @@ GPIO_INT(LID_OPEN, PIN(C, 13), GPIO_INT_BOTH, lid_interru GPIO_INT(SUSPEND_L, PIN(C, 7), GPIO_INT_BOTH, power_signal_interrupt) /* AP suspend/resume state */ /* Keyboard inputs */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH + GPIO_INT(KB_IN00, PIN(C, 8), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN01, PIN(C, 9), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN02, PIN(C, 10), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) diff --git a/board/oak/board.c b/board/oak/board.c index 065a7f62ea..f9166b7b15 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -44,9 +44,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - /* Dispaly port hardware can connect to port 0, 1 or neither. */ #define PD_PORT_NONE -1 diff --git a/board/oak/gpio.inc b/board/oak/gpio.inc index bb6b68fd56..5c5ebfd810 100644 --- a/board/oak/gpio.inc +++ b/board/oak/gpio.inc @@ -18,6 +18,9 @@ GPIO_INT(PD_MCU_INT, PIN(E, 0), GPIO_INT_FALLING, pd_mcu_i GPIO_INT(SPI1_NSS, PIN(A, 4), GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) /* SPI Chip Select */ /* Keyboard inputs */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH + GPIO_INT(KB_IN00, PIN(C, 8), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN01, PIN(C, 9), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN02, PIN(C, 10), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) diff --git a/board/pit/board.c b/board/pit/board.c index 7015a96d4f..20fd1ae256 100644 --- a/board/pit/board.c +++ b/board/pit/board.c @@ -20,10 +20,6 @@ #include "timer.h" #include "task.h" #include "util.h" - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - #include "gpio_list.h" /* Battery temperature ranges in degrees C */ diff --git a/board/pit/gpio.inc b/board/pit/gpio.inc index 0f9660dafc..28d9df97e4 100644 --- a/board/pit/gpio.inc +++ b/board/pit/gpio.inc @@ -16,6 +16,9 @@ GPIO_INT(SPI1_NSS, PIN(A, 4), GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) GPIO_INT(AC_PRESENT, PIN(A, 0), GPIO_INT_BOTH, extpower_interrupt) /* Keyboard inputs */ +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH + GPIO_INT(KB_IN00, PIN(C, 8), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN01, PIN(C, 9), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO_INT(KB_IN02, PIN(C, 10), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) diff --git a/board/strago/board.c b/board/strago/board.c index 97d5b77dde..6f49040a9f 100644 --- a/board/strago/board.c +++ b/board/strago/board.c @@ -44,10 +44,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) -#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) -#define GPIO_KB_OUTPUT_COL2 (GPIO_OUT_LOW) - /* Exchange status with PD MCU. */ static void pd_mcu_interrupt(enum gpio_signal signal) { diff --git a/board/strago/gpio.inc b/board/strago/gpio.inc index 9eaf13e783..2ca293e6be 100644 --- a/board/strago/gpio.inc +++ b/board/strago/gpio.inc @@ -28,6 +28,10 @@ GPIO_INT(PCH_SLP_S3_L, PIN(206), GPIO_INT_BOTH, power_ UNIMPLEMENTED(BAT_PRESENT_L) UNIMPLEMENTED(USB_PD_WAKE) +#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) +#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) +#define GPIO_KB_OUTPUT_COL2 (GPIO_OUT_LOW) + GPIO(NC_GPIO0, PIN(0), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(KBD_KSO2, PIN(1), GPIO_KB_OUTPUT_COL2) /* Negative edge triggered irq. */ diff --git a/board/wheatley/board.c b/board/wheatley/board.c index e0947fc933..c556741dd9 100644 --- a/board/wheatley/board.c +++ b/board/wheatley/board.c @@ -47,9 +47,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) -#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH) - #define I2C_ADDR_BD99992 0x60 /* Exchange status with PD MCU. */ |