From bbca5c6d9e7d0b0cdecd70766b7f4698462a53e0 Mon Sep 17 00:00:00 2001 From: Steven Miao Date: Thu, 7 Jun 2012 15:06:45 +0800 Subject: gpiokeys: add gpio keyboard platform device Signed-off-by: Steven Miao Signed-off-by: Bob Liu --- arch/blackfin/mach-bf609/boards/ezkit.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'arch/blackfin') diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c index b078d5a4d82e..14b73b55a48e 100644 --- a/arch/blackfin/mach-bf609/boards/ezkit.c +++ b/arch/blackfin/mach-bf609/boards/ezkit.c @@ -1098,6 +1098,28 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = { }; #endif +#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) +#include +#include + +static struct gpio_keys_button bfin_gpio_keys_table[] = { + {BTN_0, GPIO_PB10, 1, "gpio-keys: BTN0"}, + {BTN_1, GPIO_PE1, 1, "gpio-keys: BTN1"}, +}; + +static struct gpio_keys_platform_data bfin_gpio_keys_data = { + .buttons = bfin_gpio_keys_table, + .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), +}; + +static struct platform_device bfin_device_gpiokeys = { + .name = "gpio-keys", + .dev = { + .platform_data = &bfin_gpio_keys_data, + }, +}; +#endif + static struct spi_board_info bfin_spi_board_info[] __initdata = { #if defined(CONFIG_MTD_M25P80) \ || defined(CONFIG_MTD_M25P80_MODULE) -- cgit v1.2.3