diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2022-02-07 14:50:09 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-11 00:38:24 +0000 |
commit | 74a02c2ff082d70608064f4b09f8ecf08a77e685 (patch) | |
tree | 1b59c3e9265f7a6fa0a39f76083f03aa2b419095 /zephyr/projects/trogdor | |
parent | 4b10d2b2d093a43d9ef46ab4024cf38e13bb8f67 (diff) | |
download | chrome-ec-74a02c2ff082d70608064f4b09f8ecf08a77e685.tar.gz |
write protect: extract checking write protect
The write-protect state can be checked on 2 pins GPIO_WP or GPIO_WP_L.
The CONFIG_WP_ACTIVE_HIGH config is used to distinguish these two cases.
Move the checking the config and pin state to a separate header file.
For Zephyr, start using the gpio_get_level function that takes into
account the GPIO_ACTIVE_LOW flag. Also, use 'gpio-wp' alias to the WP
pin instead of the legacy enum-name property and 'int-wp' alias to the
WP GPIO interrupt.
BUG=b:211779766
TEST=zmake testall & make sure WP works
BRANCH=main
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I70bfbcd5e539fcc8cd157f2feae1a6c8e25083a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3447404
Reviewed-by: Andrew McRae <amcrae@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/projects/trogdor')
-rw-r--r-- | zephyr/projects/trogdor/lazor/gpio.dts | 5 | ||||
-rw-r--r-- | zephyr/projects/trogdor/lazor/interrupts.dts | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/zephyr/projects/trogdor/lazor/gpio.dts b/zephyr/projects/trogdor/lazor/gpio.dts index c26f9abbee..5c8a5c32b9 100644 --- a/zephyr/projects/trogdor/lazor/gpio.dts +++ b/zephyr/projects/trogdor/lazor/gpio.dts @@ -6,6 +6,10 @@ #include <dt-bindings/wake_mask_event_defines.h> / { + aliases { + gpio-wp = &gpio_ec_wp_odl; + }; + named-gpios { compatible = "named-gpios"; @@ -59,7 +63,6 @@ }; gpio_ec_wp_odl: ec_wp_odl { gpios = <&gpioa 1 (GPIO_INPUT | GPIO_ACTIVE_LOW)>; - enum-name = "GPIO_WP_L"; }; gpio_lid_open_ec: lid_open_ec { gpios = <&gpiod 2 GPIO_INPUT>; diff --git a/zephyr/projects/trogdor/lazor/interrupts.dts b/zephyr/projects/trogdor/lazor/interrupts.dts index 749504fc38..da9b5297ef 100644 --- a/zephyr/projects/trogdor/lazor/interrupts.dts +++ b/zephyr/projects/trogdor/lazor/interrupts.dts @@ -4,6 +4,10 @@ */ / { + aliases { + int-wp = &int_wp; + }; + gpio-interrupts { compatible = "cros-ec,gpio-interrupts"; |