summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-04 11:29:44 -0600
committerSimon Glass <sjg@chromium.org>2014-10-23 19:29:52 -0600
commit0757535a7eee3ae5603520fe4a0588a01a590ea7 (patch)
tree1e87d9fc38cab2e3d78bcd16047de8bbacb0fad5 /include
parent6449a506d67b0374bf23a3833f15afa0c92a7a0e (diff)
downloadu-boot-imx-0757535a7eee3ae5603520fe4a0588a01a590ea7.zip
u-boot-imx-0757535a7eee3ae5603520fe4a0588a01a590ea7.tar.gz
u-boot-imx-0757535a7eee3ae5603520fe4a0588a01a590ea7.tar.bz2
dm: Move the function for getting GPIO status into the uclass
This function can be more easily tested if it is in the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 7104454..693bb56 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -96,6 +96,24 @@ enum gpio_func_t {
struct udevice;
/**
+ * gpio_get_status() - get the current GPIO status as a string
+ *
+ * Obtain the current GPIO status as a string which can be presented to the
+ * user. A typical string is:
+ *
+ * "b4: in: 1 [x] sdmmc_cd"
+ *
+ * which means this is GPIO bank b, offset 4, currently set to input, current
+ * value 1, [x] means that it is requested and the owner is 'sdmmc_cd'
+ *
+ * @dev: Device to check
+ * @offset: Offset of device GPIO to check
+ * @buf: Place to put string
+ * @buffsize: Size of string including \0
+ */
+int gpio_get_status(struct udevice *dev, int offset, char *buf, int buffsize);
+
+/**
* gpio_get_function() - get the current function for a GPIO pin
*
* Note this returns GPIOF_UNUSED if the GPIO is not requested.