diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-01-09 09:02:28 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-26 03:59:32 -0500 |
| commit | a264d10ff45c688293d9112fddd8d29c819e0853 (patch) | |
| tree | 850a9dac5d81c8dfdd8bb4bcdc5247408ea59d9e /include | |
| parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (diff) | |
gpiolib: Convert fwnode_get_named_gpiod() to configure GPIO
Make fwnode_get_named_gpiod() consistent with the rest of
gpiod_get() like API, i.e. configure GPIO pin immediately after
request.
Besides obvious clean up it will help to configure pins based
on firmware provided resources.
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/gpio/consumer.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index fb0fde686cb1..930d10049d8d 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h | |||
| @@ -135,10 +135,12 @@ int desc_to_gpio(const struct gpio_desc *desc); | |||
| 135 | struct fwnode_handle; | 135 | struct fwnode_handle; |
| 136 | 136 | ||
| 137 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, | 137 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, |
| 138 | const char *propname); | 138 | const char *propname, |
| 139 | enum gpiod_flags dflags); | ||
| 139 | struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, | 140 | struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, |
| 140 | const char *con_id, | 141 | const char *con_id, |
| 141 | struct fwnode_handle *child); | 142 | struct fwnode_handle *child, |
| 143 | enum gpiod_flags flags); | ||
| 142 | #else /* CONFIG_GPIOLIB */ | 144 | #else /* CONFIG_GPIOLIB */ |
| 143 | 145 | ||
| 144 | static inline int gpiod_count(struct device *dev, const char *con_id) | 146 | static inline int gpiod_count(struct device *dev, const char *con_id) |
| @@ -411,14 +413,19 @@ static inline int desc_to_gpio(const struct gpio_desc *desc) | |||
| 411 | /* Child properties interface */ | 413 | /* Child properties interface */ |
| 412 | struct fwnode_handle; | 414 | struct fwnode_handle; |
| 413 | 415 | ||
| 414 | static inline struct gpio_desc *fwnode_get_named_gpiod( | 416 | static inline |
| 415 | struct fwnode_handle *fwnode, const char *propname) | 417 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, |
| 418 | const char *propname, | ||
| 419 | enum gpiod_flags dflags) | ||
| 416 | { | 420 | { |
| 417 | return ERR_PTR(-ENOSYS); | 421 | return ERR_PTR(-ENOSYS); |
| 418 | } | 422 | } |
| 419 | 423 | ||
| 420 | static inline struct gpio_desc *devm_get_gpiod_from_child( | 424 | static inline |
| 421 | struct device *dev, const char *con_id, struct fwnode_handle *child) | 425 | struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, |
| 426 | const char *con_id, | ||
| 427 | struct fwnode_handle *child, | ||
| 428 | enum gpiod_flags flags) | ||
| 422 | { | 429 | { |
| 423 | return ERR_PTR(-ENOSYS); | 430 | return ERR_PTR(-ENOSYS); |
| 424 | } | 431 | } |
