2 * Senao EAP7660D board support
4 * Copyright (C) 2010 Daniel Golle <daniel.golle@gmail.com>
5 * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
6 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
13 #include <asm/mach-ar71xx/ar71xx.h>
17 #include "dev-gpio-buttons.h"
18 #include "dev-leds-gpio.h"
19 #include "dev-pb42-pci.h"
20 #include "dev-m25p80.h"
22 #define EAP7660D_BUTTONS_POLL_INTERVAL 20
23 #define EAP7660D_GPIO_DS4 7
24 #define EAP7660D_GPIO_DS5 2
25 #define EAP7660D_GPIO_DS7 0
26 #define EAP7660D_GPIO_DS8 4
27 #define EAP7660D_GPIO_SW1 3
28 #define EAP7660D_GPIO_SW3 8
29 #define EAP7660D_PHYMASK BIT(20)
31 static struct gpio_led eap7660d_leds_gpio
[] __initdata
= {
33 .name
= "eap7660d:green:ds8",
34 .gpio
= EAP7660D_GPIO_DS8
,
38 .name
= "eap7660d:green:ds5",
39 .gpio
= EAP7660D_GPIO_DS5
,
43 .name
= "eap7660d:green:ds7",
44 .gpio
= EAP7660D_GPIO_DS7
,
48 .name
= "eap7660d:green:ds4",
49 .gpio
= EAP7660D_GPIO_DS4
,
54 static struct gpio_button eap7660d_gpio_buttons
[] __initdata
= {
60 .gpio
= EAP7660D_GPIO_SW1
,
66 .code
= KEY_WPS_BUTTON
,
68 .gpio
= EAP7660D_GPIO_SW3
,
73 static void __init
eap7660d_setup(void)
75 ar71xx_add_device_mdio(~EAP7660D_PHYMASK
);
76 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
77 ar71xx_eth0_data
.phy_mask
= EAP7660D_PHYMASK
;
78 ar71xx_add_device_eth(0);
79 ar71xx_add_device_m25p80(NULL
);
80 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(eap7660d_leds_gpio
),
82 ar71xx_add_device_gpio_buttons(-1, EAP7660D_BUTTONS_POLL_INTERVAL
,
83 ARRAY_SIZE(eap7660d_gpio_buttons
),
84 eap7660d_gpio_buttons
);
88 MIPS_MACHINE(AR71XX_MACH_EAP7660D
, "EAP7660D", "Senao EAP7660D",