devicetree.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Internal interface to pinctrl device tree integration
  4. *
  5. * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
  6. */
  7. #include <linux/errno.h>
  8. struct device_node;
  9. struct of_phandle_args;
  10. struct pinctrl;
  11. struct pinctrl_dev;
  12. #ifdef CONFIG_OF
  13. void pinctrl_dt_free_maps(struct pinctrl *p);
  14. int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev);
  15. int pinctrl_count_index_with_args(const struct device_node *np,
  16. const char *list_name);
  17. int pinctrl_parse_index_with_args(const struct device_node *np,
  18. const char *list_name, int index,
  19. struct of_phandle_args *out_args);
  20. #else
  21. static inline int pinctrl_dt_to_map(struct pinctrl *p,
  22. struct pinctrl_dev *pctldev)
  23. {
  24. return 0;
  25. }
  26. static inline void pinctrl_dt_free_maps(struct pinctrl *p)
  27. {
  28. }
  29. static inline int pinctrl_count_index_with_args(const struct device_node *np,
  30. const char *list_name)
  31. {
  32. return -ENODEV;
  33. }
  34. static inline int
  35. pinctrl_parse_index_with_args(const struct device_node *np,
  36. const char *list_name, int index,
  37. struct of_phandle_args *out_args)
  38. {
  39. return -ENODEV;
  40. }
  41. #endif