RE: [patch/rfc 2.6.28-rc2] input: twl4030_keypad driver

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

 



On Wednesday, January 21, 2009 5:13 PM, David Brownell wrote:
> Driver for the twl4030 family keypad controller.  This controller
> supports a key matrix of up to 8 rows by 8 columns.  Board init
> code passes a description of the key matrix to the driver.
>
> Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
> ---

[SNIP]

> --- a/include/linux/i2c/twl4030.h
> +++ b/include/linux/i2c/twl4030.h
> @@ -255,11 +255,18 @@ struct twl4030_madc_platform_data {
>  	int		irq_line;
>  };
>  
> +/* Boards have uniqe mappings of {col, row} --> keycode.
> + * Column and row are 4 bits, but range only from 0..7;
> + * a PERSISTENT_KEY is "always on" and never reported.
> + */
> +#define KEY_PERSISTENT		0x00800000
> +#define KEY(col, row, keycode)	(((col) << 28) | ((row) << 24) |
(keycode))

The same KEY macro is defined in:

arch/arm/mach-pxa/include/mach/pxa27x_keypad.h
arch/arm/plat-omap/include/mach/keypad.h

I also have a keypad driver for the ep93xx that uses the same macro.

Shouldn't/couldn't this be generalized and added to the
include/linux/input.h file?  Allowing 4-bits for row/col gives a maximum
key matrix of 16x16 keys which should be enough for just about anything.

Regards,
Hartley

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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux