Re: [PATCH v5 2/2] input: samsung-keypad: Add device tree support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I came across this searching for other proposed device tree bindings
based on what I wanted to do for Tegra.

Comments below.

On Mon, Oct 10, 2011 at 9:29 AM, Thomas Abraham
<thomas.abraham@xxxxxxxxxx> wrote:

> +- Keys represented as child nodes: Each key connected to the keypad
> +  controller is represented as a child node to the keypad controller
> +  device node and should include the following properties.
> +  - keypad,row: the row number to which the key is connected.
> +  - keypad,column: the column number to which the key is connected.
> +  - linux,code: the key-code to be reported when the key is pressed
> +    and released.

[...]
> +               key_1 {
> +                       keypad,row = <0>;
> +                       keypad,column = <3>;
> +                       linux,code = <2>;
> +               };
> +
> +               key_2 {
> +                       keypad,row = <0>;
> +                       keypad,column = <4>;
> +                       linux,code = <3>;
> +               };
> +
> +               key_3 {
> +                       keypad,row = <0>;
> +                       keypad,column = <5>;
> +                       linux,code = <4>;
> +               };


The above is good if all you want to specify is a few keys. If you
want a full keyboard specification, it gets very verbose.

I would prefer a simpler binding, something along the lines of:

linux,keymap = < row col code ... >;

Where it's just an array of the above, so your example would be:
linux,keymap = < 0 3 2
                 0 4 3
                 0 5 4 >;

Same amount of data, it would be more or less as easy to read but a
_much_ more compact representation when you need to provide 100+ keys.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux