diff options
author | Florian Fainelli <florian@openwrt.org> | 2008-01-11 15:19:13 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2008-01-11 15:19:13 +0000 |
commit | ff2afa0c9c69cc4c39c2e40dfb0e4ff2336dde6e (patch) | |
tree | 50eb0d2b55eb5233a18a9d364c6a6961cd1afa97 /target | |
parent | 7cd6f7edd6057f04d41dd9a8039792a829fa9b8a (diff) | |
download | upstream-ff2afa0c9c69cc4c39c2e40dfb0e4ff2336dde6e.tar.gz upstream-ff2afa0c9c69cc4c39c2e40dfb0e4ff2336dde6e.tar.bz2 upstream-ff2afa0c9c69cc4c39c2e40dfb0e4ff2336dde6e.zip |
Add support for the gpio connected reset button
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10173 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/rdc/files/arch/i386/mach-rdc/platform.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/target/linux/rdc/files/arch/i386/mach-rdc/platform.c b/target/linux/rdc/files/arch/i386/mach-rdc/platform.c index 0a607223c5..31af6fcc30 100644 --- a/target/linux/rdc/files/arch/i386/mach-rdc/platform.c +++ b/target/linux/rdc/files/arch/i386/mach-rdc/platform.c @@ -30,6 +30,8 @@ #include <linux/platform_device.h> #include <linux/version.h> #include <linux/leds.h> +#include <linux/gpio_keys.h> +#include <linux/input.h> #include <asm/gpio.h> @@ -74,10 +76,34 @@ static struct platform_device rdc321x_wdt = { .num_resources = 0, }; +/* Button */ +static struct gpio_keys_button rdc321x_gpio_btn[] = { + { + .gpio = 0, + .code = BTN_0, + .desc = "Reset", + .active_low = 1, + } +}; + +static struct gpio_keys_platform_data rdc321x_gpio_btn_data = { + .buttons = rdc321x_gpio_btn, + .nbuttons = ARRAY_SIZE(rdc321x_gpio_btn), +}; + +static struct platform_device rdc321x_button = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &rdc321x_gpio_btn_data, + } +}; + static struct platform_device *rdc321x_devs[] = { &rdc_flash_device, &rdc321x_leds, - &rdc321x_wdt + &rdc321x_wdt, + &rdc321x_button }; static int __init rdc_board_setup(void) |