summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-11-09 12:57:23 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-15 03:55:10 +0000
commit5000a6edbacba5c841b2c157d10e26a5508edf58 (patch)
tree71dc73a57ce213b07ff84d6ccb0444197f44f951
parent657e7a7439e0639e3a7fb7484ca0c7fef89188f1 (diff)
downloadchrome-ec-5000a6edbacba5c841b2c157d10e26a5508edf58.tar.gz
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> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2630144 Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--zephyr/projects/volteer/include/gpio_map.h9
-rw-r--r--zephyr/projects/volteer/prj.conf1
2 files changed, 7 insertions, 3 deletions
diff --git a/zephyr/projects/volteer/include/gpio_map.h b/zephyr/projects/volteer/include/gpio_map.h
index 6ed97a42e8..f6639ae03f 100644
--- a/zephyr/projects/volteer/include/gpio_map.h
+++ b/zephyr/projects/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/zephyr/projects/volteer/prj.conf b/zephyr/projects/volteer/prj.conf
index 64ba01055f..0dcebfcb10 100644
--- a/zephyr/projects/volteer/prj.conf
+++ b/zephyr/projects/volteer/prj.conf
@@ -8,6 +8,7 @@ CONFIG_AP_X86_INTEL_TGL=y
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