diff options
author | Wealian Liao <whliao@nuvoton.corp-partner.google.com> | 2021-06-17 17:41:48 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-28 18:37:39 +0000 |
commit | 64ff902251200f8628aa10b6ab75d6142cfdfda4 (patch) | |
tree | afd49e8d612f5caaef163bbf69fc485d7d3bf7a4 /zephyr/projects | |
parent | dd2e769938223069db7e93406a5ca47cd3203277 (diff) | |
download | chrome-ec-64ff902251200f8628aa10b6ab75d6142cfdfda4.tar.gz |
zephyr: npcx_evb: Enable lid switch
Enable the lid switch for npcx7/9_evb.
BUG=none
BRANCH=none
TEST=toggle the lid GPIO, observe UART prints
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: I8825992cb3e1dd6541ecad15d46ae9c71f8bb7ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3058714
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/projects')
-rw-r--r-- | zephyr/projects/npcx_evb/npcx7/gpio.dts | 1 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx7/include/gpio_map.h | 3 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx7/prj.conf | 1 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/gpio.dts | 1 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/include/gpio_map.h | 3 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/prj.conf | 1 |
6 files changed, 8 insertions, 2 deletions
diff --git a/zephyr/projects/npcx_evb/npcx7/gpio.dts b/zephyr/projects/npcx_evb/npcx7/gpio.dts index 1f41a4dcbe..c4031dd83f 100644 --- a/zephyr/projects/npcx_evb/npcx7/gpio.dts +++ b/zephyr/projects/npcx_evb/npcx7/gpio.dts @@ -26,6 +26,7 @@ }; lid_open { gpios = <&gpioa 6 (GPIO_INPUT | GPIO_PULL_DOWN)>; + enum-name = "GPIO_LID_OPEN"; label = "LID_OPEN"; }; entering_rw { diff --git a/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h b/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h index 025bb78743..944a7e9760 100644 --- a/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h +++ b/zephyr/projects/npcx_evb/npcx7/include/gpio_map.h @@ -24,6 +24,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/npcx_evb/npcx7/prj.conf b/zephyr/projects/npcx_evb/npcx7/prj.conf index 74ad3e6e4f..0e35e486d9 100644 --- a/zephyr/projects/npcx_evb/npcx7/prj.conf +++ b/zephyr/projects/npcx_evb/npcx7/prj.conf @@ -5,6 +5,7 @@ CONFIG_CROS_EC=y CONFIG_PLATFORM_EC=y CONFIG_PLATFORM_EC_BRINGUP=y +CONFIG_PLATFORM_EC_LID_SWITCH=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 1f41a4dcbe..c4031dd83f 100644 --- a/zephyr/projects/npcx_evb/npcx9/gpio.dts +++ b/zephyr/projects/npcx_evb/npcx9/gpio.dts @@ -26,6 +26,7 @@ }; lid_open { gpios = <&gpioa 6 (GPIO_INPUT | GPIO_PULL_DOWN)>; + enum-name = "GPIO_LID_OPEN"; label = "LID_OPEN"; }; entering_rw { diff --git a/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h b/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h index 025bb78743..944a7e9760 100644 --- a/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h +++ b/zephyr/projects/npcx_evb/npcx9/include/gpio_map.h @@ -24,6 +24,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/npcx_evb/npcx9/prj.conf b/zephyr/projects/npcx_evb/npcx9/prj.conf index 7be8dfacea..ec1e590d6b 100644 --- a/zephyr/projects/npcx_evb/npcx9/prj.conf +++ b/zephyr/projects/npcx_evb/npcx9/prj.conf @@ -5,6 +5,7 @@ CONFIG_CROS_EC=y CONFIG_PLATFORM_EC=y CONFIG_PLATFORM_EC_BRINGUP=y +CONFIG_PLATFORM_EC_LID_SWITCH=y CONFIG_SHIMMED_TASKS=y CONFIG_CROS_KB_RAW_NPCX=n |