volteer: enable extpower gpio support and add configs
Enable CONFIG_PLATFORM_EC_EXTPOWER_GPIO, and add the configs for the
pin and interrupt needed in gpio_map.h
BUG=b:172720290
TEST=see TEST of CL:2527703
Cq-Depend: chromium:2527703
Change-Id: I026e1942d752668c27746b73e778c56d8cd6a096
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/zephyr-chrome/+/2527663
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
diff --git a/projects/experimental/volteer/include/gpio_map.h b/projects/experimental/volteer/include/gpio_map.h
index 6ed97a4..f6639ae 100644
--- a/projects/experimental/volteer/include/gpio_map.h
+++ b/projects/experimental/volteer/include/gpio_map.h
@@ -9,6 +9,7 @@
#include <devicetree.h>
#include <gpio_signal.h>
+#include "extpower.h"
#include "lid_switch.h"
#include "power_button.h"
@@ -20,6 +21,7 @@
* Note we only need to create aliases for GPIOs that are referenced in common
* platform/ec code.
*/
+#define GPIO_AC_PRESENT NAMED_GPIO(acok_od)
#define GPIO_CPU_PROCHOT NAMED_GPIO(ec_prochot_odl)
#define GPIO_EN_PP3300_A NAMED_GPIO(en_pp3300_a)
#define GPIO_EN_PP5000 NAMED_GPIO(en_pp5000_a)
@@ -55,9 +57,10 @@
* #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, \
+#define EC_CROS_GPIO_INTERRUPTS \
+ GPIO_INT(GPIO_AC_PRESENT, GPIO_INT_EDGE_BOTH, extpower_interrupt) \
+ GPIO_INT(GPIO_LID_OPEN, GPIO_INT_EDGE_BOTH, lid_interrupt) \
+ GPIO_INT(GPIO_POWER_BUTTON_L, GPIO_INT_EDGE_BOTH, \
power_button_interrupt)
#endif /* __ZEPHYR_GPIO_MAP_H */
diff --git a/projects/experimental/volteer/prj.conf b/projects/experimental/volteer/prj.conf
index 64ba010..0dcebfc 100644
--- a/projects/experimental/volteer/prj.conf
+++ b/projects/experimental/volteer/prj.conf
@@ -8,6 +8,7 @@
CONFIG_CROS_EC_RO=y
CONFIG_PLATFORM_EC=y
CONFIG_I2C=y
+CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y
CONFIG_PLATFORM_EC_KEYBOARD=y
CONFIG_PLATFORM_EC_LID_SWITCH=y
CONFIG_PLATFORM_EC_POWER_BUTTON=y