Re: [PATCH v2 2/3] ARM: pxa168/teton bga: added keypad support

From: Eric Miao
Date: Tue Sep 14 2010 - 03:09:00 EST


On Mon, Sep 13, 2010 at 11:51 AM, Mark F. Brown <mark.brown314@xxxxxxxxx> wrote:
> Support for Matrix keypad ESC, ENTER, LEFT, and RIGHT
>
> Signed-off-by: Mark F. Brown <mark.brown314@xxxxxxxxx>

Applied.

> ---
> Âarch/arm/mach-mmp/teton_bga.c | Â 24 ++++++++++++++++++++++++
> Â1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c
> index 49b746b..2966117 100644
> --- a/arch/arm/mach-mmp/teton_bga.c
> +++ b/arch/arm/mach-mmp/teton_bga.c
> @@ -16,6 +16,8 @@
> Â#include <linux/kernel.h>
> Â#include <linux/platform_device.h>
> Â#include <linux/gpio.h>
> +#include <linux/input.h>
> +#include <plat/pxa27x_keypad.h>
>
> Â#include <asm/mach-types.h>
> Â#include <asm/mach/arch.h>
> @@ -30,6 +32,27 @@ static unsigned long teton_bga_pin_config[] __initdata = {
> Â Â Â Â/* UART1 */
> Â Â Â ÂGPIO107_UART1_TXD,
> Â Â Â ÂGPIO108_UART1_RXD,
> +
> + Â Â Â /* Keypad */
> + Â Â Â GPIO109_KP_MKIN1,
> + Â Â Â GPIO110_KP_MKIN0,
> + Â Â Â GPIO111_KP_MKOUT7,
> + Â Â Â GPIO112_KP_MKOUT6,
> +};
> +
> +static unsigned int teton_bga_matrix_key_map[] = {
> + Â Â Â KEY(0, 6, KEY_ESC),
> + Â Â Â KEY(0, 7, KEY_ENTER),
> + Â Â Â KEY(1, 6, KEY_LEFT),
> + Â Â Â KEY(1, 7, KEY_RIGHT),
> +};
> +
> +static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
> +    .matrix_key_rows    Â= 2,
> +    .matrix_key_cols    Â= 8,
> +    .matrix_key_map     = teton_bga_matrix_key_map,
> +    .matrix_key_map_size  Â= ARRAY_SIZE(teton_bga_matrix_key_map),
> +    .debounce_interval   Â= 30,
> Â};
>
> Âstatic void __init teton_bga_init(void)
> @@ -38,6 +61,7 @@ static void __init teton_bga_init(void)
>
> Â Â Â Â/* on-chip devices */
> Â Â Â Âpxa168_add_uart(1);
> + Â Â Â pxa168_add_keypad(&teton_bga_keypad_info);
> Â}
>
> ÂMACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
> --
> 1.7.0.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/