summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-11-06 12:14:56 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-15 03:55:01 +0000
commit40921d93696b9a9855291e7b29da1bf2e23bdbe1 (patch)
tree00a59ecd257aa6c1c55ab8033a663ca10a64f7f9
parentb949b9509e2674e803307994fcaa12bb000c59cd (diff)
downloadchrome-ec-40921d93696b9a9855291e7b29da1bf2e23bdbe1.tar.gz
volteer: add lid switch GPIO and configuration
Enable the lid switch shim, and add GPIOs and interrupts needed. BUG=b:172652088 TEST=compile for volteer, observe console commands lid{open,close,state} and open/close lid to observe state change Cq-Depend: chromium:2523456 Change-Id: I73ded74f519b6d55d5210f217243f0673c131275 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/zephyr-chrome/+/2523457 Tested-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@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/+/2630141
-rw-r--r--zephyr/projects/volteer/include/gpio_map.h6
-rw-r--r--zephyr/projects/volteer/prj.conf1
2 files changed, 6 insertions, 1 deletions
diff --git a/zephyr/projects/volteer/include/gpio_map.h b/zephyr/projects/volteer/include/gpio_map.h
index 5b70abbdff..8ef49c847b 100644
--- a/zephyr/projects/volteer/include/gpio_map.h
+++ b/zephyr/projects/volteer/include/gpio_map.h
@@ -9,6 +9,8 @@
#include <devicetree.h>
#include <gpio_signal.h>
+#include "lid_switch.h"
+
/*
* Without https://github.com/zephyrproject-rtos/zephyr/pull/29282, we need
* to manually link GPIO_ defines that platform/ec code expects to the
@@ -21,6 +23,7 @@
#define GPIO_EN_PP3300_A NAMED_GPIO(en_pp3300_a)
#define GPIO_EN_PP5000 NAMED_GPIO(en_pp5000_a)
#define GPIO_EN_PP5000_A NAMED_GPIO(en_pp5000_a)
+#define GPIO_LID_OPEN NAMED_GPIO(ec_lid_open)
#define GPIO_PCH_DSW_PWROK NAMED_GPIO(ec_pch_dsw_pwrok)
#define GPIO_PCH_PWRBTN_L NAMED_GPIO(ec_pch_pwr_btn_odl)
#define GPIO_PCH_RSMRST_L NAMED_GPIO(ec_pch_rsmrst_odl)
@@ -51,6 +54,7 @@
* #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
+#define EC_CROS_GPIO_INTERRUPTS \
+ GPIO_INT(GPIO_LID_OPEN, GPIO_INT_EDGE_BOTH, lid_interrupt)
#endif /* __ZEPHYR_GPIO_MAP_H */
diff --git a/zephyr/projects/volteer/prj.conf b/zephyr/projects/volteer/prj.conf
index fa97da35b6..5ee787f303 100644
--- a/zephyr/projects/volteer/prj.conf
+++ b/zephyr/projects/volteer/prj.conf
@@ -9,3 +9,4 @@ CONFIG_CROS_EC_RO=y
CONFIG_PLATFORM_EC=y
CONFIG_I2C=y
CONFIG_PLATFORM_EC_KEYBOARD=y
+CONFIG_PLATFORM_EC_LID_SWITCH=y