pins.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
  5. * License terms: GNU General Public License (GPL), version 2
  6. */
  7. #ifndef __MACH_UX500_PINS_H
  8. #define __MACH_UX500_PINS_H
  9. #include <linux/list.h>
  10. #include <plat/pincfg.h>
  11. #define PIN_LOOKUP(_name, _pins) \
  12. { \
  13. .name = _name, \
  14. .pins = _pins, \
  15. }
  16. #define UX500_PINS(name, pins...) \
  17. struct ux500_pins name = { \
  18. .cfg = (pin_cfg_t[]) {pins}, \
  19. .num = ARRAY_SIZE(((pin_cfg_t[]) {pins})), \
  20. }
  21. struct ux500_pins {
  22. int usage;
  23. int num;
  24. pin_cfg_t *cfg;
  25. };
  26. struct ux500_pin_lookup {
  27. struct list_head node;
  28. const char *name;
  29. struct ux500_pins *pins;
  30. };
  31. void __init ux500_pins_add(struct ux500_pin_lookup *pl, size_t num);
  32. void __init ux500_offchip_gpio_init(struct ux500_pins *pins);
  33. struct ux500_pins *ux500_pins_get(const char *name);
  34. int ux500_pins_enable(struct ux500_pins *pins);
  35. int ux500_pins_disable(struct ux500_pins *pins);
  36. void ux500_pins_put(struct ux500_pins *pins);
  37. int pins_for_u9500(void);
  38. #endif