aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian.fainelli@telecomint.eu>2008-01-07 13:00:46 -0500
committerRalf Baechle <ralf@linux-mips.org>2008-01-29 05:15:01 -0500
commitf6ed10ab972b00cd57567a2ac9e393226840e458 (patch)
tree8194f402b18781f9371782c6b93e74fb112ab3ab /arch
parent2d47c58efadd33b8399f3f440b7e9cf93692f262 (diff)
[MIPS] MTX-1: Add GPIO system button
This patch adds support for the GPIO connected system button on the MTX-1 boards. Default configuration is updated accordingly. Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/au1000/mtx-1/platform.c27
-rw-r--r--arch/mips/configs/mtx1_defconfig1
2 files changed, 27 insertions, 1 deletions
diff --git a/arch/mips/au1000/mtx-1/platform.c b/arch/mips/au1000/mtx-1/platform.c
index 49c0fb409fea..ce8637b3afa9 100644
--- a/arch/mips/au1000/mtx-1/platform.c
+++ b/arch/mips/au1000/mtx-1/platform.c
@@ -22,9 +22,32 @@
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/leds.h> 24#include <linux/leds.h>
25#include <linux/gpio_keys.h>
26#include <linux/input.h>
25 27
26#include <asm/gpio.h> 28#include <asm/gpio.h>
27 29
30static struct gpio_keys_button mtx1_gpio_button[] = {
31 {
32 .gpio = 207,
33 .code = BTN_0,
34 .desc = "System button",
35 }
36};
37
38static struct gpio_keys_platform_data mtx1_buttons_data = {
39 .buttons = mtx1_gpio_button,
40 .nbuttons = ARRAY_SIZE(mtx1_gpio_button),
41};
42
43static struct platform_device mtx1_button = {
44 .name = "gpio-keys",
45 .id = -1,
46 .dev = {
47 .platform_data = &mtx1_buttons_data,
48 }
49};
50
28static struct resource mtx1_wdt_res[] = { 51static struct resource mtx1_wdt_res[] = {
29 [0] = { 52 [0] = {
30 .start = 15, 53 .start = 15,
@@ -66,11 +89,13 @@ static struct platform_device mtx1_gpio_leds = {
66 89
67static struct __initdata platform_device * mtx1_devs[] = { 90static struct __initdata platform_device * mtx1_devs[] = {
68 &mtx1_gpio_leds, 91 &mtx1_gpio_leds,
69 &mtx1_wdt 92 &mtx1_wdt,
93 &mtx1_button
70}; 94};
71 95
72static int __init mtx1_register_devices(void) 96static int __init mtx1_register_devices(void)
73{ 97{
98 gpio_direction_input(207);
74 return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs)); 99 return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
75} 100}
76 101
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index be82f123324d..3a34208600d1 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -1616,6 +1616,7 @@ CONFIG_INPUT_EVBUG=m
1616# 1616#
1617CONFIG_INPUT_KEYBOARD=y 1617CONFIG_INPUT_KEYBOARD=y
1618CONFIG_KEYBOARD_ATKBD=y 1618CONFIG_KEYBOARD_ATKBD=y
1619CONFIG_KEYBOARD_GPIO=y
1619CONFIG_KEYBOARD_SUNKBD=m 1620CONFIG_KEYBOARD_SUNKBD=m
1620CONFIG_KEYBOARD_LKKBD=m 1621CONFIG_KEYBOARD_LKKBD=m
1621CONFIG_KEYBOARD_XTKBD=m 1622CONFIG_KEYBOARD_XTKBD=m