brcm,bcm-keypad.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. * Broadcom Keypad Controller device tree bindings
  2. Broadcom Keypad controller is used to interface a SoC with a matrix-type
  3. keypad device. The keypad controller supports multiple row and column lines.
  4. A key can be placed at each intersection of a unique row and a unique column.
  5. The keypad controller can sense a key-press and key-release and report the
  6. event using a interrupt to the cpu.
  7. This binding is based on the matrix-keymap binding with the following
  8. changes:
  9. keypad,num-rows and keypad,num-columns are required.
  10. Required SoC Specific Properties:
  11. - compatible: should be "brcm,bcm-keypad"
  12. - reg: physical base address of the controller and length of memory mapped
  13. region.
  14. - interrupts: The interrupt number to the cpu.
  15. Board Specific Properties:
  16. - keypad,num-rows: Number of row lines connected to the keypad
  17. controller.
  18. - keypad,num-columns: Number of column lines connected to the
  19. keypad controller.
  20. - col-debounce-filter-period: The debounce period for the Column filter.
  21. KEYPAD_DEBOUNCE_1_ms = 0
  22. KEYPAD_DEBOUNCE_2_ms = 1
  23. KEYPAD_DEBOUNCE_4_ms = 2
  24. KEYPAD_DEBOUNCE_8_ms = 3
  25. KEYPAD_DEBOUNCE_16_ms = 4
  26. KEYPAD_DEBOUNCE_32_ms = 5
  27. KEYPAD_DEBOUNCE_64_ms = 6
  28. KEYPAD_DEBOUNCE_128_ms = 7
  29. - status-debounce-filter-period: The debounce period for the Status filter.
  30. KEYPAD_DEBOUNCE_1_ms = 0
  31. KEYPAD_DEBOUNCE_2_ms = 1
  32. KEYPAD_DEBOUNCE_4_ms = 2
  33. KEYPAD_DEBOUNCE_8_ms = 3
  34. KEYPAD_DEBOUNCE_16_ms = 4
  35. KEYPAD_DEBOUNCE_32_ms = 5
  36. KEYPAD_DEBOUNCE_64_ms = 6
  37. KEYPAD_DEBOUNCE_128_ms = 7
  38. - row-output-enabled: An optional property indicating whether the row or
  39. column is being used as output. If specified the row is being used
  40. as the output. Else defaults to column.
  41. - pull-up-enabled: An optional property indicating the Keypad scan mode.
  42. If specified implies the keypad scan pull-up has been enabled.
  43. - autorepeat: Boolean, Enable auto repeat feature of Linux input
  44. subsystem (optional).
  45. - linux,keymap: The keymap for keys as described in the binding document
  46. devicetree/bindings/input/matrix-keymap.txt.
  47. Example:
  48. #include "dt-bindings/input/input.h"
  49. / {
  50. keypad: keypad@180ac000 {
  51. /* Required SoC specific properties */
  52. compatible = "brcm,bcm-keypad";
  53. /* Required Board specific properties */
  54. keypad,num-rows = <5>;
  55. keypad,num-columns = <5>;
  56. status = "okay";
  57. linux,keymap = <MATRIX_KEY(0x00, 0x02, KEY_F) /* key_forward */
  58. MATRIX_KEY(0x00, 0x03, KEY_HOME) /* key_home */
  59. MATRIX_KEY(0x00, 0x04, KEY_M) /* key_message */
  60. MATRIX_KEY(0x01, 0x00, KEY_A) /* key_contacts */
  61. MATRIX_KEY(0x01, 0x01, KEY_1) /* key_1 */
  62. MATRIX_KEY(0x01, 0x02, KEY_2) /* key_2 */
  63. MATRIX_KEY(0x01, 0x03, KEY_3) /* key_3 */
  64. MATRIX_KEY(0x01, 0x04, KEY_S) /* key_speaker */
  65. MATRIX_KEY(0x02, 0x00, KEY_P) /* key_phone */
  66. MATRIX_KEY(0x02, 0x01, KEY_4) /* key_4 */
  67. MATRIX_KEY(0x02, 0x02, KEY_5) /* key_5 */
  68. MATRIX_KEY(0x02, 0x03, KEY_6) /* key_6 */
  69. MATRIX_KEY(0x02, 0x04, KEY_VOLUMEUP) /* key_vol_up */
  70. MATRIX_KEY(0x03, 0x00, KEY_C) /* key_call_log */
  71. MATRIX_KEY(0x03, 0x01, KEY_7) /* key_7 */
  72. MATRIX_KEY(0x03, 0x02, KEY_8) /* key_8 */
  73. MATRIX_KEY(0x03, 0x03, KEY_9) /* key_9 */
  74. MATRIX_KEY(0x03, 0x04, KEY_VOLUMEDOWN) /* key_vol_down */
  75. MATRIX_KEY(0x04, 0x00, KEY_H) /* key_headset */
  76. MATRIX_KEY(0x04, 0x01, KEY_KPASTERISK) /* key_* */
  77. MATRIX_KEY(0x04, 0x02, KEY_0) /* key_0 */
  78. MATRIX_KEY(0x04, 0x03, KEY_GRAVE) /* key_# */
  79. MATRIX_KEY(0x04, 0x04, KEY_MUTE) /* key_mute */
  80. >;
  81. /* Optional board specific properties */
  82. col-debounce-filter-period = <5>;
  83. row-output-enabled;
  84. pull-up-enabled;
  85. };
  86. };