2 * Edimax BR-6425 board support
4 * Copyright (C) 2012 OpenWrt.org
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/spi/spi.h>
14 #include <linux/spi/flash.h>
16 #include <asm/mach-ralink/machine.h>
17 #include <asm/mach-ralink/dev-gpio-buttons.h>
18 #include <asm/mach-ralink/dev-gpio-leds.h>
19 #include <asm/mach-ralink/rt305x.h>
20 #include <asm/mach-ralink/rt305x_regs.h>
24 #define BR6425_GPIO_LED_POWER 9
25 #define BR6425_GPIO_BUTTON_RESET 12
26 #define BR6425_GPIO_SWITCH_RFKILL 13
27 #define BR6425_GPIO_LED_WLAN 14
28 #define BR6425_KEYS_POLL_INTERVAL 20
29 #define BR6425_KEYS_DEBOUNCE_INTERVAL (3 * BR6425_KEYS_POLL_INTERVAL)
31 static struct gpio_keys_button br6425_gpio_buttons[] __initdata = {
36 .debounce_interval = BR6425_KEYS_DEBOUNCE_INTERVAL,
37 .gpio = BR6425_GPIO_BUTTON_RESET,
41 .desc = "RFKILL switch",
44 .debounce_interval = BR6425_KEYS_DEBOUNCE_INTERVAL,
45 .gpio = BR6425_GPIO_SWITCH_RFKILL,
50 static struct gpio_led br6425_leds_gpio[] __initdata = {
52 .name = "edimax:green:power",
53 .gpio = BR6425_GPIO_LED_POWER,
56 .name = "edimax:orange:wlan",
57 .gpio = BR6425_GPIO_LED_WLAN,
62 static void __init br6425_init(void)
64 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
65 rt305x_register_flash(0);
66 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
67 rt305x_register_ethernet();
68 ramips_register_gpio_leds(-1, ARRAY_SIZE(br6425_leds_gpio),
70 ramips_register_gpio_buttons(-1, BR6425_KEYS_POLL_INTERVAL,
71 ARRAY_SIZE(br6425_gpio_buttons),
73 rt305x_register_wifi();
74 rt305x_register_wdt();
77 MIPS_MACHINE(RAMIPS_MACH_BR6425, "BR-6425", "Edimax BR-6425",