aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-03-17 18:34:11 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-03-17 18:34:11 +0000
commit2da690b21bae9065256c8747f1801308bce5ab69 (patch)
tree3bbbb9f2284af534d03229b0a1b2ac2a1803e9b9
parentd6b05d346d8ef62b46e399f90b095b0899d68a90 (diff)
downloadmaster-187ad058-2da690b21bae9065256c8747f1801308bce5ab69.tar.gz
master-187ad058-2da690b21bae9065256c8747f1801308bce5ab69.tar.bz2
master-187ad058-2da690b21bae9065256c8747f1801308bce5ab69.zip
[ar71xx] ap81: register GPIO buttons
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14923 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c
index c35bac376f..5a48dffa4d 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c
@@ -9,11 +9,36 @@
* by the Free Software Foundation.
*/
+#include <linux/input.h>
+
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
+#define AP81_GPIO_BTN_SW4 12
+#define AP81_GPIO_BTN_SW1 21
+
+#define AP81_BUTTONS_POLL_INTERVAL 20
+
+static struct gpio_button ap81_gpio_buttons[] __initdata = {
+ {
+ .desc = "sw1",
+ .type = EV_KEY,
+ .code = BTN_0,
+ .threshold = 5,
+ .gpio = AP81_GPIO_BTN_SW1,
+ .active_low = 1,
+ } , {
+ .desc = "sw4",
+ .type = EV_KEY,
+ .code = BTN_1,
+ .threshold = 5,
+ .gpio = AP81_GPIO_BTN_SW4,
+ .active_low = 1,
+ }
+};
+
static void __init ap81_setup(void)
{
ar71xx_add_device_mdio(0x0);
@@ -32,6 +57,10 @@ static void __init ap81_setup(void)
ar71xx_add_device_usb();
+ ar71xx_add_device_gpio_buttons(-1, AP81_BUTTONS_POLL_INTERVAL,
+ ARRAY_SIZE(ap81_gpio_buttons),
+ ap81_gpio_buttons);
+
ar91xx_add_device_wmac();
}