devicetree.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Internal interface to pinctrl device tree integration
  3. *
  4. * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. struct of_phandle_args;
  19. #ifdef CONFIG_OF
  20. bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev);
  21. void pinctrl_dt_free_maps(struct pinctrl *p);
  22. int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev);
  23. int pinctrl_count_index_with_args(const struct device_node *np,
  24. const char *list_name);
  25. int pinctrl_parse_index_with_args(const struct device_node *np,
  26. const char *list_name, int index,
  27. struct of_phandle_args *out_args);
  28. #else
  29. static inline bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev)
  30. {
  31. return false;
  32. }
  33. static inline int pinctrl_dt_to_map(struct pinctrl *p,
  34. struct pinctrl_dev *pctldev)
  35. {
  36. return 0;
  37. }
  38. static inline void pinctrl_dt_free_maps(struct pinctrl *p)
  39. {
  40. }
  41. static inline int pinctrl_count_index_with_args(const struct device_node *np,
  42. const char *list_name)
  43. {
  44. return -ENODEV;
  45. }
  46. static inline int
  47. pinctrl_parse_index_with_args(const struct device_node *np,
  48. const char *list_name, int index,
  49. struct of_phandle_args *out_args)
  50. {
  51. return -ENODEV;
  52. }
  53. #endif