pinctrl-paris.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2018 MediaTek Inc.
  4. *
  5. * Author: Sean Wang <[email protected]>
  6. * Zhiyong Tao <[email protected]>
  7. * Hongzhou.Yang <[email protected]>
  8. */
  9. #ifndef __PINCTRL_PARIS_H
  10. #define __PINCTRL_PARIS_H
  11. #include <linux/io.h>
  12. #include <linux/init.h>
  13. #include <linux/of.h>
  14. #include <linux/of_platform.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/pinctrl/pinctrl.h>
  17. #include <linux/pinctrl/pinmux.h>
  18. #include <linux/pinctrl/pinconf.h>
  19. #include <linux/pinctrl/pinconf-generic.h>
  20. #include "../core.h"
  21. #include "../pinconf.h"
  22. #include "../pinctrl-utils.h"
  23. #include "../pinmux.h"
  24. #include "mtk-eint.h"
  25. #include "pinctrl-mtk-common-v2.h"
  26. #define MTK_RANGE(_a) { .range = (_a), .nranges = ARRAY_SIZE(_a), }
  27. #define MTK_EINT_FUNCTION(_eintmux, _eintnum) \
  28. { \
  29. .eint_m = _eintmux, \
  30. .eint_n = _eintnum, \
  31. }
  32. #define MTK_FUNCTION(_val, _name) \
  33. { \
  34. .muxval = _val, \
  35. .name = _name, \
  36. }
  37. #define MTK_PIN(_number, _name, _eint, _drv_n, ...) { \
  38. .number = _number, \
  39. .name = _name, \
  40. .eint = _eint, \
  41. .drv_n = _drv_n, \
  42. .funcs = (struct mtk_func_desc[]){ \
  43. __VA_ARGS__, { } }, \
  44. }
  45. #define PINCTRL_PIN_GROUP(name, id) \
  46. { \
  47. name, \
  48. id##_pins, \
  49. ARRAY_SIZE(id##_pins), \
  50. id##_funcs, \
  51. }
  52. int mtk_paris_pinctrl_probe(struct platform_device *pdev);
  53. ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
  54. unsigned int gpio, char *buf, unsigned int bufLen);
  55. extern const struct dev_pm_ops mtk_paris_pinctrl_pm_ops;
  56. #endif /* __PINCTRL_PARIS_H */