summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2019-06-12 06:11:46 +0200
committerTom Rini <trini@konsulko.com>2019-07-13 11:11:30 -0400
commit5fc7cf8c8e268590f3b0037eecea7f6798209f78 (patch)
tree73ec4655db11a32f1fe7a8495b9c42d81093de76 /include
parent42f15397275c6341abbdbb7a2d1188992274c5bb (diff)
downloadu-boot-5fc7cf8c8e268590f3b0037eecea7f6798209f78.tar.gz
u-boot-5fc7cf8c8e268590f3b0037eecea7f6798209f78.tar.xz
u-boot-5fc7cf8c8e268590f3b0037eecea7f6798209f78.zip
gpio: add gpio-hog support
add gpio-hog support. GPIO hogging is a mechanism providing automatic GPIO request and configuration as part of the gpio-controller's driver probe function. for more infos see: doc/device-tree-bindings/gpio/gpio.txt Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Michal Simek <michal.simek@xilinx.com> (zcu102) Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index d03602696f..37f71e5708 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -349,6 +349,22 @@ const char *gpio_get_bank_info(struct udevice *dev, int *offset_count);
int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc);
/**
+ * gpio_hog_lookup_name() - Look up a named GPIO and return the gpio descr.
+ *
+ * @name: Name to look up
+ * @return: Returns gpio_desc for gpio
+ */
+struct gpio_desc *gpio_hog_lookup_name(const char *name);
+
+/**
+ * gpio_hog_probe_all() - probe all gpio devices with
+ * gpio-hog subnodes.
+ *
+ * @return: Returns return value from device_probe()
+ */
+int gpio_hog_probe_all(void);
+
+/**
* gpio_lookup_name - Look up a GPIO name and return its details
*
* This is used to convert a named GPIO into a device, offset and GPIO
@@ -504,6 +520,22 @@ int gpio_request_list_by_name_nodev(ofnode node, const char *list_name,
int flags);
/**
+ * gpio_dev_request_index() - request single GPIO from gpio device
+ *
+ * @dev: GPIO device
+ * @nodename: Name of node
+ * @list_name: Name of GPIO list (e.g. "board-id-gpios")
+ * @index: Index number of the GPIO in that list use request (0=first)
+ * @flags: GPIOD_* flags
+ * @dtflags: GPIO flags read from DT
+ * @desc: GPIO descriotor filled from this function
+ * @return: return value from gpio_request_tail()
+ */
+int gpio_dev_request_index(struct udevice *dev, const char *nodename,
+ char *list_name, int index, int flags,
+ int dtflags, struct gpio_desc *desc);
+
+/**
* dm_gpio_free() - Free a single GPIO
*
* This frees a single GPIOs previously returned from gpio_request_by_name().