gpio.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * This header provides constants for most GPIO bindings.
  4. *
  5. * Most GPIO bindings include a flags cell as part of the GPIO specifier.
  6. * In most cases, the format of the flags cell uses the standard values
  7. * defined in this header.
  8. */
  9. #ifndef _DT_BINDINGS_GPIO_GPIO_H
  10. #define _DT_BINDINGS_GPIO_GPIO_H
  11. /* Bit 0 express polarity */
  12. #define GPIO_ACTIVE_HIGH 0
  13. #define GPIO_ACTIVE_LOW 1
  14. /* Bit 1 express single-endedness */
  15. #define GPIO_PUSH_PULL 0
  16. #define GPIO_SINGLE_ENDED 2
  17. /* Bit 2 express Open drain or open source */
  18. #define GPIO_LINE_OPEN_SOURCE 0
  19. #define GPIO_LINE_OPEN_DRAIN 4
  20. /*
  21. * Open Drain/Collector is the combination of single-ended open drain interface.
  22. * Open Source/Emitter is the combination of single-ended open source interface.
  23. */
  24. #define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN)
  25. #define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE)
  26. /* Bit 3 express GPIO suspend/resume and reset persistence */
  27. #define GPIO_PERSISTENT 0
  28. #define GPIO_TRANSITORY 8
  29. /* Bit 4 express pull up */
  30. #define GPIO_PULL_UP 16
  31. /* Bit 5 express pull down */
  32. #define GPIO_PULL_DOWN 32
  33. #endif