diff options
Diffstat (limited to 'include/linux/gpio')
| -rw-r--r-- | include/linux/gpio/consumer.h | 35 |
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); | |||
| 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, int index, |
| 139 | enum gpiod_flags dflags, | 139 | enum gpiod_flags dflags, |
| 140 | const char *label); | 140 | const char *label); |
| 141 | struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, | 141 | struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, |
| 142 | const char *con_id, | 142 | const char *con_id, int index, |
| 143 | struct fwnode_handle *child, | 143 | struct fwnode_handle *child, |
| 144 | enum gpiod_flags flags, | 144 | enum gpiod_flags flags, |
| 145 | const char *label); | 145 | const char *label); |
| 146 | #else /* CONFIG_GPIOLIB */ | 146 | #else /* CONFIG_GPIOLIB */ |
| 147 | 147 | ||
| 148 | static inline int gpiod_count(struct device *dev, const char *con_id) | 148 | static inline int gpiod_count(struct device *dev, const char *con_id) |
| @@ -417,7 +417,7 @@ struct fwnode_handle; | |||
| 417 | 417 | ||
| 418 | static inline | 418 | static inline |
| 419 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, | 419 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, |
| 420 | const char *propname, | 420 | const char *propname, int index, |
| 421 | enum gpiod_flags dflags, | 421 | enum gpiod_flags dflags, |
| 422 | const char *label) | 422 | const char *label) |
| 423 | { | 423 | { |
| @@ -425,17 +425,28 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, | |||
| 425 | } | 425 | } |
| 426 | 426 | ||
| 427 | static inline | 427 | static inline |
| 428 | struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, | 428 | struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, |
| 429 | const char *con_id, | 429 | const char *con_id, int index, |
| 430 | struct fwnode_handle *child, | 430 | struct fwnode_handle *child, |
| 431 | enum gpiod_flags flags, | 431 | enum gpiod_flags flags, |
| 432 | const char *label) | 432 | const char *label) |
| 433 | { | 433 | { |
| 434 | return ERR_PTR(-ENOSYS); | 434 | return ERR_PTR(-ENOSYS); |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | #endif /* CONFIG_GPIOLIB */ | 437 | #endif /* CONFIG_GPIOLIB */ |
| 438 | 438 | ||
| 439 | static inline | ||
| 440 | struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, | ||
| 441 | const char *con_id, | ||
| 442 | struct fwnode_handle *child, | ||
| 443 | enum gpiod_flags flags, | ||
| 444 | const char *label) | ||
| 445 | { | ||
| 446 | return devm_fwnode_get_index_gpiod_from_child(dev, con_id, 0, child, | ||
| 447 | flags, label); | ||
| 448 | } | ||
| 449 | |||
| 439 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) | 450 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) |
| 440 | 451 | ||
| 441 | int gpiod_export(struct gpio_desc *desc, bool direction_may_change); | 452 | int gpiod_export(struct gpio_desc *desc, bool direction_may_change); |
