Lines Matching +full:int +full:- +full:gpios
1 /* SPDX-License-Identifier: GPL-2.0+ */
5 * Copyright (c) 2007-2008 MontaVista Software, Inc.
21 * This is Linux-specific flags. By default controllers' and Linux' mapping
23 * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
52 extern int of_get_named_gpio_flags(const struct device_node *np,
53 const char *list_name, int index, enum of_gpio_flags *flags);
55 extern int of_mm_gpiochip_add_data(struct device_node *np,
58 static inline int of_mm_gpiochip_add(struct device_node *np, in of_mm_gpiochip_add()
70 static inline int of_get_named_gpio_flags(const struct device_node *np, in of_get_named_gpio_flags()
71 const char *list_name, int index, enum of_gpio_flags *flags) in of_get_named_gpio_flags()
76 return -ENOSYS; in of_get_named_gpio_flags()
82 * of_gpio_named_count() - Count GPIOs for a device
83 * @np: device node to count GPIOs for
86 * The function returns the count of GPIOs specified for a node.
88 * Number of gpios defined in property,
89 * -EINVAL for an incorrectly formed gpios property, or
90 * -ENOENT for a missing gpios property
93 * gpios = <0
98 * The above example defines four GPIOs, two of which are not specified.
101 static inline int of_gpio_named_count(const struct device_node *np, in of_gpio_named_count()
104 return of_count_phandle_with_args(np, propname, "#gpio-cells"); in of_gpio_named_count()
108 * of_gpio_count() - Count GPIOs for a device
109 * @np: device node to count GPIOs for
111 * Same as of_gpio_named_count, but hard coded to use the 'gpios' property
113 static inline int of_gpio_count(const struct device_node *np) in of_gpio_count()
115 return of_gpio_named_count(np, "gpios"); in of_gpio_count()
118 static inline int of_get_gpio_flags(const struct device_node *np, int index, in of_get_gpio_flags()
121 return of_get_named_gpio_flags(np, "gpios", index, flags); in of_get_gpio_flags()
125 * of_get_named_gpio() - Get a GPIO number to use with GPIO API
133 static inline int of_get_named_gpio(const struct device_node *np, in of_get_named_gpio()
134 const char *propname, int index) in of_get_named_gpio()
140 * of_get_gpio() - Get a GPIO number to use with GPIO API
147 static inline int of_get_gpio(const struct device_node *np, int index) in of_get_gpio()