Commit ca7efef2 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

omap3 beagle: input button

Export Beagle's "user" button through the input framework so it's
accessible using normal mechanisms.  This uses BTN_EXTRA for lack
of a more obvious choice.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 830588a7
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
...@@ -30,7 +34,6 @@ ...@@ -30,7 +34,6 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/flash.h> #include <asm/mach/flash.h>
#include <mach/gpio.h>
#include <mach/board.h> #include <mach/board.h>
#include <mach/usb-musb.h> #include <mach/usb-musb.h>
#include <mach/usb-ehci.h> #include <mach/usb-ehci.h>
...@@ -165,6 +168,28 @@ static struct platform_device leds_gpio = { ...@@ -165,6 +168,28 @@ static struct platform_device leds_gpio = {
}, },
}; };
static struct gpio_keys_button gpio_buttons[] = {
{
.code = BTN_EXTRA,
.gpio = 7,
.desc = "user",
.wakeup = 1,
},
};
static struct gpio_keys_platform_data gpio_key_info = {
.buttons = gpio_buttons,
.nbuttons = ARRAY_SIZE(gpio_buttons),
};
static struct platform_device keys_gpio = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &gpio_key_info,
},
};
static struct omap_board_config_kernel omap3_beagle_config[] __initdata = { static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
{ OMAP_TAG_UART, &omap3_beagle_uart_config }, { OMAP_TAG_UART, &omap3_beagle_uart_config },
{ OMAP_TAG_MMC, &omap3beagle_mmc_config }, { OMAP_TAG_MMC, &omap3beagle_mmc_config },
...@@ -177,6 +202,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = { ...@@ -177,6 +202,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = {
&omap3_beagle_twl4030rtc_device, &omap3_beagle_twl4030rtc_device,
#endif #endif
&leds_gpio, &leds_gpio,
&keys_gpio,
}; };
void __init omap3beagle_flash_init(void) void __init omap3beagle_flash_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment