pinctrl-nomadik.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef PINCTRL_PINCTRL_NOMADIK_H
  2. #define PINCTRL_PINCTRL_NOMADIK_H
  3. #include <plat/gpio-nomadik.h>
  4. /* Package definitions */
  5. #define PINCTRL_NMK_STN8815 0
  6. #define PINCTRL_NMK_DB8500 1
  7. /**
  8. * struct nmk_function - Nomadik pinctrl mux function
  9. * @name: The name of the function, exported to pinctrl core.
  10. * @groups: An array of pin groups that may select this function.
  11. * @ngroups: The number of entries in @groups.
  12. */
  13. struct nmk_function {
  14. const char *name;
  15. const char * const *groups;
  16. unsigned ngroups;
  17. };
  18. /**
  19. * struct nmk_pingroup - describes a Nomadik pin group
  20. * @name: the name of this specific pin group
  21. * @pins: an array of discrete physical pins used in this group, taken
  22. * from the driver-local pin enumeration space
  23. * @num_pins: the number of pins in this group array, i.e. the number of
  24. * elements in .pins so we can iterate over that array
  25. * @altsetting: the altsetting to apply to all pins in this group to
  26. * configure them to be used by a function
  27. */
  28. struct nmk_pingroup {
  29. const char *name;
  30. const unsigned int *pins;
  31. const unsigned npins;
  32. int altsetting;
  33. };
  34. /**
  35. * struct nmk_pinctrl_soc_data - Nomadik pin controller per-SoC configuration
  36. * @gpio_ranges: An array of GPIO ranges for this SoC
  37. * @gpio_num_ranges: The number of GPIO ranges for this SoC
  38. * @pins: An array describing all pins the pin controller affects.
  39. * All pins which are also GPIOs must be listed first within the
  40. * array, and be numbered identically to the GPIO controller's
  41. * numbering.
  42. * @npins: The number of entries in @pins.
  43. * @functions: The functions supported on this SoC.
  44. * @nfunction: The number of entries in @functions.
  45. * @groups: An array describing all pin groups the pin SoC supports.
  46. * @ngroups: The number of entries in @groups.
  47. */
  48. struct nmk_pinctrl_soc_data {
  49. struct pinctrl_gpio_range *gpio_ranges;
  50. unsigned gpio_num_ranges;
  51. const struct pinctrl_pin_desc *pins;
  52. unsigned npins;
  53. const struct nmk_function *functions;
  54. unsigned nfunctions;
  55. const struct nmk_pingroup *groups;
  56. unsigned ngroups;
  57. };
  58. #ifdef CONFIG_PINCTRL_DB8500
  59. void nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc);
  60. #else
  61. static inline void
  62. nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc)
  63. {
  64. }
  65. #endif
  66. #endif /* PINCTRL_PINCTRL_NOMADIK_H */