aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 20ca7663975f..23410147555f 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -212,6 +212,43 @@ extern void gpio_unexport(unsigned gpio);
212 212
213#endif /* CONFIG_GPIO_SYSFS */ 213#endif /* CONFIG_GPIO_SYSFS */
214 214
215#ifdef CONFIG_PINCTRL
216
217/**
218 * struct gpio_pin_range - pin range controlled by a gpio chip
219 * @head: list for maintaining set of pin ranges, used internally
220 * @pctldev: pinctrl device which handles corresponding pins
221 * @range: actual range of pins controlled by a gpio controller
222 */
223
224struct gpio_pin_range {
225 struct list_head node;
226 struct pinctrl_dev *pctldev;
227 struct pinctrl_gpio_range range;
228};
229
230int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
231 unsigned int gpio_offset, unsigned int pin_offset,
232 unsigned int npins);
233void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
234
235#else
236
237static inline int
238gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
239 unsigned int gpio_offset, unsigned int pin_offset,
240 unsigned int npins)
241{
242 return 0;
243}
244
245static inline void
246gpiochip_remove_pin_ranges(struct gpio_chip *chip)
247{
248}
249
250#endif /* CONFIG_PINCTRL */
251
215#else /* !CONFIG_GPIOLIB */ 252#else /* !CONFIG_GPIOLIB */
216 253
217static inline bool gpio_is_valid(int number) 254static inline bool gpio_is_valid(int number)
@@ -270,41 +307,4 @@ static inline void gpio_unexport(unsigned gpio)
270} 307}
271#endif /* CONFIG_GPIO_SYSFS */ 308#endif /* CONFIG_GPIO_SYSFS */
272 309
273#ifdef CONFIG_PINCTRL
274
275/**
276 * struct gpio_pin_range - pin range controlled by a gpio chip
277 * @head: list for maintaining set of pin ranges, used internally
278 * @pctldev: pinctrl device which handles corresponding pins
279 * @range: actual range of pins controlled by a gpio controller
280 */
281
282struct gpio_pin_range {
283 struct list_head node;
284 struct pinctrl_dev *pctldev;
285 struct pinctrl_gpio_range range;
286};
287
288int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
289 unsigned int gpio_offset, unsigned int pin_offset,
290 unsigned int npins);
291void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
292
293#else
294
295static inline int
296gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
297 unsigned int gpio_offset, unsigned int pin_offset,
298 unsigned int npins)
299{
300 return 0;
301}
302
303static inline void
304gpiochip_remove_pin_ranges(struct gpio_chip *chip)
305{
306}
307
308#endif /* CONFIG_PINCTRL */
309
310#endif /* _ASM_GENERIC_GPIO_H */ 310#endif /* _ASM_GENERIC_GPIO_H */