Skip to content

Commit

Permalink
input: Extend matrix-keypad device tree binding
Browse files Browse the repository at this point in the history
Some matrix keypad drivers can support different numbers of rows and
columns. Add a generic binding for these.

Implementation note:

In order to implement this binding in the kernel, we will need to modify
matrix_keypad_() to look up the number of rows and cols in
the keymap. Perhaps this could be done by passing 0 for these parameters?
Many of the parameters can already be set to NULL. Ick.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Simon Glass authored and Grant Likely committed Feb 8, 2013
1 parent d2f4ec1 commit 1d0b1c7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
9 changes: 6 additions & 3 deletions Documentation/devicetree/bindings/input/lpc32xx-key.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
NXP LPC32xx Key Scan Interface

This binding is based on the matrix-keymap binding with the following
changes:

Required Properties:
- compatible: Should be "nxp,lpc3220-key"
- reg: Physical base address of the controller and length of memory mapped
region.
- interrupts: The interrupt number to the cpu.
- keypad,num-rows: Number of rows and columns, e.g. 1: 1x1, 6: 6x6
- keypad,num-columns: Must be equal to keypad,num-rows since LPC32xx only
supports square matrices
- nxp,debounce-delay-ms: Debounce delay in ms
- nxp,scan-delay-ms: Repeated scan period in ms
- linux,keymap: the key-code to be reported when the key is pressed
and released, see also
Documentation/devicetree/bindings/input/matrix-keymap.txt

Note: keypad,num-rows and keypad,num-columns are required, and must be equal
since LPC32xx only supports square matrices

Example:

key@40050000 {
Expand Down
8 changes: 8 additions & 0 deletions Documentation/devicetree/bindings/input/matrix-keymap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Required properties:
row << 24 | column << 16 | key-code

Optional properties:
Properties for the number of rows and columns are optional because some
drivers will use fixed values for these.
- keypad,num-rows: Number of row lines connected to the keypad controller.
- keypad,num-columns: Number of column lines connected to the keypad
controller.

Some users of this binding might choose to specify secondary keymaps for
cases where there is a modifier key such as a Fn key. Proposed names
for said properties are "linux,fn-keymap" or with another descriptive
Expand All @@ -17,3 +23,5 @@ word for the modifier other from "Fn".
Example:
linux,keymap = < 0x00030012
0x0102003a >;
keypad,num-rows = <2>;
keypad,num-columns = <8>;
13 changes: 5 additions & 8 deletions Documentation/devicetree/bindings/input/omap-keypad.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ A key can be placed at each intersection of a unique row and a unique column.
The keypad controller can sense a key-press and key-release and report the
event using a interrupt to the cpu.

This binding is based on the matrix-keymap binding with the following
changes:

keypad,num-rows and keypad,num-columns are required.

Required SoC Specific Properties:
- compatible: should be one of the following
- "ti,omap4-keypad": For controllers compatible with omap4 keypad
controller.

Required Board Specific Properties, in addition to those specified by
the shared matrix-keyboard bindings:
- 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 Properties specific to linux:
- linux,keypad-no-autorepeat: do no enable autorepeat feature.

Expand Down
6 changes: 4 additions & 2 deletions Documentation/devicetree/bindings/input/tca8418_keypad.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
This binding is based on the matrix-keymap binding with the following
changes:

keypad,num-rows and keypad,num-columns are required.

Required properties:
- compatible: "ti,tca8418"
- reg: the I2C address
- interrupts: IRQ line number, should trigger on falling edge
- keypad,num-rows: The number of rows
- keypad,num-columns: The number of columns
- linux,keymap: Keys definitions, see keypad-matrix.

0 comments on commit 1d0b1c7

Please sign in to comment.