pinctrl-imx.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __DRIVERS_PINCTRL_IMX_H
  7. #define __DRIVERS_PINCTRL_IMX_H
  8. /**
  9. * @base: the address to the controller in virtual memory
  10. * @input_sel_base: the address of the select input in virtual memory.
  11. * @flags: flags specific for each soc
  12. */
  13. struct imx_pinctrl_soc_info {
  14. void __iomem *base;
  15. void __iomem *input_sel_base;
  16. unsigned int flags;
  17. };
  18. /**
  19. * @dev: a pointer back to containing device
  20. * @info: the soc info
  21. */
  22. struct imx_pinctrl_priv {
  23. struct udevice *dev;
  24. struct imx_pinctrl_soc_info *info;
  25. };
  26. extern const struct pinctrl_ops imx_pinctrl_ops;
  27. #define IMX_NO_PAD_CTL 0x80000000 /* no pin config need */
  28. #define IMX_PAD_SION 0x40000000 /* set SION */
  29. /*
  30. * Each pin represented in fsl,pins consists of 5 u32 PIN_FUNC_ID and
  31. * 1 u32 CONFIG, so 24 types in total for each pin.
  32. */
  33. #define FSL_PIN_SIZE 24
  34. #define SHARE_FSL_PIN_SIZE 20
  35. #define SHARE_MUX_CONF_REG 0x1
  36. #define ZERO_OFFSET_VALID 0x2
  37. #define IOMUXC_CONFIG_SION (0x1 << 4)
  38. int imx_pinctrl_probe(struct udevice *dev, struct imx_pinctrl_soc_info *info);
  39. int imx_pinctrl_remove(struct udevice *dev);
  40. #endif /* __DRIVERS_PINCTRL_IMX_H */