pinctrl-imx1.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * IMX pinmux core definitions
  4. *
  5. * Copyright (C) 2012 Freescale Semiconductor, Inc.
  6. * Copyright (C) 2012 Linaro Ltd.
  7. *
  8. * Author: Dong Aisheng <[email protected]>
  9. */
  10. #ifndef __DRIVERS_PINCTRL_IMX1_H
  11. #define __DRIVERS_PINCTRL_IMX1_H
  12. struct platform_device;
  13. /**
  14. * struct imx1_pin - describes an IMX1/21/27 pin.
  15. * @pin_id: ID of the described pin.
  16. * @mux_id: ID of the mux setup.
  17. * @config: Configuration of the pin (currently only pullup-enable).
  18. */
  19. struct imx1_pin {
  20. unsigned int pin_id;
  21. unsigned int mux_id;
  22. unsigned long config;
  23. };
  24. /**
  25. * struct imx1_pin_group - describes an IMX pin group
  26. * @name: the name of this specific pin group
  27. * @pins: an array of imx1_pin structs used in this group
  28. * @npins: the number of pins in this group array, i.e. the number of
  29. * elements in .pins so we can iterate over that array
  30. */
  31. struct imx1_pin_group {
  32. const char *name;
  33. unsigned int *pin_ids;
  34. struct imx1_pin *pins;
  35. unsigned npins;
  36. };
  37. /**
  38. * struct imx1_pmx_func - describes IMX pinmux functions
  39. * @name: the name of this specific function
  40. * @groups: corresponding pin groups
  41. * @num_groups: the number of groups
  42. */
  43. struct imx1_pmx_func {
  44. const char *name;
  45. const char **groups;
  46. unsigned num_groups;
  47. };
  48. struct imx1_pinctrl_soc_info {
  49. struct device *dev;
  50. const struct pinctrl_pin_desc *pins;
  51. unsigned int npins;
  52. struct imx1_pin_group *groups;
  53. unsigned int ngroups;
  54. struct imx1_pmx_func *functions;
  55. unsigned int nfunctions;
  56. };
  57. #define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
  58. int imx1_pinctrl_core_probe(struct platform_device *pdev,
  59. struct imx1_pinctrl_soc_info *info);
  60. #endif /* __DRIVERS_PINCTRL_IMX1_H */