summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWealian Liao <whliao@nuvoton.corp-partner.google.com>2021-06-17 18:33:28 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-28 18:37:42 +0000
commit5a3123ae33b5208b83698dd837f0ac57e4da8a91 (patch)
treebecbf28070d8a92709f18cee14c884a94296b98f
parent64ff902251200f8628aa10b6ab75d6142cfdfda4 (diff)
downloadchrome-ec-5a3123ae33b5208b83698dd837f0ac57e4da8a91.tar.gz
zephyr: npcx_evb: Enable power button
Enable the power button for npcx7/9_evb. BUG=none BRANCH=none TEST=toggle power button gpio, saw the print information Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I6ef7210250e02c768e8b5976903f1aa3785fe720 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3058715 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/projects/npcx_evb/npcx7/gpio.dts1
-rw-r--r--zephyr/projects/npcx_evb/npcx7/include/gpio_map.h4
-rw-r--r--zephyr/projects/npcx_evb/npcx7/prj.conf1
-rw-r--r--zephyr/projects/npcx_evb/npcx9/gpio.dts1
-rw-r--r--zephyr/projects/npcx_evb/npcx9/include/gpio_map.h4
-rw-r--r--zephyr/projects/npcx_evb/npcx9/prj.conf1
6 files changed, 10 insertions, 2 deletions
diff --git a/zephyr/projects/npcx_evb/npcx7/gpio.dts b/zephyr/projects/npcx_evb/npcx7/gpio.dts
index c4031dd83f..37676efec4 100644
--- a/zephyr/projects/npcx_evb/npcx7/gpio.dts
+++ b/zephyr/projects/npcx_evb/npcx7/gpio.dts
@@ -22,6 +22,7 @@
};
power_button_l {
gpios = <&gpio7 5 (GPIO_INPUT | GPIO_PULL_UP)>;
+ enum-name = "GPIO_POWER_BUTTON_L";
label = "POWER_BUTTON_L";
};
lid_open {
diff --git a/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h b/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h
index 944a7e9760..7f4c2f9643 100644
--- a/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h
+++ b/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h
@@ -25,6 +25,8 @@
* 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_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/npcx_evb/npcx7/prj.conf b/zephyr/projects/npcx_evb/npcx7/prj.conf
index 0e35e486d9..04f287d025 100644
--- a/zephyr/projects/npcx_evb/npcx7/prj.conf
+++ b/zephyr/projects/npcx_evb/npcx7/prj.conf
@@ -6,6 +6,7 @@ CONFIG_CROS_EC=y
CONFIG_PLATFORM_EC=y
CONFIG_PLATFORM_EC_BRINGUP=y
CONFIG_PLATFORM_EC_LID_SWITCH=y
+CONFIG_PLATFORM_EC_POWER_BUTTON=y
CONFIG_SHIMMED_TASKS=y
CONFIG_CROS_KB_RAW_NPCX=n
diff --git a/zephyr/projects/npcx_evb/npcx9/gpio.dts b/zephyr/projects/npcx_evb/npcx9/gpio.dts
index c4031dd83f..37676efec4 100644
--- a/zephyr/projects/npcx_evb/npcx9/gpio.dts
+++ b/zephyr/projects/npcx_evb/npcx9/gpio.dts
@@ -22,6 +22,7 @@
};
power_button_l {
gpios = <&gpio7 5 (GPIO_INPUT | GPIO_PULL_UP)>;
+ enum-name = "GPIO_POWER_BUTTON_L";
label = "POWER_BUTTON_L";
};
lid_open {
diff --git a/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h b/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h
index 944a7e9760..7f4c2f9643 100644
--- a/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h
+++ b/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h
@@ -25,6 +25,8 @@
* 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_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/npcx_evb/npcx9/prj.conf b/zephyr/projects/npcx_evb/npcx9/prj.conf
index ec1e590d6b..c2f6720f79 100644
--- a/zephyr/projects/npcx_evb/npcx9/prj.conf
+++ b/zephyr/projects/npcx_evb/npcx9/prj.conf
@@ -6,6 +6,7 @@ CONFIG_CROS_EC=y
CONFIG_PLATFORM_EC=y
CONFIG_PLATFORM_EC_BRINGUP=y
CONFIG_PLATFORM_EC_LID_SWITCH=y
+CONFIG_PLATFORM_EC_POWER_BUTTON=y
CONFIG_SHIMMED_TASKS=y
CONFIG_CROS_KB_RAW_NPCX=n