summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-03-15 13:45:33 -0600
committerCommit Bot <commit-bot@chromium.org>2022-03-16 00:49:17 +0000
commitd7944fc80a732248240cc5c110952cfd3b8a5439 (patch)
treeb4683b08993ec8f08bd3b11198cab49276c5c3cb
parent46106ca390e23b43e275599e7dba4fa369e8e301 (diff)
downloadchrome-ec-d7944fc80a732248240cc5c110952cfd3b8a5439.tar.gz
zephyr: Update GPIO flags to match upstream
Update the copy of the Zephyr GPIO flags the EC application uses in devicetrees. BUG=b:224821728 BRANCH=none TEST=zmake testall TEST=verify Herobrine boots the AP Cq-Depend: chromium:3519052 Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I1f194fcce5570ba10c8389d81164864102921c87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3527513 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--include/gpio.h24
-rw-r--r--zephyr/include/dt-bindings/gpio_defines.h30
2 files changed, 25 insertions, 29 deletions
diff --git a/include/gpio.h b/include/gpio.h
index d57d6417ab..c6ff3e049f 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -29,28 +29,28 @@
* Validate that these definitions haven't changed.
*/
/* Validate that Zephyr's definition are the same for overlapping defines */
-#if BIT(8) != GPIO_INPUT
+#if BIT(16) != GPIO_INPUT
#error GPIO_INPUT values are not the same!
-#elif BIT(9) != GPIO_OUTPUT
+#elif BIT(17) != GPIO_OUTPUT
#error GPIO_OUTPUT values are not the same!
-#elif BIT(10) != GPIO_OUTPUT_INIT_LOW
+#elif BIT(18) != GPIO_OUTPUT_INIT_LOW
#error GPIO_OUTPUT_INIT_LOW values are not the same!
-#elif BIT(11) != GPIO_OUTPUT_INIT_HIGH
+#elif BIT(19) != GPIO_OUTPUT_INIT_HIGH
#error GPIO_OUTPUT_INIT_HIGH values are not the same!
-#elif BIT(13) != GPIO_INT_DISABLE
+#elif BIT(20) != GPIO_OUTPUT_INIT_LOGICAL
+#error GPIO_OUTPUT_INIT_LOGICAL values are not the same!
+#elif BIT(21) != GPIO_INT_DISABLE
#error GPIO_INT_DISABLE values are not the same!
-#elif BIT(14) != GPIO_INT_ENABLE
+#elif BIT(22) != GPIO_INT_ENABLE
#error GPIO_INT_ENABLE values are not the same!
-#elif BIT(15) != GPIO_INT_LEVELS_LOGICAL
+#elif BIT(23) != GPIO_INT_LEVELS_LOGICAL
#error GPIO_INT_LEVELS_LOGICAL values are not the same!
-#elif BIT(16) != GPIO_INT_EDGE
+#elif BIT(24) != GPIO_INT_EDGE
#error GPIO_INT_EDGE values are not the same!
-#elif BIT(17) != GPIO_INT_LOW_0
+#elif BIT(25) != GPIO_INT_LOW_0
#error GPIO_INT_LOW_0 values are not the same!
-#elif BIT(18) != GPIO_INT_HIGH_1
+#elif BIT(26) != GPIO_INT_HIGH_1
#error GPIO_INT_HIGH_1 values are not the same!
-#elif BIT(19) != GPIO_INT_DEBOUNCE
-#error GPIO_INT_DEBOUNCE values are not the same!
#endif
/*
diff --git a/zephyr/include/dt-bindings/gpio_defines.h b/zephyr/include/dt-bindings/gpio_defines.h
index cc73dd6382..5b04189a9f 100644
--- a/zephyr/include/dt-bindings/gpio_defines.h
+++ b/zephyr/include/dt-bindings/gpio_defines.h
@@ -21,16 +21,19 @@
*/
/** Enables pin as input. */
-#define GPIO_INPUT (1U << 8)
+#define GPIO_INPUT (1U << 16)
/** Enables pin as output, no change to the output state. */
-#define GPIO_OUTPUT (1U << 9)
+#define GPIO_OUTPUT (1U << 17)
/* Initializes output to a low state. */
-#define GPIO_OUTPUT_INIT_LOW (1U << 10)
+#define GPIO_OUTPUT_INIT_LOW (1U << 18)
/* Initializes output to a high state. */
-#define GPIO_OUTPUT_INIT_HIGH (1U << 11)
+#define GPIO_OUTPUT_INIT_HIGH (1U << 19)
+
+/* Initializes output based on logic level */
+#define GPIO_OUTPUT_INIT_LOGICAL (1U << 20)
/* Configures GPIO pin as output and initializes it to a low state. */
#define GPIO_OUTPUT_LOW (GPIO_OUTPUT | GPIO_OUTPUT_INIT_LOW)
@@ -58,17 +61,17 @@
*/
/** Disables GPIO pin interrupt. */
-#define GPIO_INT_DISABLE (1U << 13)
+#define GPIO_INT_DISABLE (1U << 21)
/* Enables GPIO pin interrupt. */
-#define GPIO_INT_ENABLE (1U << 14)
+#define GPIO_INT_ENABLE (1U << 22)
/* GPIO interrupt is sensitive to logical levels.
*
* This is a component flag that should be combined with other
* `GPIO_INT_*` flags to produce a meaningful configuration.
*/
-#define GPIO_INT_LEVELS_LOGICAL (1U << 15)
+#define GPIO_INT_LEVELS_LOGICAL (1U << 23)
/* GPIO interrupt is edge sensitive.
*
@@ -77,7 +80,7 @@
* This is a component flag that should be combined with other
* `GPIO_INT_*` flags to produce a meaningful configuration.
*/
-#define GPIO_INT_EDGE (1U << 16)
+#define GPIO_INT_EDGE (1U << 24)
/* Trigger detection when input state is (or transitions to) physical low or
* logical 0 level.
@@ -85,7 +88,7 @@
* This is a component flag that should be combined with other
* `GPIO_INT_*` flags to produce a meaningful configuration.
*/
-#define GPIO_INT_LOW_0 (1U << 17)
+#define GPIO_INT_LOW_0 (1U << 25)
/* Trigger detection on input state is (or transitions to) physical high or
* logical 1 level.
@@ -93,7 +96,7 @@
* This is a component flag that should be combined with other
* `GPIO_INT_*` flags to produce a meaningful configuration.
*/
-#define GPIO_INT_HIGH_1 (1U << 18)
+#define GPIO_INT_HIGH_1 (1U << 26)
/** Configures GPIO interrupt to be triggered on pin rising edge and enables it.
*/
@@ -158,11 +161,4 @@
GPIO_INT_LEVELS_LOGICAL | \
GPIO_INT_HIGH_1)
-/** Enable GPIO pin debounce.
- *
- * @note Drivers that do not support a debounce feature should ignore
- * this flag rather than rejecting the configuration with -ENOTSUP.
- */
-#define GPIO_INT_DEBOUNCE (1U << 19)
-
#endif /* DT_BINDINGS_GPIO_DEFINES_H_ */