Input: add st-keyscan driver
authorGabriel FERNANDEZ <gabriel.fernandez@st.com>
Sat, 12 Apr 2014 20:45:50 +0000 (13:45 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 May 2014 23:39:46 +0000 (16:39 -0700)
This patch adds ST Keyscan driver to use the keypad hw a subset of ST
boards provide. Specific board setup will be put in the given dt.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Signed-off-by: Giuseppe Condorelli <giuseppe.condorelli@st.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/devicetree/bindings/input/st-keyscan.txt [new file with mode: 0644]
drivers/input/keyboard/Kconfig
drivers/input/keyboard/Makefile
drivers/input/keyboard/st-keyscan.c [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/input/st-keyscan.txt b/Documentation/devicetree/bindings/input/st-keyscan.txt
new file mode 100644 (file)
index 0000000..51eb428
--- /dev/null
@@ -0,0 +1,60 @@
+* ST Keyscan controller Device Tree bindings
+
+The ST keyscan controller Device Tree binding is based on the
+matrix-keymap.
+
+Required properties:
+- compatible: "st,sti-keyscan"
+
+- reg: Register base address and size of st-keyscan controller.
+
+- interrupts: Interrupt number for the st-keyscan controller.
+
+- clocks: Must contain one entry, for the module clock.
+  See ../clocks/clock-bindings.txt for details.
+
+- pinctrl: Should specify pin control groups used for this controller.
+  See ../pinctrl/pinctrl-bindings.txt for details.
+
+- linux,keymap: The keymap for keys as described in the binding document
+  devicetree/bindings/input/matrix-keymap.txt.
+
+- keypad,num-rows: Number of row lines connected to the keypad controller.
+
+- keypad,num-columns: Number of column lines connected to the keypad
+  controller.
+
+Optional property:
+- st,debounce_us: Debouncing interval time in microseconds
+
+Example:
+
+keyscan: keyscan@fe4b0000 {
+       compatible = "st,sti-keyscan";
+       reg = <0xfe4b0000 0x2000>;
+       interrupts = <GIC_SPI 212 IRQ_TYPE_NONE>;
+       clocks  = <&CLK_SYSIN>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_keyscan>;
+
+       keypad,num-rows = <4>;
+       keypad,num-columns = <4>;
+       st,debounce_us = <5000>;
+
+       linux,keymap = < MATRIX_KEY(0x00, 0x00, KEY_F13)
+                        MATRIX_KEY(0x00, 0x01, KEY_F9)
+                        MATRIX_KEY(0x00, 0x02, KEY_F5)
+                        MATRIX_KEY(0x00, 0x03, KEY_F1)
+                        MATRIX_KEY(0x01, 0x00, KEY_F14)
+                        MATRIX_KEY(0x01, 0x01, KEY_F10)
+                        MATRIX_KEY(0x01, 0x02, KEY_F6)
+                        MATRIX_KEY(0x01, 0x03, KEY_F2)
+                        MATRIX_KEY(0x02, 0x00, KEY_F15)
+                        MATRIX_KEY(0x02, 0x01, KEY_F11)
+                        MATRIX_KEY(0x02, 0x02, KEY_F7)
+                        MATRIX_KEY(0x02, 0x03, KEY_F3)
+                        MATRIX_KEY(0x03, 0x00, KEY_F16)
+                        MATRIX_KEY(0x03, 0x01, KEY_F12)
+                        MATRIX_KEY(0x03, 0x02, KEY_F8)
+                        MATRIX_KEY(0x03, 0x03, KEY_F4) >;
+       };
Simple merge
Simple merge
Simple merge