aboutsummaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2021-09-11 17:05:53 -0500
committerTom Rini <trini@konsulko.com>2021-10-05 08:50:15 -0400
commit8a47982ed8d40595a83b82b2298753873e597708 (patch)
treea886c25653f2e6176773729cf2ed7a92d439b151 /include/asm-generic
parent37c10bf7ef22ccaa349581984340a616fb1c6ffb (diff)
downloadu-boot-8a47982ed8d40595a83b82b2298753873e597708.zip
u-boot-8a47982ed8d40595a83b82b2298753873e597708.tar.gz
u-boot-8a47982ed8d40595a83b82b2298753873e597708.tar.bz2
gpio: Factor out DT flag translation
The generic GPIO flags binding is shared across many drivers, some of which need their own xlate function. Factor out the flag translation code from gpio_xlate_offs_flags so it does not need to be duplicated. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/gpio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 6de13d9..fa9b807 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -222,6 +222,14 @@ int gpio_requestf(unsigned gpio, const char *fmt, ...)
struct fdtdec_phandle_args;
/**
+ * gpio_flags_xlate() - convert DT flags to internal flags
+ *
+ * This routine converts the GPIO_* flags from the generic DT binding to the
+ * GPIOD_* flags used internally. It can be called from driver xlate functions.
+ */
+unsigned long gpio_flags_xlate(uint32_t arg);
+
+/**
* gpio_xlate_offs_flags() - implementation for common use of dm_gpio_ops.xlate
*
* This routine sets the offset field to args[0] and the flags field to