sppctl.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
  2. /*
  3. * Sunplus dt-bindings Pinctrl header file
  4. * Copyright (C) Sunplus Tech / Tibbo Tech.
  5. * Author: Dvorkin Dmitry <[email protected]>
  6. */
  7. #ifndef __DT_BINDINGS_PINCTRL_SPPCTL_H__
  8. #define __DT_BINDINGS_PINCTRL_SPPCTL_H__
  9. #define IOP_G_MASTE (0x01 << 0)
  10. #define IOP_G_FIRST (0x01 << 1)
  11. #define SPPCTL_PCTL_G_PMUX (0x00 | IOP_G_MASTE)
  12. #define SPPCTL_PCTL_G_GPIO (IOP_G_FIRST | IOP_G_MASTE)
  13. #define SPPCTL_PCTL_G_IOPP (IOP_G_FIRST | 0x00)
  14. #define SPPCTL_PCTL_L_OUT (0x01 << 0) /* Output LOW */
  15. #define SPPCTL_PCTL_L_OU1 (0x01 << 1) /* Output HIGH */
  16. #define SPPCTL_PCTL_L_INV (0x01 << 2) /* Input Invert */
  17. #define SPPCTL_PCTL_L_ONV (0x01 << 3) /* Output Invert */
  18. #define SPPCTL_PCTL_L_ODR (0x01 << 4) /* Output Open Drain */
  19. /*
  20. * pack into 32-bit value:
  21. * pin# (8bit), typ (8bit), function (8bit), flag (8bit)
  22. */
  23. #define SPPCTL_IOPAD(pin, typ, fun, flg) (((pin) << 24) | ((typ) << 16) | \
  24. ((fun) << 8) | (flg))
  25. #endif