1 --- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
2 +++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
4 #include <linux/mtd/physmap.h>
5 #include <linux/mv643xx_eth.h>
6 #include <linux/ethtool.h>
7 +#include <linux/leds.h>
8 +#include <linux/gpio_keys.h>
9 +#include <linux/input.h>
11 #include <asm/mach-types.h>
18 + * LEDs attached to GPIO
20 +static struct gpio_led wrt350n_v2_led_pins[] = {
22 + .name = "wrt350nv2:green:power",
26 + .name = "wrt350nv2:green:security",
30 + .name = "wrt350nv2:orange:power",
34 + .name = "wrt350nv2:green:usb",
38 + .name = "wrt350nv2:green:wireless",
44 +static struct gpio_led_platform_data wrt350n_v2_led_data = {
45 + .leds = wrt350n_v2_led_pins,
46 + .num_leds = ARRAY_SIZE(wrt350n_v2_led_pins),
49 +static struct platform_device wrt350n_v2_leds = {
50 + .name = "leds-gpio",
53 + .platform_data = &wrt350n_v2_led_data,
58 + * Buttons attached to GPIO
60 +static struct gpio_keys_button wrt350n_v2_buttons[] = {
62 + .code = KEY_RESTART,
64 + .desc = "Reset Button",
69 + .desc = "WPS Button",
74 +static struct gpio_keys_platform_data wrt350n_v2_button_data = {
75 + .buttons = wrt350n_v2_buttons,
76 + .nbuttons = ARRAY_SIZE(wrt350n_v2_buttons),
79 +static struct platform_device wrt350n_v2_button_device = {
80 + .name = "gpio-keys",
84 + .platform_data = &wrt350n_v2_button_data,
91 static struct orion5x_mpp_mode wrt350n_v2_mpp_modes[] __initdata = {
92 { 0, MPP_GPIO }, /* Power LED green (0=on) */
93 { 1, MPP_GPIO }, /* Security LED (0=on) */
94 @@ -140,6 +217,8 @@ static void __init wrt350n_v2_init(void)
95 orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE,
96 WRT350N_V2_NOR_BOOT_SIZE);
97 platform_device_register(&wrt350n_v2_nor_flash);
98 + platform_device_register(&wrt350n_v2_button_device);
99 + platform_device_register(&wrt350n_v2_leds);
102 static int __init wrt350n_v2_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)