pinctrl-s32.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0-or-later
  2. *
  3. * S32 pinmux core definitions
  4. *
  5. * Copyright 2016-2020, 2022 NXP
  6. * Copyright (C) 2022 SUSE LLC
  7. * Copyright 2015-2016 Freescale Semiconductor, Inc.
  8. * Copyright (C) 2012 Linaro Ltd.
  9. */
  10. #ifndef __DRIVERS_PINCTRL_S32_H
  11. #define __DRIVERS_PINCTRL_S32_H
  12. struct platform_device;
  13. /**
  14. * struct s32_pin_group - describes an S32 pin group
  15. * @data: generic data describes group name, number of pins, and a pin array in
  16. this group.
  17. * @pin_sss: an array of source signal select configs paired with pin array.
  18. */
  19. struct s32_pin_group {
  20. struct pingroup data;
  21. unsigned int *pin_sss;
  22. };
  23. /**
  24. * struct s32_pin_range - pin ID range for each memory region.
  25. * @start: start pin ID
  26. * @end: end pin ID
  27. */
  28. struct s32_pin_range {
  29. unsigned int start;
  30. unsigned int end;
  31. };
  32. struct s32_pinctrl_soc_data {
  33. const struct pinctrl_pin_desc *pins;
  34. unsigned int npins;
  35. const struct s32_pin_range *mem_pin_ranges;
  36. unsigned int mem_regions;
  37. };
  38. struct s32_pinctrl_soc_info {
  39. struct device *dev;
  40. const struct s32_pinctrl_soc_data *soc_data;
  41. struct s32_pin_group *groups;
  42. unsigned int ngroups;
  43. struct pinfunction *functions;
  44. unsigned int nfunctions;
  45. unsigned int grp_index;
  46. };
  47. #define S32_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
  48. #define S32_PIN_RANGE(_start, _end) { .start = _start, .end = _end }
  49. int s32_pinctrl_probe(struct platform_device *pdev,
  50. const struct s32_pinctrl_soc_data *soc_data);
  51. int s32_pinctrl_resume(struct device *dev);
  52. int s32_pinctrl_suspend(struct device *dev);
  53. #endif /* __DRIVERS_PINCTRL_S32_H */