pinctrl-imx1.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * IMX pinmux core definitions
  3. *
  4. * Copyright (C) 2012 Freescale Semiconductor, Inc.
  5. * Copyright (C) 2012 Linaro Ltd.
  6. *
  7. * Author: Dong Aisheng <dong.aisheng@linaro.org>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. */
  14. #ifndef __DRIVERS_PINCTRL_IMX1_H
  15. #define __DRIVERS_PINCTRL_IMX1_H
  16. struct platform_device;
  17. /**
  18. * struct imx1_pin - describes an IMX1/21/27 pin.
  19. * @pin_id: ID of the described pin.
  20. * @mux_id: ID of the mux setup.
  21. * @config: Configuration of the pin (currently only pullup-enable).
  22. */
  23. struct imx1_pin {
  24. unsigned int pin_id;
  25. unsigned int mux_id;
  26. unsigned long config;
  27. };
  28. /**
  29. * struct imx1_pin_group - describes an IMX pin group
  30. * @name: the name of this specific pin group
  31. * @pins: an array of imx1_pin structs used in this group
  32. * @npins: the number of pins in this group array, i.e. the number of
  33. * elements in .pins so we can iterate over that array
  34. */
  35. struct imx1_pin_group {
  36. const char *name;
  37. unsigned int *pin_ids;
  38. struct imx1_pin *pins;
  39. unsigned npins;
  40. };
  41. /**
  42. * struct imx1_pmx_func - describes IMX pinmux functions
  43. * @name: the name of this specific function
  44. * @groups: corresponding pin groups
  45. * @num_groups: the number of groups
  46. */
  47. struct imx1_pmx_func {
  48. const char *name;
  49. const char **groups;
  50. unsigned num_groups;
  51. };
  52. struct imx1_pinctrl_soc_info {
  53. struct device *dev;
  54. const struct pinctrl_pin_desc *pins;
  55. unsigned int npins;
  56. struct imx1_pin_group *groups;
  57. unsigned int ngroups;
  58. struct imx1_pmx_func *functions;
  59. unsigned int nfunctions;
  60. };
  61. #define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
  62. int imx1_pinctrl_core_probe(struct platform_device *pdev,
  63. struct imx1_pinctrl_soc_info *info);
  64. #endif /* __DRIVERS_PINCTRL_IMX1_H */