summaryrefslogtreecommitdiff
path: root/common/gpio_commands.c
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-11-11 12:05:51 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-11 17:42:06 +0000
commit829b707486770d97c524ef39cd85d5543bfb7bac (patch)
tree5c7d6fc440ef6565cbfa055b0c76b4d196626d0f /common/gpio_commands.c
parent22fa1edea9cc654f3e2b3ec1c513c2ab55b28a76 (diff)
downloadchrome-ec-829b707486770d97c524ef39cd85d5543bfb7bac.tar.gz
zephyr: shim: use device specific 1.8V GPIO flags
The generic GPIO_VOLTAGE_1P8 flag is deprecated and has been removed upstream in favor of device specific flags, which right now have been defined to use the same bit, but that may change in the future. In the EC firmware we share chunks of dts files on boards with different architectures, so we still need a common flag that can be redefined to the platform specific one. This patch supports the change by: - redefine GPIO_VOLTAGE_1P8 for the devicetree files, but set it for the specific architecture being built, this is done using the platform dts files - redefine GPIO_VOLTAGE_1P8 for the source code depending on what GPIO controller is used (which would not work if we had to use it on port expanders, but that may never be a problem) - define an entry for native_posix for the unit test to use - undefine the legacy GPIO_SEL_1P8V entry if not supported BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Cq-Depend: chromium:4023593 Change-Id: Ife34ecc23fb1e18b13a7bcdbe378b0a182c50249 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4023445 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/gpio_commands.c')
-rw-r--r--common/gpio_commands.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/gpio_commands.c b/common/gpio_commands.c
index d6257ea61d..06e0203090 100644
--- a/common/gpio_commands.c
+++ b/common/gpio_commands.c
@@ -91,7 +91,10 @@ __maybe_unused static const struct gpio_flag_description gpio_descriptions[] = {
{ GPIO_INPUT, "I" }, { GPIO_OUTPUT, "O" },
{ GPIO_LOW, "L" }, { GPIO_HIGH, "H" },
{ GPIO_OPEN_DRAIN, "ODR" }, { GPIO_PULL_UP, "PU" },
- { GPIO_PULL_DOWN, "PD" }, { GPIO_SEL_1P8V, "1P8" },
+ { GPIO_PULL_DOWN, "PD" },
+#ifdef GPIO_SEL_1P8V
+ { GPIO_SEL_1P8V, "1P8" },
+#endif
#ifndef CONFIG_ZEPHYR
{ GPIO_ANALOG, "A" }, { GPIO_ALTERNATE, "ALT" },
{ GPIO_LOCKED, "LCK" }