diff options
Diffstat (limited to 'test/kb_8042.c')
-rw-r--r-- | test/kb_8042.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/test/kb_8042.c b/test/kb_8042.c index 0bac5fedcf..88bae5d633 100644 --- a/test/kb_8042.c +++ b/test/kb_8042.c @@ -29,8 +29,6 @@ static unsigned int lpc_char_cnt; /*****************************************************************************/ /* Mock functions */ -static int mock_power_button = 1; - int lid_is_open(void) { return 1; @@ -41,13 +39,6 @@ void lpc_keyboard_put_char(uint8_t chr, int send_irq) lpc_char_buf[lpc_char_cnt++] = chr; } -int gpio_get_level(enum gpio_signal signal) -{ - if (signal == GPIO_POWER_BUTTON_L) - return mock_power_button; - return 0; -} - /*****************************************************************************/ /* Test utilities */ @@ -209,33 +200,27 @@ static int test_power_button(void) set_scancode(1); test_chipset_on(); - mock_power_button = 0; - power_button_interrupt(GPIO_POWER_BUTTON_L); + gpio_set_level(GPIO_POWER_BUTTON_L, 0); VERIFY_LPC_CHAR_DELAY("\xe0\x5e", 100); - mock_power_button = 1; - power_button_interrupt(GPIO_POWER_BUTTON_L); + gpio_set_level(GPIO_POWER_BUTTON_L, 1); VERIFY_LPC_CHAR_DELAY("\xe0\xde", 100); set_scancode(2); write_cmd_byte(read_cmd_byte() & ~I8042_XLATE); - mock_power_button = 0; - power_button_interrupt(GPIO_POWER_BUTTON_L); + gpio_set_level(GPIO_POWER_BUTTON_L, 0); VERIFY_LPC_CHAR_DELAY("\xe0\x37", 100); - mock_power_button = 1; - power_button_interrupt(GPIO_POWER_BUTTON_L); + gpio_set_level(GPIO_POWER_BUTTON_L, 1); VERIFY_LPC_CHAR_DELAY("\xe0\xf0\x37", 100); test_chipset_off(); - mock_power_button = 0; - power_button_interrupt(GPIO_POWER_BUTTON_L); + gpio_set_level(GPIO_POWER_BUTTON_L, 0); VERIFY_NO_CHAR(); - mock_power_button = 1; - power_button_interrupt(GPIO_POWER_BUTTON_L); + gpio_set_level(GPIO_POWER_BUTTON_L, 1); VERIFY_NO_CHAR(); return EC_SUCCESS; |