gpio-matrix-keypad.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. * GPIO driven matrix keypad device tree bindings
  2. GPIO driven matrix keypad is used to interface a SoC with a matrix keypad.
  3. The matrix keypad supports multiple row and column lines, a key can be
  4. placed at each intersection of a unique row and a unique column. The matrix
  5. keypad can sense a key-press and key-release by means of GPIO lines and
  6. report the event using GPIO interrupts to the cpu.
  7. Required Properties:
  8. - compatible: Should be "gpio-matrix-keypad"
  9. - row-gpios: List of gpios used as row lines. The gpio specifier
  10. for this property depends on the gpio controller to
  11. which these row lines are connected.
  12. - col-gpios: List of gpios used as column lines. The gpio specifier
  13. for this property depends on the gpio controller to
  14. which these column lines are connected.
  15. - linux,keymap: The definition can be found at
  16. bindings/input/matrix-keymap.txt
  17. Optional Properties:
  18. - linux,no-autorepeat: do no enable autorepeat feature.
  19. - wakeup-source: use any event on keypad as wakeup event.
  20. (Legacy property supported: "linux,wakeup")
  21. - debounce-delay-ms: debounce interval in milliseconds
  22. - col-scan-delay-us: delay, measured in microseconds, that is needed
  23. before we can scan keypad after activating column gpio
  24. - drive-inactive-cols: drive inactive columns during scan,
  25. default is to turn inactive columns into inputs.
  26. Example:
  27. matrix-keypad {
  28. compatible = "gpio-matrix-keypad";
  29. debounce-delay-ms = <5>;
  30. col-scan-delay-us = <2>;
  31. row-gpios = <&gpio2 25 0
  32. &gpio2 26 0
  33. &gpio2 27 0>;
  34. col-gpios = <&gpio2 21 0
  35. &gpio2 22 0>;
  36. linux,keymap = <0x0000008B
  37. 0x0100009E
  38. 0x02000069
  39. 0x0001006A
  40. 0x0101001C
  41. 0x0201006C>;
  42. };