diff options
author | Yuval Peress <peress@chromium.org> | 2021-06-01 22:17:21 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-03 08:14:34 +0000 |
commit | 0f2a66602a173fdf318c41c36dc457dda3065eb2 (patch) | |
tree | 0a86c1a81be3a1c495d9cd35c720fee848911859 /zephyr/projects/brya | |
parent | f75b7d2deed1c5f25ee3df2b4e4ceb77c20cf3d3 (diff) | |
download | chrome-ec-0f2a66602a173fdf318c41c36dc457dda3065eb2.tar.gz |
zephyr: brya: wakeup from hibernation
configure wakeup gpios.
BRANCH=none
BUG=b:188605676
TEST=`hibernate` in EC console, then press the physical power button
to wake up.
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: Ice839bc39393f416fea7548f5497791c10a155ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932458
Diffstat (limited to 'zephyr/projects/brya')
-rw-r--r-- | zephyr/projects/brya/brya/gpio.dts | 22 | ||||
-rw-r--r-- | zephyr/projects/brya/brya/include/gpio_map.h | 13 | ||||
-rw-r--r-- | zephyr/projects/brya/brya/prj.conf | 1 |
3 files changed, 27 insertions, 9 deletions
diff --git a/zephyr/projects/brya/brya/gpio.dts b/zephyr/projects/brya/brya/gpio.dts index 4941060d63..274fd5bc3e 100644 --- a/zephyr/projects/brya/brya/gpio.dts +++ b/zephyr/projects/brya/brya/gpio.dts @@ -7,16 +7,16 @@ named-gpios { compatible = "named-gpios"; - lid_open { + lid_open: lid_open { gpios = <&gpiod 2 GPIO_INPUT>; enum-name = "GPIO_LID_OPEN"; - label = "GPIO_LID_OPEN"; + label = "LID_OPEN"; }; - power_btn: power_btn { + gsc_ec_pwr_btn_odl: power_btn { gpios = <&gpio0 1 GPIO_INPUT>; enum-name = "GPIO_POWER_BUTTON_L"; - label = "GPIO_POWER_BUTTON"; + label = "GSC_EC_PWR_BTN_ODL"; }; wp_l { @@ -42,5 +42,19 @@ enum-name = "GPIO_PACKET_MODE_EN"; label = "EC_GSC_PACKET_MODE"; }; + acok_od: acok_od { + gpios = <&gpio0 0 GPIO_INPUT>; + enum-name = "GPIO_AC_PRESENT"; + label = "ACOK_OD"; + }; + }; + + hibernate-wake-pins { + compatible = "cros-ec,hibernate-wake-pins"; + wakeup-pins = < + &acok_od + &gsc_ec_pwr_btn_odl + &lid_open + >; }; }; diff --git a/zephyr/projects/brya/brya/include/gpio_map.h b/zephyr/projects/brya/brya/include/gpio_map.h index 5c2f4ea23e..089318325c 100644 --- a/zephyr/projects/brya/brya/include/gpio_map.h +++ b/zephyr/projects/brya/brya/include/gpio_map.h @@ -27,10 +27,13 @@ * #define EC_CROS_GPIO_INTERRUPTS \ * GPIO_INT(NAMED_GPIO(h1_ec_pwr_btn_odl), GPIO_INT_EDGE_BOTH, button_print) */ -#define EC_CROS_GPIO_INTERRUPTS \ - GPIO_INT(GPIO_LID_OPEN, GPIO_INT_EDGE_BOTH, lid_interrupt) \ - GPIO_INT(GPIO_POWER_BUTTON_L, GPIO_INT_EDGE_BOTH, \ - power_button_interrupt) \ - GPIO_INT(GPIO_WP_L, GPIO_INT_EDGE_BOTH, switch_interrupt) +#define EC_CROS_GPIO_INTERRUPTS \ + GPIO_INT(GPIO_LID_OPEN, GPIO_INT_EDGE_BOTH, lid_interrupt) \ + GPIO_INT(GPIO_POWER_BUTTON_L, GPIO_INT_EDGE_BOTH, \ + power_button_interrupt) \ + GPIO_INT(GPIO_WP_L, GPIO_INT_EDGE_BOTH, switch_interrupt) \ + GPIO_INT(GPIO_AC_PRESENT, GPIO_INT_EDGE_BOTH, extpower_interrupt) \ + GPIO_INT(GPIO_POWER_BUTTON_L, GPIO_INT_EDGE_BOTH, \ + power_button_interrupt) #endif /* __ZEPHYR_GPIO_MAP_H */ diff --git a/zephyr/projects/brya/brya/prj.conf b/zephyr/projects/brya/brya/prj.conf index 99dc5bf7d4..9f0c025be1 100644 --- a/zephyr/projects/brya/brya/prj.conf +++ b/zephyr/projects/brya/brya/prj.conf @@ -14,6 +14,7 @@ CONFIG_CROS_FLASH_NPCX=y CONFIG_CROS_SYSTEM_NPCX=y CONFIG_PLATFORM_EC_VBOOT=y CONFIG_PLATFORM_EC_VBOOT_HASH=y +CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y # TODO(b/188605676): bring these features up CONFIG_CROS_KB_RAW_NPCX=n |