From: Juha Yrjola Date: Fri, 10 Feb 2006 13:34:53 +0000 (+0200) Subject: ARM: OMAP: Add keypad data to board-nokia770.c X-Git-Tag: v2.6.16-omap1~76 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3eaaea9cab36989d76f372c79de54e952689e65a;p=linux-2.6-omap-h63xx.git ARM: OMAP: Add keypad data to board-nokia770.c Signed-off-by: Juha Yrjölä --- diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index f56c89120b4..5ad8c3fa084 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include static void __init omap_nokia770_init_irq(void) @@ -30,6 +32,45 @@ static void __init omap_nokia770_init_irq(void) omap_init_irq(); } +static int nokia770_keymap[] = { + KEY(0, 1, KEY_UP), + KEY(0, 2, KEY_F5), + KEY(1, 0, KEY_LEFT), + KEY(1, 1, KEY_ENTER), + KEY(1, 2, KEY_RIGHT), + KEY(2, 0, KEY_ESC), + KEY(2, 1, KEY_DOWN), + KEY(2, 2, KEY_F4), + KEY(3, 0, KEY_F7), + KEY(3, 1, KEY_F8), + KEY(3, 2, KEY_F6), + 0 +}; + +static struct resource nokia770_kp_resources[] = { + [0] = { + .start = INT_KEYBOARD, + .end = INT_KEYBOARD, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct omap_kp_platform_data nokia770_kp_data = { + .rows = 8, + .cols = 8, + .keymap = nokia770_keymap +}; + +static struct platform_device nokia770_kp_device = { + .name = "omap-keypad", + .id = -1, + .dev = { + .platform_data = &nokia770_kp_data, + }, + .num_resources = ARRAY_SIZE(nokia770_kp_resources), + .resource = nokia770_kp_resources, +}; + static struct spi_board_info nokia770_spi_board_info[] __initdata = { [0] = { .modalias = "lcd_lph8923", @@ -40,6 +81,7 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = { }; static struct platform_device *nokia770_devices[] __initdata = { + &nokia770_kp_device, }; /* assume no Mini-AB port */