Skip to content

Commit

Permalink
ARM: tegra: paz00: add support for wakeup gpio key
Browse files Browse the repository at this point in the history
This adds support for a wakeup gpio which is connected to the
embedded controller. This will be used later on for wakeup from suspend.

Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Marc Dietrich authored and Olof Johansson committed Dec 8, 2011
1 parent 5611cc4 commit c1c374d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions arch/arm/mach-tegra/board-paz00.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#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>
Expand Down Expand Up @@ -114,12 +116,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)
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-tegra/board-paz00.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#define TEGRA_WIFI_RST TEGRA_GPIO_PD1
#define TEGRA_WIFI_LED TEGRA_GPIO_PD0

/* WakeUp */
#define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PJ7

void paz00_pinmux_init(void);

#endif

0 comments on commit c1c374d

Please sign in to comment.