2 * Petatel PSR-680W Wireless 3G Router support
4 * Copyright (C) 2012 Dmitry Shmygov <shmygov@rambler.ru>
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>
14 #include <asm/mach-ralink/machine.h>
15 #include <asm/mach-ralink/dev-gpio-buttons.h>
16 #include <asm/mach-ralink/dev-gpio-leds.h>
17 #include <asm/mach-ralink/rt305x.h>
18 #include <asm/mach-ralink/rt305x_regs.h>
22 #define PSR_680W_GPIO_BUTTON_RESET 0 /* active low */
24 #define PSR_680W_GPIO_LED_STATUS 19
26 #define PSR_680W_KEYS_POLL_INTERVAL 20
27 #define PSR_680W_KEYS_DEBOUNCE_INTERVAL (3 * PSR_680W_KEYS_POLL_INTERVAL)
30 static struct gpio_led psr_680w_leds_gpio
[] __initdata
= {
32 .name
= "psr-680w:red:wan",
33 .gpio
= PSR_680W_GPIO_LED_STATUS
,
38 static struct gpio_keys_button psr_680w_gpio_buttons
[] __initdata
= {
43 .debounce_interval
= PSR_680W_KEYS_DEBOUNCE_INTERVAL
,
44 .gpio
= PSR_680W_GPIO_BUTTON_RESET
,
49 static void __init
psr_680w_init(void)
51 rt305x_gpio_init((RT305X_GPIO_MODE_I2S_UARTF
<< RT305X_GPIO_MODE_UART0_SHIFT
) |
52 RT305X_GPIO_MODE_SPI
|
53 RT305X_GPIO_MODE_JTAG
|
54 RT305X_GPIO_MODE_MDIO
|
55 RT305X_GPIO_MODE_RGMII
);
57 rt305x_register_flash(0);
59 rt305x_esw_data
.vlan_config
= RT305X_ESW_VLAN_CONFIG_WLLLL
;
60 rt305x_register_ethernet();
61 ramips_register_gpio_leds(-1, ARRAY_SIZE(psr_680w_leds_gpio
),
63 ramips_register_gpio_buttons(-1, PSR_680W_KEYS_POLL_INTERVAL
,
64 ARRAY_SIZE(psr_680w_gpio_buttons
),
65 psr_680w_gpio_buttons
);
66 rt305x_register_wifi();
67 rt305x_register_wdt();
68 rt305x_register_usb();
71 MIPS_MACHINE(RAMIPS_MACH_PSR_680W
, "PSR-680W",
72 "Petatel PSR-680W Wireless 3G Router",