aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2008-01-11 10:59:56 +0000
committerFlorian Fainelli <florian@openwrt.org>2008-01-11 10:59:56 +0000
commit12909cef8d6772655584309c940f5305cd5c168c (patch)
tree413e221ce6cf55a4e6113438be707251c31f3e3e /target/linux
parent918e830718c2216a64d65f7ad58a784a841cd296 (diff)
downloadupstream-12909cef8d6772655584309c940f5305cd5c168c.tar.gz
upstream-12909cef8d6772655584309c940f5305cd5c168c.tar.bz2
upstream-12909cef8d6772655584309c940f5305cd5c168c.zip
Allow S1 button to be controlled using gpio-keys
SVN-Revision: 10172
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/rb532/files/arch/mips/rb500/devices.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/target/linux/rb532/files/arch/mips/rb500/devices.c b/target/linux/rb532/files/arch/mips/rb500/devices.c
index dec2be9b2b..f2a6f7d9fc 100644
--- a/target/linux/rb532/files/arch/mips/rb500/devices.c
+++ b/target/linux/rb532/files/arch/mips/rb500/devices.c
@@ -22,6 +22,8 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
#include <asm/bootinfo.h>
@@ -189,11 +191,34 @@ static struct platform_device rb500_led = {
.id = 0,
};
+static struct gpio_keys_button rb500_gpio_btn[] = {
+ {
+ .gpio = 1,
+ .code = BTN_0,
+ .desc = "S1",
+ .active_low = 1,
+ }
+};
+
+static struct gpio_keys_platform_data rb500_gpio_btn_data = {
+ .buttons = rb500_gpio_btn,
+ .nbuttons = ARRAY_SIZE(rb500_gpio_btn),
+};
+
+static struct platform_device rb500_button = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &rb500_gpio_btn_data,
+ }
+};
+
static struct platform_device *rb500_devs[] = {
&korina_dev0,
&nand_slot0,
&cf_slot0,
- &rb500_led
+ &rb500_led,
+ &rb500_button
};
static void __init parse_mac_addr(char *macstr)