berlin.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Marvell Berlin SoC pinctrl driver.
  4. *
  5. * Copyright (C) 2014 Marvell Technology Group Ltd.
  6. *
  7. * Antoine Ténart <antoine.tenart@free-electrons.com>
  8. */
  9. #ifndef __PINCTRL_BERLIN_H
  10. #define __PINCTRL_BERLIN_H
  11. struct berlin_desc_function {
  12. const char *name;
  13. u8 muxval;
  14. };
  15. struct berlin_desc_group {
  16. const char *name;
  17. u8 offset;
  18. u8 bit_width;
  19. u8 lsb;
  20. struct berlin_desc_function *functions;
  21. };
  22. struct berlin_pinctrl_desc {
  23. const struct berlin_desc_group *groups;
  24. unsigned ngroups;
  25. };
  26. struct berlin_pinctrl_function {
  27. const char *name;
  28. const char **groups;
  29. unsigned ngroups;
  30. };
  31. #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...) \
  32. { \
  33. .name = _name, \
  34. .offset = _offset, \
  35. .bit_width = _width, \
  36. .lsb = _lsb, \
  37. .functions = (struct berlin_desc_function[]){ \
  38. __VA_ARGS__, { } }, \
  39. }
  40. #define BERLIN_PINCTRL_FUNCTION(_muxval, _name) \
  41. { \
  42. .name = _name, \
  43. .muxval = _muxval, \
  44. }
  45. #define BERLIN_PINCTRL_FUNCTION_UNKNOWN {}
  46. int berlin_pinctrl_probe(struct platform_device *pdev,
  47. const struct berlin_pinctrl_desc *desc);
  48. int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
  49. const struct berlin_pinctrl_desc *desc,
  50. struct regmap *regmap);
  51. #endif /* __PINCTRL_BERLIN_H */