OSDN Git Service

Merge branch 'tegra/boards' into next/boards
[uclinux-h8/linux.git] / arch / arm / mach-tegra / board-paz00.c
index 0b7e1cf..e5480b4 100644 (file)
 #include <linux/serial_8250.h>
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
+#include <linux/gpio_keys.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
+#include <linux/input.h>
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/rfkill-gpio.h>
@@ -115,12 +117,37 @@ static struct platform_device leds_gpio = {
         },
 };
 
+static struct gpio_keys_button paz00_gpio_keys_buttons[] = {
+       {
+               .code           = KEY_POWER,
+               .gpio           = TEGRA_GPIO_POWERKEY,
+               .active_low     = 1,
+               .desc           = "Power",
+               .type           = EV_KEY,
+               .wakeup         = 1,
+       },
+};
+
+static struct gpio_keys_platform_data paz00_gpio_keys = {
+       .buttons        = paz00_gpio_keys_buttons,
+       .nbuttons       = ARRAY_SIZE(paz00_gpio_keys_buttons),
+};
+
+static struct platform_device gpio_keys_device = {
+       .name   = "gpio-keys",
+       .id     = -1,
+       .dev    = {
+               .platform_data = &paz00_gpio_keys,
+       },
+};
+
 static struct platform_device *paz00_devices[] __initdata = {
        &debug_uart,
        &tegra_sdhci_device4,
        &tegra_sdhci_device1,
        &wifi_rfkill_device,
        &leds_gpio,
+       &gpio_keys_device,
 };
 
 static void paz00_i2c_init(void)