stm32: use level interrupt instead of edge

Using low level trigger interrupt rather than falling edge is more
robust since we avoid detecting glitches or missing interrupts.

This is backward compatible with the AP software expecting falling edge.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chrome-os-partner:8869
TEST=On Daisy, check we can still enter text in U-Boot console and
Chrome browser (and check interrupt count increase as expected).

Change-Id: Ide2b27f9129173530d137b5d70d998ebd8f8e669
This commit is contained in:
Vincent Palatin
2012-05-30 20:56:21 +00:00
parent aad3f858a4
commit 288cae699b
5 changed files with 11 additions and 11 deletions

View File

@@ -135,11 +135,10 @@ void configure_board(void)
gpio_set_level(GPIO_EC_INT, 1);
}
void board_interrupt_host(void)
void board_interrupt_host(int active)
{
/* interrupt host by toggling EC_INT */
gpio_set_level(GPIO_EC_INT, 0);
gpio_set_level(GPIO_EC_INT, 1);
/* interrupt host by using active low EC_INT signal */
gpio_set_level(GPIO_EC_INT, !active);
}
void board_keyboard_suppress_noise(void)

View File

@@ -85,6 +85,6 @@ void matrix_interrupt(enum gpio_signal signal);
void board_keyboard_suppress_noise(void);
/* Signal to AP that data is waiting */
void board_interrupt_host(void);
void board_interrupt_host(int active);
#endif /* __BOARD_H */

View File

@@ -107,9 +107,8 @@ void configure_board(void)
gpio_set_level(GPIO_EC_INT, 1);
}
void board_interrupt_host(void)
void board_interrupt_host(int active)
{
/* interrupt host by toggling EC_INT */
gpio_set_level(GPIO_EC_INT, 0);
gpio_set_level(GPIO_EC_INT, 1);
/* interrupt host by using active low EC_INT signal */
gpio_set_level(GPIO_EC_INT, !active);
}

View File

@@ -80,6 +80,6 @@ void configure_board(void);
void matrix_interrupt(enum gpio_signal signal);
/* Signal to AP that data is waiting */
void board_interrupt_host(void);
void board_interrupt_host(int active);
#endif /* __BOARD_H */

View File

@@ -307,7 +307,7 @@ static int check_keys_changed(void)
CPUTS("]\n");
if (kb_fifo_add(raw_state) == EC_SUCCESS)
board_interrupt_host();
board_interrupt_host(1);
else
CPRINTF("dropped keystroke\n");
}
@@ -383,6 +383,8 @@ int keyboard_scan_recovery_pressed(void)
static int keyboard_get_scan(uint8_t *data, int *resp_size)
{
kb_fifo_remove(data);
if (!kb_fifo_entries)
board_interrupt_host(0);
*resp_size = KB_OUTPUTS;
return EC_RES_SUCCESS;