summaryrefslogtreecommitdiff
path: root/board/host/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/host/board.c')
-rw-r--r--board/host/board.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/host/board.c b/board/host/board.c
index 3fdc75f163..5d47f0d8df 100644
--- a/board/host/board.c
+++ b/board/host/board.c
@@ -4,11 +4,13 @@
*/
/* Emulator board-specific configuration */
+#include "button.h"
#include "extpower.h"
#include "gpio.h"
#include "lid_switch.h"
#include "power_button.h"
#include "temp_sensor.h"
+#include "timer.h"
#include "util.h"
#define MOCK_GPIO(x) {#x, 0, 0, 0, 0}
@@ -23,6 +25,8 @@ const struct gpio_info gpio_list[] = {
MOCK_GPIO_INT(AC_PRESENT, GPIO_INT_BOTH, extpower_interrupt),
MOCK_GPIO(PCH_BKLTEN),
MOCK_GPIO(ENABLE_BACKLIGHT),
+ MOCK_GPIO_INT(BUTTON_VOLUME_DOWN_L, GPIO_INT_BOTH, button_interrupt),
+ MOCK_GPIO_INT(BUTTON_VOLUME_UP, GPIO_INT_BOTH, button_interrupt),
};
BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT);
@@ -44,3 +48,17 @@ const struct temp_sensor_t temp_sensors[] = {
{"Battery", TEMP_SENSOR_TYPE_BOARD, dummy_temp_get_val, 3, 0},
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+
+test_mockable void button_interrupt(enum gpio_signal signal)
+{
+};
+
+#ifdef CONFIG_BUTTON_COUNT
+const struct button_config buttons[] = {
+ {"Volume Down", KEYBOARD_BUTTON_VOLUME_DOWN, GPIO_BUTTON_VOLUME_DOWN_L,
+ 30 * MSEC, 0},
+ {"Volume Up", KEYBOARD_BUTTON_VOLUME_UP, GPIO_BUTTON_VOLUME_UP,
+ 60 * MSEC, BUTTON_FLAG_ACTIVE_HIGH},
+};
+BUILD_ASSERT(ARRAY_SIZE(buttons) == CONFIG_BUTTON_COUNT);
+#endif