2 * jjPlus JA76PF board support
5 #include <asm/mach-ar71xx/ar71xx.h>
6 #include <linux/platform_device.h>
8 #include <linux/i2c-gpio.h>
12 #include "dev-m25p80.h"
13 #include "dev-gpio-buttons.h"
14 #include "dev-pb42-pci.h"
16 #include "dev-leds-gpio.h"
18 #define JA76PF_KEYS_POLL_INTERVAL 20 /* msecs */
19 #define JA76PF_KEYS_DEBOUNCE_INTERVAL (3 * JA76PF_KEYS_POLL_INTERVAL)
21 #define JA76PF_GPIO_I2C_SCL 0
22 #define JA76PF_GPIO_I2C_SDA 1
23 #define JA76PF_GPIO_LED_1 5
24 #define JA76PF_GPIO_LED_2 4
25 #define JA76PF_GPIO_BTN_RESET 11
27 static struct gpio_led ja76pf_leds_gpio
[] __initdata
= {
29 .name
= "ja76pf:green:led1",
30 .gpio
= JA76PF_GPIO_LED_1
,
33 .name
= "ja76pf:green:led2",
34 .gpio
= JA76PF_GPIO_LED_2
,
39 static struct gpio_keys_button ja76pf_gpio_keys
[] __initdata
= {
44 .debounce_interval
= JA76PF_KEYS_DEBOUNCE_INTERVAL
,
45 .gpio
= JA76PF_GPIO_BTN_RESET
,
50 static struct i2c_gpio_platform_data ja76pf_i2c_gpio_data
= {
51 .sda_pin
= JA76PF_GPIO_I2C_SDA
,
52 .scl_pin
= JA76PF_GPIO_I2C_SCL
,
55 static struct platform_device ja76pf_i2c_gpio_device
= {
59 .platform_data
= &ja76pf_i2c_gpio_data
,
63 #define JA76PF_WAN_PHYMASK (1 << 4)
64 #define JA76PF_LAN_PHYMASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 < 3))
65 #define JA76PF_MDIO_PHYMASK (JA76PF_LAN_PHYMASK | JA76PF_WAN_PHYMASK)
67 static void __init
ja76pf_init(void)
69 ar71xx_add_device_m25p80(NULL
);
71 ar71xx_add_device_mdio(~JA76PF_MDIO_PHYMASK
);
73 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
74 ar71xx_eth0_data
.phy_mask
= JA76PF_LAN_PHYMASK
;
76 ar71xx_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
77 ar71xx_eth1_data
.phy_mask
= JA76PF_WAN_PHYMASK
;
78 ar71xx_eth1_data
.speed
= SPEED_1000
;
79 ar71xx_eth1_data
.duplex
= DUPLEX_FULL
;
81 ar71xx_add_device_eth(0);
82 ar71xx_add_device_eth(1);
84 platform_device_register(&ja76pf_i2c_gpio_device
);
86 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ja76pf_leds_gpio
),
89 ar71xx_register_gpio_keys_polled(-1, JA76PF_KEYS_POLL_INTERVAL
,
90 ARRAY_SIZE(ja76pf_gpio_keys
),
93 ar71xx_add_device_usb();
97 MIPS_MACHINE(AR71XX_MACH_JA76PF
, "JA76PF", "jjPlus JA76PF", ja76pf_init
);