summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-01-03 12:22:22 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-03 23:22:08 +0000
commit6f821a63b5d40b01c216e6919a3f5e0dfb0c8d82 (patch)
tree4a84e1df673a6de2af6c2bd45413bda18cfe77e5
parentcb0cfc0cbc42057b388b454a172bc4fde0f09a1f (diff)
downloadchrome-ec-6f821a63b5d40b01c216e6919a3f5e0dfb0c8d82.tar.gz
cbi: Add support for CONFIG_WP_ACTIVE_HIGH
The CBI module was missing support for an inverted write protect signal, this commit simply adds that support. BUG=b:146172102 BRANCH=None TEST=`make -j buildall` Change-Id: Ic52853e67a9f650609c09d719e57ed34f18d7f02 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1986312 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
-rw-r--r--common/cbi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/cbi.c b/common/cbi.c
index 1f92e584c2..e1839a9b6e 100644
--- a/common/cbi.c
+++ b/common/cbi.c
@@ -225,7 +225,11 @@ int cbi_set_board_info(enum cbi_data_tag tag, const uint8_t *buf, uint8_t size)
static int eeprom_is_write_protected(void)
{
+#ifdef CONFIG_WP_ACTIVE_HIGH
+ return gpio_get_level(GPIO_WP);
+#else
return !gpio_get_level(GPIO_WP_L);
+#endif /* CONFIG_WP_ACTIVE_HIGH */
}
static int write_board_info(void)