diff options
author | David Hendricks <dhendrix@chromium.org> | 2012-05-15 11:40:20 -0700 |
---|---|---|
committer | David Hendricks <dhendrix@chromium.org> | 2012-05-15 16:47:43 -0700 |
commit | dd839d851aa6369a81423da9d59762950f21c592 (patch) | |
tree | 5b133759a0a42d6e1d02ee864a95a7a94a6ea33d | |
parent | db803efd3f947bcbd5bb1caa8949f7c4d3e59b0f (diff) | |
download | chrome-ec-dd839d851aa6369a81423da9d59762950f21c592.tar.gz |
daisy/snow: seperate EC_INT and CODEC_INT handling
This patch splits apart EC_INT and CODEC_INT handling for two reasons:
1. Allow other tasks to interrupt the AP without triggering
the keyboard noise suppression.
2. Allow more work to be done after a keystroke is detected but
before interrupting the AP. This is intended to prevent latency
issues with the noise suppression.
Also, Snow does not currently have CODEC_INT hooked up, so it
does not need the extra function for suppressing keystroke noise.
BUG=chrome-os-partner:9594
TEST=tested on daisy (keys still respond), locally compiled for snow.
Change-Id: I73bd42bb7263005b11724337162646092292556f
Signed-off-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r-- | board/daisy/board.c | 13 | ||||
-rw-r--r-- | board/daisy/board.h | 5 | ||||
-rw-r--r-- | board/snow/board.c | 8 | ||||
-rw-r--r-- | board/snow/board.h | 4 | ||||
-rw-r--r-- | chip/stm32/keyboard_scan.c | 10 |
5 files changed, 20 insertions, 20 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c index 21ccdada28..56dbef212f 100644 --- a/board/daisy/board.c +++ b/board/daisy/board.c @@ -135,13 +135,16 @@ void configure_board(void) gpio_set_level(GPIO_EC_INT, 1); } -void board_keyboard_scan_ready(void) +void board_interrupt_host(void) { - /* notify audio codec of keypress for noise suppression */ - gpio_set_level(GPIO_CODEC_INT, 0); - gpio_set_level(GPIO_CODEC_INT, 1); - /* interrupt host by toggling EC_INT */ gpio_set_level(GPIO_EC_INT, 0); gpio_set_level(GPIO_EC_INT, 1); } + +void board_keyboard_suppress_noise(void) +{ + /* notify audio codec of keypress for noise suppression */ + gpio_set_level(GPIO_CODEC_INT, 0); + gpio_set_level(GPIO_CODEC_INT, 1); +} diff --git a/board/daisy/board.h b/board/daisy/board.h index f06a4cf86a..deb8de1e14 100644 --- a/board/daisy/board.h +++ b/board/daisy/board.h @@ -75,6 +75,9 @@ void configure_board(void); void matrix_interrupt(enum gpio_signal signal); /* Signal to the AP that keyboard scan data is available */ -void board_keyboard_scan_ready(void); +void board_keyboard_suppress_noise(void); + +/* Signal to AP that data is waiting */ +void board_interrupt_host(void); #endif /* __BOARD_H */ diff --git a/board/snow/board.c b/board/snow/board.c index bb5de7b2af..a602fe2ca5 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -107,14 +107,8 @@ void configure_board(void) gpio_set_level(GPIO_EC_INT, 1); } -void board_keyboard_scan_ready(void) +void board_interrupt_host(void) { -#if 0 - /* notify audio codec of keypress for noise suppression */ - gpio_set_level(GPIO_CODEC_INT, 0); - gpio_set_level(GPIO_CODEC_INT, 1); -#endif - /* interrupt host by toggling EC_INT */ gpio_set_level(GPIO_EC_INT, 0); gpio_set_level(GPIO_EC_INT, 1); diff --git a/board/snow/board.h b/board/snow/board.h index 6192fc1ce6..7d4a1fd3b5 100644 --- a/board/snow/board.h +++ b/board/snow/board.h @@ -66,7 +66,7 @@ void configure_board(void); void matrix_interrupt(enum gpio_signal signal); -/* Signal to the AP that keyboard scan data is available */ -void board_keyboard_scan_ready(void); +/* Signal to AP that data is waiting */ +void board_interrupt_host(void); #endif /* __BOARD_H */ diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c index 453dc10af9..1338f1b889 100644 --- a/chip/stm32/keyboard_scan.c +++ b/chip/stm32/keyboard_scan.c @@ -69,13 +69,12 @@ static const uint32_t ports[] = { GPIO_B, GPIO_C, GPIO_D }; #endif /* Provide a default function in case the board doesn't have one */ -void __board_keyboard_scan_ready(void) +void __board_keyboard_suppress_noise(void) { } -void board_keyboard_scan_ready(void) - __attribute__((weak, alias("__board_keyboard_scan_ready"))); - +void board_keyboard_suppress_noise(void) + __attribute__((weak, alias("__board_keyboard_suppress_noise"))); static void select_column(int col) { @@ -226,7 +225,8 @@ static int check_keys_changed(void) if (change) { memcpy(saved_state, raw_state, sizeof(saved_state)); - board_keyboard_scan_ready(); + board_keyboard_suppress_noise(); + board_interrupt_host(); CPRINTF("[%d keys pressed: ", num_press); for (c = 0; c < KB_OUTPUTS; c++) { |