All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] input: Extend matrix-keypad device tree binding
@ 2013-01-11  1:41 Simon Glass
  2013-01-11 17:09 ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2013-01-11  1:41 UTC (permalink / raw)
  To: LKML
  Cc: Simon Glass, linux-input, Rob Landley, Grant Likely,
	devicetree-discuss, Roland Stigge, linux-doc, Vincent Palatin,
	Wolfram Sang, Dmitry Torokhov, Felipe Balbi, Sourav Poddar,
	Luigi Semenzato, Olof Johansson, Rob Herring, Stephen Warren,
	Alban Bedel

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>
---
Changes in v2:
- Remove repeat rate parameters
- Update TI OMAP, tca8418 and lpc32xx bindings to use this one

 .../devicetree/bindings/input/lpc32xx-key.txt      |    9 ++++++---
 .../devicetree/bindings/input/matrix-keymap.txt    |    8 ++++++++
 .../devicetree/bindings/input/omap-keypad.txt      |   13 +++++--------
 .../devicetree/bindings/input/tca8418_keypad.txt   |    6 ++++--
 4 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/lpc32xx-key.txt b/Documentation/devicetree/bindings/input/lpc32xx-key.txt
index 31afd50..bcf62f8 100644
--- a/Documentation/devicetree/bindings/input/lpc32xx-key.txt
+++ b/Documentation/devicetree/bindings/input/lpc32xx-key.txt
@@ -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 {
diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.txt b/Documentation/devicetree/bindings/input/matrix-keymap.txt
index 3cd8b98..c54919f 100644
--- a/Documentation/devicetree/bindings/input/matrix-keymap.txt
+++ b/Documentation/devicetree/bindings/input/matrix-keymap.txt
@@ -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
@@ -17,3 +23,5 @@ word for the modifier other from "Fn".
 Example:
 	linux,keymap = < 0x00030012
 			 0x0102003a >;
+	keypad,num-rows = <2>;
+	keypad,num-columns = <8>;
diff --git a/Documentation/devicetree/bindings/input/omap-keypad.txt b/Documentation/devicetree/bindings/input/omap-keypad.txt
index f2fa5e1..34ed1c6 100644
--- a/Documentation/devicetree/bindings/input/omap-keypad.txt
+++ b/Documentation/devicetree/bindings/input/omap-keypad.txt
@@ -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.
 
diff --git a/Documentation/devicetree/bindings/input/tca8418_keypad.txt b/Documentation/devicetree/bindings/input/tca8418_keypad.txt
index 2a1538f..2551850 100644
--- a/Documentation/devicetree/bindings/input/tca8418_keypad.txt
+++ b/Documentation/devicetree/bindings/input/tca8418_keypad.txt
@@ -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.
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] input: Extend matrix-keypad device tree binding
  2013-01-11  1:41 [PATCH v2] input: Extend matrix-keypad device tree binding Simon Glass
@ 2013-01-11 17:09 ` Stephen Warren
  2013-01-11 17:13   ` Dmitry Torokhov
  2013-02-08 12:59   ` Grant Likely
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Warren @ 2013-01-11 17:09 UTC (permalink / raw)
  To: Simon Glass
  Cc: LKML, Roland Stigge, Vincent Palatin, linux-doc, Dmitry Torokhov,
	Wolfram Sang, Felipe Balbi, Luigi Semenzato, Rob Herring,
	linux-input, Stephen Warren, Sourav Poddar, Alban Bedel,
	devicetree-discuss, Laxman Dewangan

On 01/10/2013 06:41 PM, Simon Glass wrote:
> 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.

Reviewed-by: Stephen Warren <swarren@nvidia.com>

Note that the Tegra bindings are based on matrix-keypad.txt, and
recently added the following properties:

> - nvidia,kbc-row-pins: The KBC pins which are configured as row. This is an
>   array of pin numbers which is used as rows.
> - nvidia,kbc-col-pins: The KBC pins which are configured as column. This is an
>   array of pin numbers which is used as column.

Those both define the number of rows/columns (indirectly via the
property lengths) *and* define which pins are used for the rows/columns.
How will this influence/interact-with any changes you're planning to the
core matrix keymap parsing code; would Tegra require your "new"
keypad,num-rows/keypad,num-columns properties even though the
information is redundant, or will the Tegra driver have some way of
passing this information to the core?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] input: Extend matrix-keypad device tree binding
  2013-01-11 17:09 ` Stephen Warren
@ 2013-01-11 17:13   ` Dmitry Torokhov
  2013-02-08 12:59   ` Grant Likely
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2013-01-11 17:13 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Simon Glass, LKML, Roland Stigge, Vincent Palatin, linux-doc,
	Wolfram Sang, Felipe Balbi, Luigi Semenzato, Rob Herring,
	linux-input, Stephen Warren, Sourav Poddar, Alban Bedel,
	devicetree-discuss, Laxman Dewangan

On Fri, Jan 11, 2013 at 10:09:19AM -0700, Stephen Warren wrote:
> On 01/10/2013 06:41 PM, Simon Glass wrote:
> > 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.
> 
> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> 
> Note that the Tegra bindings are based on matrix-keypad.txt, and
> recently added the following properties:
> 
> > - nvidia,kbc-row-pins: The KBC pins which are configured as row. This is an
> >   array of pin numbers which is used as rows.
> > - nvidia,kbc-col-pins: The KBC pins which are configured as column. This is an
> >   array of pin numbers which is used as column.
> 
> Those both define the number of rows/columns (indirectly via the
> property lengths) *and* define which pins are used for the rows/columns.
> How will this influence/interact-with any changes you're planning to the
> core matrix keymap parsing code; would Tegra require your "new"
> keypad,num-rows/keypad,num-columns properties even though the
> information is redundant, or will the Tegra driver have some way of
> passing this information to the core?

Even if we decide to move lookup of keypad,num-rows/keypad,num-columns
into matrix-keypad code we will still allow callers to override DT data,
like we do with platform keymaps.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] input: Extend matrix-keypad device tree binding
  2013-01-11 17:09 ` Stephen Warren
  2013-01-11 17:13   ` Dmitry Torokhov
@ 2013-02-08 12:59   ` Grant Likely
  1 sibling, 0 replies; 4+ messages in thread
From: Grant Likely @ 2013-02-08 12:59 UTC (permalink / raw)
  To: Stephen Warren, Simon Glass
  Cc: Roland Stigge, Vincent Palatin, linux-doc, devicetree-discuss,
	Dmitry Torokhov, LKML, Felipe Balbi, Wolfram Sang,
	Luigi Semenzato, Laxman Dewangan, Rob Herring, linux-input,
	Stephen Warren, Sourav Poddar, Alban Bedel

On Fri, 11 Jan 2013 10:09:19 -0700, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 01/10/2013 06:41 PM, Simon Glass wrote:
> > 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.
> 
> Reviewed-by: Stephen Warren <swarren@nvidia.com>

Applied, thanks.

g.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-08 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11  1:41 [PATCH v2] input: Extend matrix-keypad device tree binding Simon Glass
2013-01-11 17:09 ` Stephen Warren
2013-01-11 17:13   ` Dmitry Torokhov
2013-02-08 12:59   ` Grant Likely

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.