devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rakesh Iyer <riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2] Input: keyboard - add device tree bindings for simple key matrixes
Date: Thu, 29 Dec 2011 13:33:10 -0800	[thread overview]
Message-ID: <CAOesGMh6dzy64H8Ex4u72uQt9NvnzVHuWxE5AwWL2ubxPm=zaw@mail.gmail.com> (raw)
In-Reply-To: <4EFCD846.40901-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Thu, Dec 29, 2011 at 1:14 PM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 12/29/2011 12:42 PM, Olof Johansson wrote:
>> This adds a simple device tree binding for simple key matrix data.
>>
>> Changes since v1:
>>  * Removed samsung-style binding support
>>  * Added linux,fn-keymap and linux,fn-key optional properties
>>
>> Signed-off-by: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
>> ---
>>  .../devicetree/bindings/input/matrix-keymap.txt    |   25 ++++++
>>  drivers/input/keyboard/Makefile                    |    1 +
>>  drivers/input/keyboard/keymap.c                    |   78 ++++++++++++++++++++
>>  include/linux/input/matrix_keypad.h                |   34 +++++----
>>  4 files changed, 123 insertions(+), 15 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/input/matrix-keymap.txt
>>  create mode 100644 drivers/input/keyboard/keymap.c
>>
>> diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.txt b/Documentation/devicetree/bindings/input/matrix-keymap.txt
>> new file mode 100644
>> index 0000000..480ca46
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/input/matrix-keymap.txt
>> @@ -0,0 +1,25 @@
>> +For matrix keyboards there are two kinds of layout bindings using
>> +linux key codes.
>
> Need to update this.

Oops, yes.

>> +
>> +Required properties:
>> +- compatible: "matrix-keyboard-controller"
>> +- linux,keymap: an array of 3-cell entries containing the equivalent
>> +  of the three separate properties above: row, column and linux
>> +  key-code.
>> +
>
> How about just embedding the row/column information as the array
> position in the keymap? Then you only need 1 cell per key. Sparsely
> populated matrices are probably the exception. If more than 1/3 of the
> keys are present, you come out ahead in terms of data usage. You would
> need to specify the number of rows and columns, but that is probably
> easier than determining the max from the keymap.

Actually, in the case of the default layout for tegra-kbc, there are
109 keys defined in a 8*31 (248) matrix, and linux,fn-keymap is going
to be much sparser than that.

Instead, how about packing the row, column and index into one cell as
8, 8, 16 bits? That would be a win for both sparse and dense maps.

Number of rows and columns for the keyboard could be provided as
properties (num-rows, num-columns), it's something I've gone back and
forth in whether it should be in the generic binding or something that
is specific per keyboard vendor -- some of them are hardcoded so
providing properties might not add value.


-Olof

  parent reply	other threads:[~2011-12-29 21:33 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28 22:52 [PATCH] Input: keyboard - add device tree bindings for simple key matrixes Olof Johansson
     [not found] ` <1325112771-31941-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
2011-12-28 23:30   ` Rob Herring
     [not found]     ` <4EFBA698.6080601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-12-28 23:37       ` Olof Johansson
2011-12-29  6:16   ` Stephen Warren
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF17755DC8D2-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-12-29  6:34       ` Olof Johansson
     [not found]         ` <CAOesGMiNuW3mexN_8PtunZkaVX4Uph-OgZFr5zLhaB1nih_EEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-29  7:01           ` Stephen Warren
2011-12-29  7:06             ` Olof Johansson
2012-01-02  4:11               ` Thomas Abraham
     [not found]               ` <CAOesGMjZoP+FsGWo9cWKvgs8KD9tT6KBHbK5qKX8NTGOY3HUjQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-29 19:28                 ` Rob Herring
2012-01-02  7:21                 ` Grant Likely
     [not found]                   ` <20120102072121.GB13015-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-03 17:44                     ` Olof Johansson
2011-12-29 18:42   ` [PATCH v2] " Olof Johansson
2011-12-29 21:14     ` Rob Herring
     [not found]       ` <4EFCD846.40901-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-12-29 21:33         ` Olof Johansson [this message]
2011-12-29 22:05     ` Dmitry Torokhov
     [not found]       ` <20111229220515.GA17621-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2011-12-29 22:26         ` Olof Johansson
     [not found]     ` <1325184146-3527-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
2012-01-02  6:09       ` [PATCH v3] " Olof Johansson
2012-01-03 17:46         ` Stephen Warren
2012-01-03 21:37         ` [PATCH v4] " Olof Johansson
     [not found]           ` <1325626648-9425-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
2012-01-03 22:37             ` Stephen Warren
2012-01-08  1:05               ` Simon Glass
     [not found]                 ` <CAPnjgZ3G7yFOrngJP=KtJNcgAWtZg3xn22tRMMi+pUnZ2rJpBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-09 18:38                   ` Olof Johansson
     [not found]                     ` <CAOesGMitmYb2jb1VvjNfU8jcsCrDJ5zQkm+Hh171ddMi4POUYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-09 18:46                       ` Simon Glass
2012-03-14  4:42               ` Dmitry Torokhov
     [not found]         ` <1325484557-27695-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
2012-01-02 18:39           ` [PATCH v3] " Simon Glass
2012-01-03 15:43             ` Olof Johansson
     [not found]               ` <20120103154317.GA27061-O5ziIzlqnXUVNXGz7ipsyg@public.gmane.org>
2012-01-03 16:22                 ` Simon Glass
     [not found]                   ` <CAPnjgZ3xN8+Ve28bcg1OQ4mv5rWvA-9ijP57UsuMQ5D1d=7Xxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-03 16:29                     ` Russell King - ARM Linux
2012-01-03 16:44                       ` Dmitry Torokhov
     [not found]                         ` <20120103164431.GA31647-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-01-03 16:48                           ` Olof Johansson
2012-01-03 17:06                           ` Russell King - ARM Linux
     [not found]                             ` <20120103170615.GZ2914-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-01-03 17:57                               ` Dmitry Torokhov
2012-01-03 22:28           ` [PATCH] Input: tegra-kbc - add device tree support Olof Johansson
     [not found]             ` <1325629702-10307-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
2012-01-03 22:42               ` Stephen Warren
     [not found]                 ` <74CDBE0F657A3D45AFBB94109FB122FF17761F1203-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-01-03 22:58                   ` Olof Johansson
     [not found]                     ` <CAOesGMhYscMgsNbZ+W0vdcRFmMiV3yQYLRxgGLfMVHKuhEAe-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-03 23:21                       ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOesGMh6dzy64H8Ex4u72uQt9NvnzVHuWxE5AwWL2ubxPm=zaw@mail.gmail.com' \
    --to=olof-nzht3qvonbneowh0uzbu5w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).