pinmux.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License version 2 as
  4. * publishhed by the Free Software Foundation.
  5. *
  6. * Copyright (C) 2012 John Crispin <john@phrozen.org>
  7. */
  8. #ifndef _RT288X_PINMUX_H__
  9. #define _RT288X_PINMUX_H__
  10. #define FUNC(name, value, pin_first, pin_count) \
  11. { name, value, pin_first, pin_count }
  12. #define GRP(_name, _func, _mask, _shift) \
  13. { .name = _name, .mask = _mask, .shift = _shift, \
  14. .func = _func, .gpio = _mask, \
  15. .func_count = ARRAY_SIZE(_func) }
  16. #define GRP_G(_name, _func, _mask, _gpio, _shift) \
  17. { .name = _name, .mask = _mask, .shift = _shift, \
  18. .func = _func, .gpio = _gpio, \
  19. .func_count = ARRAY_SIZE(_func) }
  20. struct rt2880_pmx_group;
  21. struct rt2880_pmx_func {
  22. const char *name;
  23. const char value;
  24. int pin_first;
  25. int pin_count;
  26. int *pins;
  27. int *groups;
  28. int group_count;
  29. int enabled;
  30. };
  31. struct rt2880_pmx_group {
  32. const char *name;
  33. int enabled;
  34. const u32 shift;
  35. const char mask;
  36. const char gpio;
  37. struct rt2880_pmx_func *func;
  38. int func_count;
  39. };
  40. extern struct rt2880_pmx_group *rt2880_pinmux_data;
  41. #endif