pinconf.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Interface the pinconfig portions of the pinctrl subsystem
  3. *
  4. * Copyright (C) 2011 ST-Ericsson SA
  5. * Written on behalf of Linaro for ST-Ericsson
  6. * This interface is used in the core to keep track of pins.
  7. *
  8. * Author: Linus Walleij <linus.walleij@linaro.org>
  9. *
  10. * License terms: GNU General Public License (GPL) version 2
  11. */
  12. #ifndef __LINUX_PINCTRL_PINCONF_H
  13. #define __LINUX_PINCTRL_PINCONF_H
  14. #ifdef CONFIG_PINCONF
  15. struct pinctrl_dev;
  16. struct seq_file;
  17. /**
  18. * struct pinconf_ops - pin config operations, to be implemented by
  19. * pin configuration capable drivers.
  20. * @pin_config_get: get the config of a certain pin, if the requested config
  21. * is not available on this controller this should return -ENOTSUPP
  22. * and if it is available but disabled it should return -EINVAL
  23. * @pin_config_get: get the config of a certain pin
  24. * @pin_config_set: configure an individual pin
  25. * @pin_config_group_get: get configurations for an entire pin group
  26. * @pin_config_group_set: configure all pins in a group
  27. * @pin_config_dbg_show: optional debugfs display hook that will provide
  28. * per-device info for a certain pin in debugfs
  29. * @pin_config_group_dbg_show: optional debugfs display hook that will provide
  30. * per-device info for a certain group in debugfs
  31. */
  32. struct pinconf_ops {
  33. int (*pin_config_get) (struct pinctrl_dev *pctldev,
  34. unsigned pin,
  35. unsigned long *config);
  36. int (*pin_config_set) (struct pinctrl_dev *pctldev,
  37. unsigned pin,
  38. unsigned long config);
  39. int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
  40. unsigned selector,
  41. unsigned long *config);
  42. int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
  43. unsigned selector,
  44. unsigned long config);
  45. void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,
  46. struct seq_file *s,
  47. unsigned offset);
  48. void (*pin_config_group_dbg_show) (struct pinctrl_dev *pctldev,
  49. struct seq_file *s,
  50. unsigned selector);
  51. };
  52. #endif
  53. #endif /* __LINUX_PINCTRL_PINCONF_H */