aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/devres.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-01-26 04:00:31 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-01-26 04:00:31 -0500
commit8c541b11483b099b8ce49211e766c6df77dce11b (patch)
tree3b784d41e19dbfe9429e430c94508caafb032590 /drivers/gpio/devres.c
parent49cec4d8326b27e64779f888c680466d7863558f (diff)
parentb2987d7438e0ca949d81774ca8b43d370a1f9947 (diff)
Merge branch 'ib-gpiod-flags' into devel
Diffstat (limited to 'drivers/gpio/devres.c')
-rw-r--r--drivers/gpio/devres.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 2c49a8bc9e3f..d196be7ac352 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -129,13 +129,19 @@ EXPORT_SYMBOL(devm_gpiod_get_index);
129 * @dev: GPIO consumer 129 * @dev: GPIO consumer
130 * @con_id: function within the GPIO consumer 130 * @con_id: function within the GPIO consumer
131 * @child: firmware node (child of @dev) 131 * @child: firmware node (child of @dev)
132 * @flags: GPIO initialization flags
132 * 133 *
133 * GPIO descriptors returned from this function are automatically disposed on 134 * GPIO descriptors returned from this function are automatically disposed on
134 * driver detach. 135 * driver detach.
136 *
137 * On successfull request the GPIO pin is configured in accordance with
138 * provided @flags.
135 */ 139 */
136struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, 140struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
137 const char *con_id, 141 const char *con_id,
138 struct fwnode_handle *child) 142 struct fwnode_handle *child,
143 enum gpiod_flags flags,
144 const char *label)
139{ 145{
140 char prop_name[32]; /* 32 is max size of property name */ 146 char prop_name[32]; /* 32 is max size of property name */
141 struct gpio_desc **dr; 147 struct gpio_desc **dr;
@@ -155,7 +161,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
155 snprintf(prop_name, sizeof(prop_name), "%s", 161 snprintf(prop_name, sizeof(prop_name), "%s",
156 gpio_suffixes[i]); 162 gpio_suffixes[i]);
157 163
158 desc = fwnode_get_named_gpiod(child, prop_name); 164 desc = fwnode_get_named_gpiod(child, prop_name, flags, label);
159 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) 165 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
160 break; 166 break;
161 } 167 }