|
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>
|