0001 * Broadcom Keypad Controller device tree bindings
0002
0003 Broadcom Keypad controller is used to interface a SoC with a matrix-type
0004 keypad device. The keypad controller supports multiple row and column lines.
0005 A key can be placed at each intersection of a unique row and a unique column.
0006 The keypad controller can sense a key-press and key-release and report the
0007 event using a interrupt to the cpu.
0008
0009 This binding is based on the matrix-keymap binding with the following
0010 changes:
0011
0012 keypad,num-rows and keypad,num-columns are required.
0013
0014 Required SoC Specific Properties:
0015 - compatible: should be "brcm,bcm-keypad"
0016
0017 - reg: physical base address of the controller and length of memory mapped
0018 region.
0019
0020 - interrupts: The interrupt number to the cpu.
0021
0022 Board Specific Properties:
0023 - keypad,num-rows: Number of row lines connected to the keypad
0024 controller.
0025
0026 - keypad,num-columns: Number of column lines connected to the
0027 keypad controller.
0028
0029 - col-debounce-filter-period: The debounce period for the Column filter.
0030
0031 KEYPAD_DEBOUNCE_1_ms = 0
0032 KEYPAD_DEBOUNCE_2_ms = 1
0033 KEYPAD_DEBOUNCE_4_ms = 2
0034 KEYPAD_DEBOUNCE_8_ms = 3
0035 KEYPAD_DEBOUNCE_16_ms = 4
0036 KEYPAD_DEBOUNCE_32_ms = 5
0037 KEYPAD_DEBOUNCE_64_ms = 6
0038 KEYPAD_DEBOUNCE_128_ms = 7
0039
0040 - status-debounce-filter-period: The debounce period for the Status filter.
0041
0042 KEYPAD_DEBOUNCE_1_ms = 0
0043 KEYPAD_DEBOUNCE_2_ms = 1
0044 KEYPAD_DEBOUNCE_4_ms = 2
0045 KEYPAD_DEBOUNCE_8_ms = 3
0046 KEYPAD_DEBOUNCE_16_ms = 4
0047 KEYPAD_DEBOUNCE_32_ms = 5
0048 KEYPAD_DEBOUNCE_64_ms = 6
0049 KEYPAD_DEBOUNCE_128_ms = 7
0050
0051 - row-output-enabled: An optional property indicating whether the row or
0052 column is being used as output. If specified the row is being used
0053 as the output. Else defaults to column.
0054
0055 - pull-up-enabled: An optional property indicating the Keypad scan mode.
0056 If specified implies the keypad scan pull-up has been enabled.
0057
0058 - autorepeat: Boolean, Enable auto repeat feature of Linux input
0059 subsystem (optional).
0060
0061 - linux,keymap: The keymap for keys as described in the binding document
0062 devicetree/bindings/input/matrix-keymap.txt.
0063
0064 Example:
0065 #include "dt-bindings/input/input.h"
0066
0067 / {
0068 keypad: keypad@180ac000 {
0069 /* Required SoC specific properties */
0070 compatible = "brcm,bcm-keypad";
0071
0072 /* Required Board specific properties */
0073 keypad,num-rows = <5>;
0074 keypad,num-columns = <5>;
0075
0076 linux,keymap = <MATRIX_KEY(0x00, 0x02, KEY_F) /* key_forward */
0077 MATRIX_KEY(0x00, 0x03, KEY_HOME) /* key_home */
0078 MATRIX_KEY(0x00, 0x04, KEY_M) /* key_message */
0079 MATRIX_KEY(0x01, 0x00, KEY_A) /* key_contacts */
0080 MATRIX_KEY(0x01, 0x01, KEY_1) /* key_1 */
0081 MATRIX_KEY(0x01, 0x02, KEY_2) /* key_2 */
0082 MATRIX_KEY(0x01, 0x03, KEY_3) /* key_3 */
0083 MATRIX_KEY(0x01, 0x04, KEY_S) /* key_speaker */
0084 MATRIX_KEY(0x02, 0x00, KEY_P) /* key_phone */
0085 MATRIX_KEY(0x02, 0x01, KEY_4) /* key_4 */
0086 MATRIX_KEY(0x02, 0x02, KEY_5) /* key_5 */
0087 MATRIX_KEY(0x02, 0x03, KEY_6) /* key_6 */
0088 MATRIX_KEY(0x02, 0x04, KEY_VOLUMEUP) /* key_vol_up */
0089 MATRIX_KEY(0x03, 0x00, KEY_C) /* key_call_log */
0090 MATRIX_KEY(0x03, 0x01, KEY_7) /* key_7 */
0091 MATRIX_KEY(0x03, 0x02, KEY_8) /* key_8 */
0092 MATRIX_KEY(0x03, 0x03, KEY_9) /* key_9 */
0093 MATRIX_KEY(0x03, 0x04, KEY_VOLUMEDOWN) /* key_vol_down */
0094 MATRIX_KEY(0x04, 0x00, KEY_H) /* key_headset */
0095 MATRIX_KEY(0x04, 0x01, KEY_KPASTERISK) /* key_* */
0096 MATRIX_KEY(0x04, 0x02, KEY_0) /* key_0 */
0097 MATRIX_KEY(0x04, 0x03, KEY_GRAVE) /* key_# */
0098 MATRIX_KEY(0x04, 0x04, KEY_MUTE) /* key_mute */
0099 >;
0100
0101 /* Optional board specific properties */
0102 col-debounce-filter-period = <5>;
0103 row-output-enabled;
0104 pull-up-enabled;
0105
0106 };
0107 };