summaryrefslogtreecommitdiff
path: root/board/host
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-09-29 00:55:36 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-01 08:16:34 +0000
commitc77575ac0daa5966772779cedbaab6f607cf9a98 (patch)
treef1e7cf3ca7f232e4be95b7bd57e652253eddaacc /board/host
parent2d856c51039153effe4b9e9d7924c841fb741da5 (diff)
downloadchrome-ec-c77575ac0daa5966772779cedbaab6f607cf9a98.tar.gz
Emulator support of fake GPIO input
For all GPIOs, the current values are recorded. A test can then change the value of a GPIO input by gpio_set_level(). The changed value is recorded and also interrupt is fired if the change fits the interrupt flags defined in board/host/board.c. BUG=chrome-os-partner:19235 TEST=Pass all tests BRANCH=None Change-Id: If8e547e5adf4a20dcb118f5fe2187293005d4ca3 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170907 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/host')
-rw-r--r--board/host/board.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/board/host/board.c b/board/host/board.c
index c48a1d3c44..3fdc75f163 100644
--- a/board/host/board.c
+++ b/board/host/board.c
@@ -4,19 +4,23 @@
*/
/* Emulator board-specific configuration */
+#include "extpower.h"
#include "gpio.h"
+#include "lid_switch.h"
+#include "power_button.h"
#include "temp_sensor.h"
#include "util.h"
#define MOCK_GPIO(x) {#x, 0, 0, 0, 0}
+#define MOCK_GPIO_INT(x, i, r) {#x, 0, 0, i, r}
const struct gpio_info gpio_list[] = {
MOCK_GPIO(EC_INT),
- MOCK_GPIO(LID_OPEN),
- MOCK_GPIO(POWER_BUTTON_L),
+ MOCK_GPIO_INT(LID_OPEN, GPIO_INT_BOTH, lid_interrupt),
+ MOCK_GPIO_INT(POWER_BUTTON_L, GPIO_INT_BOTH, power_button_interrupt),
MOCK_GPIO(WP),
MOCK_GPIO(ENTERING_RW),
- MOCK_GPIO(AC_PRESENT),
+ MOCK_GPIO_INT(AC_PRESENT, GPIO_INT_BOTH, extpower_interrupt),
MOCK_GPIO(PCH_BKLTEN),
MOCK_GPIO(ENABLE_BACKLIGHT),
};