diff options
author | Marc Dietrich <marvin24@gmx.de> | 2011-11-01 06:37:03 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-12-08 00:13:47 -0500 |
commit | c1c374d58c5678fd2364c767f4281342e5362b29 (patch) | |
tree | af411e7b26460b7813c2ed6a5227c4a6312eeac7 /arch/arm/mach-tegra | |
parent | 5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff) |
ARM: tegra: paz00: add support for wakeup gpio key
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>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/board-paz00.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-paz00.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c index 55c55ba89f1e..799e4201ecf3 100644 --- a/arch/arm/mach-tegra/board-paz00.c +++ b/arch/arm/mach-tegra/board-paz00.c | |||
@@ -23,8 +23,10 @@ | |||
23 | #include <linux/serial_8250.h> | 23 | #include <linux/serial_8250.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
26 | #include <linux/gpio_keys.h> | ||
26 | #include <linux/pda_power.h> | 27 | #include <linux/pda_power.h> |
27 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/input.h> | ||
28 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
29 | #include <linux/gpio.h> | 31 | #include <linux/gpio.h> |
30 | #include <linux/rfkill-gpio.h> | 32 | #include <linux/rfkill-gpio.h> |
@@ -114,12 +116,37 @@ static struct platform_device leds_gpio = { | |||
114 | }, | 116 | }, |
115 | }; | 117 | }; |
116 | 118 | ||
119 | static struct gpio_keys_button paz00_gpio_keys_buttons[] = { | ||
120 | { | ||
121 | .code = KEY_POWER, | ||
122 | .gpio = TEGRA_GPIO_POWERKEY, | ||
123 | .active_low = 1, | ||
124 | .desc = "Power", | ||
125 | .type = EV_KEY, | ||
126 | .wakeup = 1, | ||
127 | }, | ||
128 | }; | ||
129 | |||
130 | static struct gpio_keys_platform_data paz00_gpio_keys = { | ||
131 | .buttons = paz00_gpio_keys_buttons, | ||
132 | .nbuttons = ARRAY_SIZE(paz00_gpio_keys_buttons), | ||
133 | }; | ||
134 | |||
135 | static struct platform_device gpio_keys_device = { | ||
136 | .name = "gpio-keys", | ||
137 | .id = -1, | ||
138 | .dev = { | ||
139 | .platform_data = &paz00_gpio_keys, | ||
140 | }, | ||
141 | }; | ||
142 | |||
117 | static struct platform_device *paz00_devices[] __initdata = { | 143 | static struct platform_device *paz00_devices[] __initdata = { |
118 | &debug_uart, | 144 | &debug_uart, |
119 | &tegra_sdhci_device4, | 145 | &tegra_sdhci_device4, |
120 | &tegra_sdhci_device1, | 146 | &tegra_sdhci_device1, |
121 | &wifi_rfkill_device, | 147 | &wifi_rfkill_device, |
122 | &leds_gpio, | 148 | &leds_gpio, |
149 | &gpio_keys_device, | ||
123 | }; | 150 | }; |
124 | 151 | ||
125 | static void paz00_i2c_init(void) | 152 | static void paz00_i2c_init(void) |
diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h index 8aff06eb58c3..ffa83f580db6 100644 --- a/arch/arm/mach-tegra/board-paz00.h +++ b/arch/arm/mach-tegra/board-paz00.h | |||
@@ -32,6 +32,9 @@ | |||
32 | #define TEGRA_WIFI_RST TEGRA_GPIO_PD1 | 32 | #define TEGRA_WIFI_RST TEGRA_GPIO_PD1 |
33 | #define TEGRA_WIFI_LED TEGRA_GPIO_PD0 | 33 | #define TEGRA_WIFI_LED TEGRA_GPIO_PD0 |
34 | 34 | ||
35 | /* WakeUp */ | ||
36 | #define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PJ7 | ||
37 | |||
35 | void paz00_pinmux_init(void); | 38 | void paz00_pinmux_init(void); |
36 | 39 | ||
37 | #endif | 40 | #endif |