pinctrl-imx.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_IMX_H
  15. #define __DRIVERS_PINCTRL_IMX_H
  16. struct platform_device;
  17. /**
  18. * struct imx_pin - describes a single i.MX pin
  19. * @pin: the pin_id of this pin
  20. * @mux_mode: the mux mode for this pin.
  21. * @input_reg: the select input register offset for this pin if any
  22. * 0 if no select input setting needed.
  23. * @input_val: the select input value for this pin.
  24. * @configs: the config for this pin.
  25. */
  26. struct imx_pin {
  27. unsigned int pin;
  28. unsigned int mux_mode;
  29. u16 input_reg;
  30. unsigned int input_val;
  31. unsigned long config;
  32. };
  33. /**
  34. * struct imx_pin_reg - describe a pin reg map
  35. * @mux_reg: mux register offset
  36. * @conf_reg: config register offset
  37. */
  38. struct imx_pin_reg {
  39. s16 mux_reg;
  40. s16 conf_reg;
  41. };
  42. struct imx_pinctrl_soc_info {
  43. struct device *dev;
  44. const struct pinctrl_pin_desc *pins;
  45. unsigned int npins;
  46. struct imx_pin_reg *pin_regs;
  47. unsigned int group_index;
  48. unsigned int flags;
  49. const char *gpr_compatible;
  50. struct mutex mutex;
  51. };
  52. #define SHARE_MUX_CONF_REG 0x1
  53. #define ZERO_OFFSET_VALID 0x2
  54. #define NO_MUX 0x0
  55. #define NO_PAD 0x0
  56. #define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
  57. #define PAD_CTL_MASK(len) ((1 << len) - 1)
  58. #define IMX_MUX_MASK 0x7
  59. #define IOMUXC_CONFIG_SION (0x1 << 4)
  60. int imx_pinctrl_probe(struct platform_device *pdev,
  61. struct imx_pinctrl_soc_info *info);
  62. #endif /* __DRIVERS_PINCTRL_IMX_H */