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>
This commit is contained in:

committed by
Linus Walleij

parent
7ce7d89f48
commit
a264d10ff4
@@ -135,10 +135,12 @@ 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,
|
||||
enum gpiod_flags dflags);
|
||||
struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
|
||||
const char *con_id,
|
||||
struct fwnode_handle *child);
|
||||
struct fwnode_handle *child,
|
||||
enum gpiod_flags flags);
|
||||
#else /* CONFIG_GPIOLIB */
|
||||
|
||||
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)
|
||||
/* Child properties interface */
|
||||
struct fwnode_handle;
|
||||
|
||||
static inline struct gpio_desc *fwnode_get_named_gpiod(
|
||||
struct fwnode_handle *fwnode, const char *propname)
|
||||
static inline
|
||||
struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
|
||||
const char *propname,
|
||||
enum gpiod_flags dflags)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline struct gpio_desc *devm_get_gpiod_from_child(
|
||||
struct device *dev, const char *con_id, struct fwnode_handle *child)
|
||||
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)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user