X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/1d54109dcb1a8104b4018992b52901bbb5e8e993..adde7768a2eab2950a7628319ec832c63a00ff03:/target/linux/rdc/files/arch/i386/mach-rdc/platform.c 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 877287b85..31af6fcc3 100644 --- a/target/linux/rdc/files/arch/i386/mach-rdc/platform.c +++ b/target/linux/rdc/files/arch/i386/mach-rdc/platform.c @@ -29,14 +29,12 @@ #include #include #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) #include -#endif +#include +#include #include -#define PFX "rdc321x: " - /* Flash */ static struct resource rdc_flash_resource[] = { [0] = { @@ -54,9 +52,8 @@ static struct platform_device rdc_flash_device = { }; /* LEDS */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) static struct gpio_led default_leds[] = { - { .name = "rdc:dmz", .gpio = 1, }, + { .name = "rdc321x:dmz", .gpio = 1, }, }; static struct gpio_led_platform_data rdc321x_led_data = { @@ -71,13 +68,6 @@ static struct platform_device rdc321x_leds = { .platform_data = &rdc321x_led_data, } }; -#else -static struct platform_device rdc321x_leds = { - .name = "rdc321x-leds", - .id = -1, - .num_resources = 0, -}; -#endif /* Watchdog */ static struct platform_device rdc321x_wdt = { @@ -86,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)