summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-02-11 16:23:43 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-25 21:11:28 +0000
commit2a0763a76ab2134865171aa010dd9962aeea526c (patch)
treecf3ea31de4edadf4df17401bbadee53a3fe5e400
parent297e07c006a3b78496de764330e5b5f0d85bd8ca (diff)
downloadchrome-ec-2a0763a76ab2134865171aa010dd9962aeea526c.tar.gz
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 <keithshort@chromium.org> Change-Id: I3163ed98ef41dcf59ff694801964fba0d774db58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3489252 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--zephyr/shim/src/gpio.c3
-rw-r--r--zephyr/shim/src/gpio_id.c5
-rw-r--r--zephyr/shim/src/gpio_int.c3
-rw-r--r--zephyr/shim/src/ioex.c4
4 files changed, 15 insertions, 0 deletions
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 <kernel.h>
#include <logging/log.h>
+#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 <devicetree.h>
+
+#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 <kernel.h>
#include <logging/log.h>
+#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 <init.h>
#include <kernel.h>
#include <logging/log.h>
+
+#ifdef __REQUIRE_ZEPHYR_GPIOS__
+#undef __REQUIRE_ZEPHYR_GPIOS__
+#endif
#include "gpio.h"
#include "gpio/gpio.h"
#include "i2c.h"