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