2 * jjPlus JWAP003 board support
7 #include <linux/i2c-gpio.h>
8 #include <linux/platform_device.h>
10 #include <asm/mach-ath79/ath79.h>
13 #include "dev-m25p80.h"
14 #include "dev-gpio-buttons.h"
16 #include "machtypes.h"
19 #define JWAP003_KEYS_POLL_INTERVAL 20 /* msecs */
20 #define JWAP003_KEYS_DEBOUNCE_INTERVAL (3 * JWAP003_KEYS_POLL_INTERVAL)
22 #define JWAP003_GPIO_WPS 11
23 #define JWAP003_GPIO_I2C_SCL 0
24 #define JWAP003_GPIO_I2C_SDA 1
26 static struct gpio_keys_button jwap003_gpio_keys[] __initdata = {
30 .code = KEY_WPS_BUTTON,
31 .debounce_interval = JWAP003_KEYS_DEBOUNCE_INTERVAL,
32 .gpio = JWAP003_GPIO_WPS,
37 static struct i2c_gpio_platform_data jwap003_i2c_gpio_data = {
38 .sda_pin = JWAP003_GPIO_I2C_SDA,
39 .scl_pin = JWAP003_GPIO_I2C_SCL,
42 static struct platform_device jwap003_i2c_gpio_device = {
46 .platform_data = &jwap003_i2c_gpio_data,
50 static const char *jwap003_part_probes[] = {
55 static struct flash_platform_data jwap003_flash_data = {
56 .part_probes = jwap003_part_probes,
59 #define JWAP003_WAN_PHYMASK BIT(0)
60 #define JWAP003_LAN_PHYMASK BIT(4)
62 static void __init jwap003_init(void)
64 ath79_register_m25p80(&jwap003_flash_data);
66 ath79_register_mdio(0, 0x0);
68 ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
69 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
70 ath79_eth0_data.phy_mask = JWAP003_WAN_PHYMASK;
71 ath79_eth0_data.speed = SPEED_100;
72 ath79_eth0_data.duplex = DUPLEX_FULL;
73 ath79_eth0_data.has_ar8216 = 1;
75 ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
76 ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
77 ath79_eth1_data.phy_mask = JWAP003_LAN_PHYMASK;
78 ath79_eth1_data.speed = SPEED_100;
79 ath79_eth1_data.duplex = DUPLEX_FULL;
81 ath79_register_eth(0);
82 ath79_register_eth(1);
84 platform_device_register(&jwap003_i2c_gpio_device);
88 ath79_register_gpio_keys_polled(-1, JWAP003_KEYS_POLL_INTERVAL,
89 ARRAY_SIZE(jwap003_gpio_keys),
95 MIPS_MACHINE(ATH79_MACH_JWAP003, "JWAP003", "jjPlus JWAP003", jwap003_init);