summaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-04 11:29:49 -0600
committerSimon Glass <sjg@chromium.org>2014-10-23 19:29:52 -0600
commitd44f597b12b8f8099c3c52c3eb09540966cafe79 (patch)
treeaeecc26ed1a0938d0e567b08af389b63088d4664 /include/asm-generic
parent4b8f11c2cc1dc23cf721073e6440c4e151b89bdd (diff)
downloadu-boot-imx-d44f597b12b8f8099c3c52c3eb09540966cafe79.zip
u-boot-imx-d44f597b12b8f8099c3c52c3eb09540966cafe79.tar.gz
u-boot-imx-d44f597b12b8f8099c3c52c3eb09540966cafe79.tar.bz2
dm: gpio: Add gpio_requestf() helper for printf() strings
Add a helper which permits a printf()-style format string for the requester string. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/gpio.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 693bb56..8af760e 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -146,6 +146,16 @@ int gpio_get_function(struct udevice *dev, int offset, const char **namep);
int gpio_get_raw_function(struct udevice *dev, int offset, const char **namep);
/**
+ * gpio_requestf() - request a GPIO using a format string for the owner
+ *
+ * This is a helper function for gpio_request(). It allows you to provide
+ * a printf()-format string for the GPIO owner. It calls gpio_request() with
+ * the string that is created
+ */
+int gpio_requestf(unsigned gpio, const char *fmt, ...)
+ __attribute__ ((format (__printf__, 2, 3)));
+
+/**
* struct struct dm_gpio_ops - Driver model GPIO operations
*
* Refer to functions above for description. These function largely copy