summaryrefslogtreecommitdiff
path: root/include/linux/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-02-05 23:14:23 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-02-05 23:14:23 +0100
commite4df1ebdfeb4c68523046667b2d8ef8ab20ae066 (patch)
tree9a518146b64289e304412279b59466fad3799ed6 /include/linux/gpio
parente8e1a5b5679b1ae1ff03a3883b011b84e7226171 (diff)
parent537b94dafce29af6a3e923d216472cfc2f3659af (diff)
Merge branch 'ib-gpiod-flags' into devel
Diffstat (limited to 'include/linux/gpio')
-rw-r--r--include/linux/gpio/consumer.h35
1 files changed, 23 insertions, 12 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 80bad7ebde04..ea9b01d40017 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -135,14 +135,14 @@ int desc_to_gpio(const struct gpio_desc *desc);
struct fwnode_handle;
struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
- const char *propname,
+ const char *propname, int index,
enum gpiod_flags dflags,
const char *label);
-struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
- const char *con_id,
- struct fwnode_handle *child,
- enum gpiod_flags flags,
- const char *label);
+struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
+ const char *con_id, int index,
+ struct fwnode_handle *child,
+ enum gpiod_flags flags,
+ const char *label);
#else /* CONFIG_GPIOLIB */
static inline int gpiod_count(struct device *dev, const char *con_id)
@@ -417,7 +417,7 @@ struct fwnode_handle;
static inline
struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
- const char *propname,
+ const char *propname, int index,
enum gpiod_flags dflags,
const char *label)
{
@@ -425,17 +425,28 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
}
static inline
-struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
- const char *con_id,
- struct fwnode_handle *child,
- enum gpiod_flags flags,
- const char *label)
+struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
+ const char *con_id, int index,
+ struct fwnode_handle *child,
+ enum gpiod_flags flags,
+ const char *label)
{
return ERR_PTR(-ENOSYS);
}
#endif /* CONFIG_GPIOLIB */
+static inline
+struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev,
+ const char *con_id,
+ struct fwnode_handle *child,
+ enum gpiod_flags flags,
+ const char *label)
+{
+ return devm_fwnode_get_index_gpiod_from_child(dev, con_id, 0, child,
+ flags, label);
+}
+
#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
int gpiod_export(struct gpio_desc *desc, bool direction_may_change);