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