pinconf.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * @is_generic: for pin controllers that want to use the generic interface,
  21. * this flag tells the framework that it's generic.
  22. * @pin_config_get: get the config of a certain pin, if the requested config
  23. * is not available on this controller this should return -ENOTSUPP
  24. * and if it is available but disabled it should return -EINVAL
  25. * @pin_config_set: configure an individual pin
  26. * @pin_config_group_get: get configurations for an entire pin group
  27. * @pin_config_group_set: configure all pins in a group
  28. * @pin_config_dbg_show: optional debugfs display hook that will provide
  29. * per-device info for a certain pin in debugfs
  30. * @pin_config_group_dbg_show: optional debugfs display hook that will provide
  31. * per-device info for a certain group in debugfs
  32. * @pin_config_config_dbg_show: optional debugfs display hook that will decode
  33. * and display a driver's pin configuration parameter
  34. */
  35. struct pinconf_ops {
  36. #ifdef CONFIG_GENERIC_PINCONF
  37. bool is_generic;
  38. #endif
  39. int (*pin_config_get) (struct pinctrl_dev *pctldev,
  40. unsigned pin,
  41. unsigned long *config);
  42. int (*pin_config_set) (struct pinctrl_dev *pctldev,
  43. unsigned pin,
  44. unsigned long config);
  45. int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
  46. unsigned selector,
  47. unsigned long *config);
  48. int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
  49. unsigned selector,
  50. unsigned long config);
  51. void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,
  52. struct seq_file *s,
  53. unsigned offset);
  54. void (*pin_config_group_dbg_show) (struct pinctrl_dev *pctldev,
  55. struct seq_file *s,
  56. unsigned selector);
  57. void (*pin_config_config_dbg_show) (struct pinctrl_dev *pctldev,
  58. struct seq_file *s,
  59. unsigned long config);
  60. };
  61. #endif
  62. #endif /* __LINUX_PINCTRL_PINCONF_H */