From 2a0763a76ab2134865171aa010dd9962aeea526c Mon Sep 17 00:00:00 2001 From: Keith Short Date: Fri, 11 Feb 2022 16:23:43 -0700 Subject: zephyr: allow EC gpio.h for shim driver Allow the GPIO shim driver and keyboard driver to continue to use the legacy EC GPIO header and API. BUG=b:218856245 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short Change-Id: I3163ed98ef41dcf59ff694801964fba0d774db58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489252 Reviewed-by: Denis Brockus --- zephyr/shim/src/gpio.c | 3 +++ zephyr/shim/src/gpio_id.c | 5 +++++ zephyr/shim/src/gpio_int.c | 3 +++ zephyr/shim/src/ioex.c | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/zephyr/shim/src/gpio.c b/zephyr/shim/src/gpio.c index 0ca118af58..c068aae8bc 100644 --- a/zephyr/shim/src/gpio.c +++ b/zephyr/shim/src/gpio.c @@ -8,6 +8,9 @@ #include #include +#ifdef __REQUIRE_ZEPHYR_GPIOS__ +#undef __REQUIRE_ZEPHYR_GPIOS__ +#endif #include "gpio.h" #include "gpio/gpio.h" #include "ioexpander.h" diff --git a/zephyr/shim/src/gpio_id.c b/zephyr/shim/src/gpio_id.c index 1dddac2c88..3a122ae376 100644 --- a/zephyr/shim/src/gpio_id.c +++ b/zephyr/shim/src/gpio_id.c @@ -4,6 +4,10 @@ */ #include + +#ifdef __REQUIRE_ZEPHYR_GPIOS__ +#undef __REQUIRE_ZEPHYR_GPIOS__ +#endif #include "gpio.h" #include "util.h" @@ -17,6 +21,7 @@ #define CONVERT_NUMERAL_SYSTEM(system, bits, nbits) \ CONVERT_NUMERAL_SYSTEM_EVAL(system, bits, nbits) +/* TODO: b/218904113: Convert to using Zephyr GPIOs */ #define READ_PIN_FROM_PHANDLE(node_id, prop, idx) \ gpio_get_ternary(GPIO_SIGNAL(DT_PHANDLE_BY_IDX(node_id, prop, idx))), diff --git a/zephyr/shim/src/gpio_int.c b/zephyr/shim/src/gpio_int.c index 5213069d17..31f64648b9 100644 --- a/zephyr/shim/src/gpio_int.c +++ b/zephyr/shim/src/gpio_int.c @@ -8,6 +8,9 @@ #include #include +#ifdef __REQUIRE_ZEPHYR_GPIOS__ +#undef __REQUIRE_ZEPHYR_GPIOS__ +#endif #include "gpio.h" #include "gpio/gpio.h" #include "gpio/gpio_int.h" diff --git a/zephyr/shim/src/ioex.c b/zephyr/shim/src/ioex.c index 7d9ba99946..57027f9241 100644 --- a/zephyr/shim/src/ioex.c +++ b/zephyr/shim/src/ioex.c @@ -8,6 +8,10 @@ #include #include #include + +#ifdef __REQUIRE_ZEPHYR_GPIOS__ +#undef __REQUIRE_ZEPHYR_GPIOS__ +#endif #include "gpio.h" #include "gpio/gpio.h" #include "i2c.h" -- cgit v1.2.1