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