2 * Support for COMFAST boards:
3 * - CF-E316N v2 (AR9341)
4 * - CF-E320N v2 (QCA9531)
5 * - CF-E355AC (QCA9531 + QCA9882)
6 * - CF-E355AC v2 (QCA9531 + QCA9886)
7 * - CF-E375AC (QCA9563 + QCA9886 + QCA8337)
8 * - CF-E380AC v1/v2 (QCA9558)
9 * - CF-E520N/CF-E530N (QCA9531)
11 * Copyright (C) 2016 Piotr Dymacz <pepe2k@gmail.com>
12 * Copyright (C) 2016 Gareth Parker <gareth41@orcon.net.nz>
13 * Copyright (C) 2015 Paul Fertser <fercerpav@gmail.com>
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License version 2 as published
17 * by the Free Software Foundation.
20 #include <linux/gpio.h>
21 #include <linux/ar8216_platform.h>
22 #include <linux/platform_data/phy-at803x.h>
23 #include <linux/platform_device.h>
24 #include <linux/timer.h>
26 #include <asm/mach-ath79/ath79.h>
27 #include <asm/mach-ath79/ar71xx_regs.h>
30 #include "dev-ap9x-pci.h"
32 #include "dev-gpio-buttons.h"
33 #include "dev-leds-gpio.h"
34 #include "dev-m25p80.h"
37 #include "machtypes.h"
39 #define CF_EXXXN_KEYS_POLL_INTERVAL 20
40 #define CF_EXXXN_KEYS_DEBOUNCE_INTERVAL (3 * CF_EXXXN_KEYS_POLL_INTERVAL)
43 #define CF_E316N_V2_GPIO_LED_DIAG_B 0
44 #define CF_E316N_V2_GPIO_LED_DIAG_R 2
45 #define CF_E316N_V2_GPIO_LED_DIAG_G 3
46 #define CF_E316N_V2_GPIO_LED_WLAN 12
47 #define CF_E316N_V2_GPIO_LED_WAN 17
48 #define CF_E316N_V2_GPIO_LED_LAN 19
50 #define CF_E316N_V2_GPIO_EXT_WDT 16
52 #define CF_E316N_V2_GPIO_EXTERNAL_PA0 13
53 #define CF_E316N_V2_GPIO_EXTERNAL_PA1 14
55 #define CF_E316N_V2_GPIO_BTN_RESET 20
57 static struct gpio_led cf_e316n_v2_leds_gpio
[] __initdata
= {
59 .name
= "cf-e316n-v2:blue:diag",
60 .gpio
= CF_E316N_V2_GPIO_LED_DIAG_B
,
63 .name
= "cf-e316n-v2:red:diag",
64 .gpio
= CF_E316N_V2_GPIO_LED_DIAG_R
,
67 .name
= "cf-e316n-v2:green:diag",
68 .gpio
= CF_E316N_V2_GPIO_LED_DIAG_G
,
71 .name
= "cf-e316n-v2:blue:wlan",
72 .gpio
= CF_E316N_V2_GPIO_LED_WLAN
,
75 .name
= "cf-e316n-v2:blue:wan",
76 .gpio
= CF_E316N_V2_GPIO_LED_WAN
,
79 .name
= "cf-e316n-v2:blue:lan",
80 .gpio
= CF_E316N_V2_GPIO_LED_LAN
,
85 static struct gpio_keys_button cf_e316n_v2_gpio_keys
[] __initdata
= {
90 .debounce_interval
= CF_EXXXN_KEYS_DEBOUNCE_INTERVAL
,
91 .gpio
= CF_E316N_V2_GPIO_BTN_RESET
,
97 #define CF_E320N_V2_GPIO_LED_WLAN 0
98 #define CF_E320N_V2_GPIO_LED_WAN 2
99 #define CF_E320N_V2_GPIO_LED_LAN 3
101 #define CF_E320N_V2_GPIO_HEADER_J9_1 14
102 #define CF_E320N_V2_GPIO_HEADER_J9_2 12
103 #define CF_E320N_V2_GPIO_HEADER_J9_3 11
104 #define CF_E320N_V2_GPIO_HEADER_J9_4 16
106 #define CF_E320N_V2_GPIO_EXT_WDT 13
108 #define CF_E320N_V2_GPIO_BTN_RESET 17
110 static struct gpio_led cf_e320n_v2_leds_gpio
[] __initdata
= {
112 .name
= "cf-e320n-v2:green:lan",
113 .gpio
= CF_E320N_V2_GPIO_LED_LAN
,
116 .name
= "cf-e320n-v2:red:wan",
117 .gpio
= CF_E320N_V2_GPIO_LED_WAN
,
120 .name
= "cf-e320n-v2:blue:wlan",
121 .gpio
= CF_E320N_V2_GPIO_LED_WLAN
,
126 static struct gpio_keys_button cf_e320n_v2_gpio_keys
[] __initdata
= {
128 .desc
= "Reset button",
131 .debounce_interval
= CF_EXXXN_KEYS_DEBOUNCE_INTERVAL
,
132 .gpio
= CF_E320N_V2_GPIO_BTN_RESET
,
138 #define CF_E355AC_GPIO_LED_LAN 3
139 #define CF_E355AC_GPIO_LED_WLAN2G 0
140 #define CF_E355AC_GPIO_LED_WLAN5G 2
142 #define CF_E355AC_GPIO_EXT_WDT 13
144 #define CF_E355AC_GPIO_BTN_RESET 17
146 static struct gpio_led cf_e355ac_leds_gpio
[] __initdata
= {
148 .name
= "cf-e355ac:green:lan",
149 .gpio
= CF_E355AC_GPIO_LED_LAN
,
152 .name
= "cf-e355ac:blue:wlan2g",
153 .gpio
= CF_E355AC_GPIO_LED_WLAN2G
,
156 .name
= "cf-e355ac:red:wlan5g",
157 .gpio
= CF_E355AC_GPIO_LED_WLAN5G
,
162 static struct gpio_keys_button cf_e355ac_gpio_keys
[] __initdata
= {
164 .desc
= "Reset button",
167 .debounce_interval
= CF_EXXXN_KEYS_DEBOUNCE_INTERVAL
,
168 .gpio
= CF_E355AC_GPIO_BTN_RESET
,
173 #define CF_E375AC_GPIO_XWDT_TRIGGER 6
175 #define CF_E375AC_GPIO_BTN_RESET_WPS 2
177 #define CF_E375AC_GPIO_LED_WAN 15
178 #define CF_E375AC_GPIO_LED_LAN 17
179 #define CF_E375AC_GPIO_LED_WLAN 16
181 static struct gpio_led cf_e375ac_leds_gpio
[] __initdata
= {
183 .name
= "comfast:red:wan",
184 .gpio
= CF_E375AC_GPIO_LED_WAN
,
187 .name
= "comfast:green:lan",
188 .gpio
= CF_E375AC_GPIO_LED_LAN
,
191 .name
= "comfast:blue:wlan",
192 .gpio
= CF_E375AC_GPIO_LED_WLAN
,
197 static struct gpio_keys_button cf_e375ac_gpio_keys
[] __initdata
= {
199 .desc
= "Reset button/WPS button",
202 .debounce_interval
= CF_EXXXN_KEYS_DEBOUNCE_INTERVAL
,
203 .gpio
= CF_E375AC_GPIO_BTN_RESET_WPS
,
208 static struct ar8327_pad_cfg cf_e375ac_ar8337_pad0_cfg
= {
209 .mode
= AR8327_PAD_MAC_SGMII
,
210 .sgmii_delay_en
= true,
213 static struct ar8327_platform_data cf_e375ac_ar8337_data
= {
214 .pad0_cfg
= &cf_e375ac_ar8337_pad0_cfg
,
217 .speed
= AR8327_PORT_SPEED_1000
,
224 static struct mdio_board_info cf_e375ac_mdio0_info
[] = {
226 .bus_id
= "ag71xx-mdio.0",
228 .platform_data
= &cf_e375ac_ar8337_data
,
232 /* CF-E380AC v1/v2 */
233 #define CF_E380AC_V1V2_GPIO_LED_LAN 0
234 #define CF_E380AC_V1V2_GPIO_LED_WLAN2G 2
235 #define CF_E380AC_V1V2_GPIO_LED_WLAN5G 3
237 #define CF_E380AC_V1V2_GPIO_EXT_WDT 17
239 #define CF_E380AC_V1V2_GPIO_BTN_RESET 19
241 static struct gpio_led cf_e380ac_v1_leds_gpio
[] __initdata
= {
243 .name
= "cf-e380ac-v1:green:lan",
244 .gpio
= CF_E380AC_V1V2_GPIO_LED_LAN
,
247 .name
= "cf-e380ac-v1:blue:wlan2g",
248 .gpio
= CF_E380AC_V1V2_GPIO_LED_WLAN2G
,
251 .name
= "cf-e380ac-v1:red:wlan5g",
252 .gpio
= CF_E380AC_V1V2_GPIO_LED_WLAN5G
,
257 static struct gpio_led cf_e380ac_v2_leds_gpio
[] __initdata
= {
259 .name
= "cf-e380ac-v2:green:lan",
260 .gpio
= CF_E380AC_V1V2_GPIO_LED_LAN
,
263 .name
= "cf-e380ac-v2:blue:wlan2g",
264 .gpio
= CF_E380AC_V1V2_GPIO_LED_WLAN2G
,
267 .name
= "cf-e380ac-v2:red:wlan5g",
268 .gpio
= CF_E380AC_V1V2_GPIO_LED_WLAN5G
,
273 static struct gpio_keys_button cf_e380ac_v1v2_gpio_keys
[] __initdata
= {
275 .desc
= "Reset button",
278 .debounce_interval
= CF_EXXXN_KEYS_DEBOUNCE_INTERVAL
,
279 .gpio
= CF_E380AC_V1V2_GPIO_BTN_RESET
,
284 static struct at803x_platform_data cf_e380ac_v1v2_at803x_data
= {
285 .disable_smarteee
= 1,
288 static struct mdio_board_info cf_e380ac_v1v2_mdio0_info
[] = {
290 .bus_id
= "ag71xx-mdio.0",
292 .platform_data
= &cf_e380ac_v1v2_at803x_data
,
296 /* CF-E520N/CF-E530N */
297 #define CF_E5X0N_GPIO_LED_WAN 11
298 #define CF_E5X0N_GPIO_BTN_RESET 17
300 static struct gpio_led cf_e520n_leds_gpio
[] __initdata
= {
302 .name
= "cf-e520n:blue:wan",
303 .gpio
= CF_E5X0N_GPIO_LED_WAN
,
308 static struct gpio_led cf_e530n_leds_gpio
[] __initdata
= {
310 .name
= "cf-e530n:blue:wan",
311 .gpio
= CF_E5X0N_GPIO_LED_WAN
,
317 * Some COMFAST devices include external hardware watchdog chip,
318 * Pericon Technology PT7A7514, connected to a selected GPIO
319 * and WiSoC RESET_L input. Watchdog time-out is ~1.6 s.
321 #define CF_EXXXN_EXT_WDT_TIMEOUT_MS 500
323 static struct timer_list gpio_wdt_timer
;
325 static void gpio_wdt_toggle(unsigned long gpio
)
330 gpio_set_value(gpio
, state
);
332 mod_timer(&gpio_wdt_timer
,
333 jiffies
+ msecs_to_jiffies(CF_EXXXN_EXT_WDT_TIMEOUT_MS
));
336 static void __init
cf_exxxn_common_setup(unsigned long art_ofs
, int gpio_wdt
)
338 u8
*art
= (u8
*) KSEG1ADDR(0x1f001000 + art_ofs
);
341 gpio_request_one(gpio_wdt
, GPIOF_OUT_INIT_HIGH
,
342 "PT7A7514 watchdog");
344 setup_timer(&gpio_wdt_timer
, gpio_wdt_toggle
, gpio_wdt
);
345 gpio_wdt_toggle(gpio_wdt
);
348 ath79_register_m25p80(NULL
);
350 ath79_register_wmac(art
, NULL
);
352 ath79_register_usb();
355 static void __init
cf_e316n_v2_setup(void)
357 u8
*mac
= (u8
*) KSEG1ADDR(0x1f010000);
359 cf_exxxn_common_setup(0x10000, CF_E316N_V2_GPIO_EXT_WDT
);
361 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP
);
363 ath79_register_mdio(1, 0x0);
365 /* GMAC0 is connected to the PHY0 of the internal switch */
366 ath79_switch_data
.phy4_mii_en
= 1;
367 ath79_switch_data
.phy_poll_mask
= BIT(0);
368 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
369 ath79_eth0_data
.phy_mask
= BIT(0);
370 ath79_eth0_data
.mii_bus_dev
= &ath79_mdio1_device
.dev
;
371 ath79_init_mac(ath79_eth0_data
.mac_addr
, mac
, 0);
372 ath79_register_eth(0);
374 /* GMAC1 is connected to the internal switch */
375 ath79_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_GMII
;
376 ath79_init_mac(ath79_eth1_data
.mac_addr
, mac
, 2);
377 ath79_register_eth(1);
379 /* Enable 2x Skyworks SE2576L WLAN power amplifiers */
380 gpio_request_one(CF_E316N_V2_GPIO_EXTERNAL_PA0
, GPIOF_OUT_INIT_HIGH
,
382 gpio_request_one(CF_E316N_V2_GPIO_EXTERNAL_PA1
, GPIOF_OUT_INIT_HIGH
,
385 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e316n_v2_leds_gpio
),
386 cf_e316n_v2_leds_gpio
);
388 ath79_register_gpio_keys_polled(1, CF_EXXXN_KEYS_POLL_INTERVAL
,
389 ARRAY_SIZE(cf_e316n_v2_gpio_keys
),
390 cf_e316n_v2_gpio_keys
);
393 MIPS_MACHINE(ATH79_MACH_CF_E316N_V2
, "CF-E316N-V2", "COMFAST CF-E316N v2",
396 static void __init
cf_exxxn_qca953x_eth_setup(void)
398 u8
*mac
= (u8
*) KSEG1ADDR(0x1f010000);
400 ath79_setup_ar933x_phy4_switch(false, false);
402 ath79_register_mdio(0, 0x0);
404 ath79_switch_data
.phy4_mii_en
= 1;
405 ath79_switch_data
.phy_poll_mask
|= BIT(4);
408 ath79_eth1_data
.duplex
= DUPLEX_FULL
;
409 ath79_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_GMII
;
410 ath79_eth1_data
.speed
= SPEED_1000
;
411 ath79_init_mac(ath79_eth1_data
.mac_addr
, mac
, 2);
412 ath79_register_eth(1);
415 ath79_eth0_data
.duplex
= DUPLEX_FULL
;
416 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
417 ath79_eth0_data
.speed
= SPEED_100
;
418 ath79_eth0_data
.phy_mask
= BIT(4);
419 ath79_init_mac(ath79_eth0_data
.mac_addr
, mac
, 0);
420 ath79_register_eth(0);
423 static void __init
cf_e320n_v2_setup(void)
425 cf_exxxn_common_setup(0x10000, CF_E320N_V2_GPIO_EXT_WDT
);
427 cf_exxxn_qca953x_eth_setup();
429 /* Disable JTAG (enables GPIO0-3) */
430 ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE
);
432 ath79_gpio_direction_select(CF_E320N_V2_GPIO_LED_LAN
, true);
433 ath79_gpio_direction_select(CF_E320N_V2_GPIO_LED_WAN
, true);
434 ath79_gpio_direction_select(CF_E320N_V2_GPIO_LED_WLAN
, true);
436 ath79_gpio_output_select(CF_E320N_V2_GPIO_LED_LAN
, 0);
437 ath79_gpio_output_select(CF_E320N_V2_GPIO_LED_WAN
, 0);
438 ath79_gpio_output_select(CF_E320N_V2_GPIO_LED_WLAN
, 0);
440 /* Enable GPIO function for GPIOs in J9 header */
441 ath79_gpio_output_select(CF_E320N_V2_GPIO_HEADER_J9_1
, 0);
442 ath79_gpio_output_select(CF_E320N_V2_GPIO_HEADER_J9_2
, 0);
443 ath79_gpio_output_select(CF_E320N_V2_GPIO_HEADER_J9_3
, 0);
444 ath79_gpio_output_select(CF_E320N_V2_GPIO_HEADER_J9_4
, 0);
446 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e320n_v2_leds_gpio
),
447 cf_e320n_v2_leds_gpio
);
449 ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL
,
450 ARRAY_SIZE(cf_e320n_v2_gpio_keys
),
451 cf_e320n_v2_gpio_keys
);
454 MIPS_MACHINE(ATH79_MACH_CF_E320N_V2
, "CF-E320N-V2", "COMFAST CF-E320N v2",
457 static void __init
cf_e355ac_setup(void)
459 u8
*art
= (u8
*) KSEG1ADDR(0x1f010000);
461 /* Disable JTAG, enabling GPIOs 0-3 */
462 ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE
, 0);
464 cf_exxxn_common_setup(0x10000, CF_E355AC_GPIO_EXT_WDT
);
466 cf_exxxn_qca953x_eth_setup();
468 ath79_gpio_output_select(CF_E355AC_GPIO_LED_LAN
, 0);
469 ath79_gpio_output_select(CF_E355AC_GPIO_LED_WLAN2G
, 0);
470 ath79_gpio_output_select(CF_E355AC_GPIO_LED_WLAN5G
, 0);
472 ap91_pci_init(art
+ 0x5000, NULL
);
474 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e355ac_leds_gpio
),
475 cf_e355ac_leds_gpio
);
477 ath79_register_gpio_keys_polled(1, CF_EXXXN_KEYS_POLL_INTERVAL
,
478 ARRAY_SIZE(cf_e355ac_gpio_keys
),
479 cf_e355ac_gpio_keys
);
482 MIPS_MACHINE(ATH79_MACH_CF_E355AC
, "CF-E355AC", "COMFAST CF-E355AC",
485 MIPS_MACHINE(ATH79_MACH_CF_E355AC_V2
, "CF-E355AC-V2", "COMFAST CF-E355AC v2",
488 static void __init
cf_e375ac_setup(void)
490 u8
*mac
= (u8
*) KSEG1ADDR(0x1f040000);
491 u8
*art
= (u8
*) KSEG1ADDR(0x1f040000);
492 u8 wlan1_mac
[ETH_ALEN
];
494 ath79_init_mac(ath79_eth0_data
.mac_addr
, mac
, 0);
495 ath79_init_mac(ath79_eth1_data
.mac_addr
, mac
, 1);
496 ath79_init_mac(wlan1_mac
, art
, 3);
498 /* Disable JTAG, enabling GPIOs 0-3 */
499 /* Configure OBS4 line, for GPIO 4*/
500 ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE
, 0);
502 cf_exxxn_common_setup(0x40000, CF_E375AC_GPIO_XWDT_TRIGGER
);
504 ath79_gpio_output_select(CF_E375AC_GPIO_LED_WAN
, 0);
505 ath79_gpio_output_select(CF_E375AC_GPIO_LED_LAN
, 0);
506 ath79_gpio_output_select(CF_E375AC_GPIO_LED_WLAN
, 0);
508 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e375ac_leds_gpio
),
509 cf_e375ac_leds_gpio
);
510 ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL
,
511 ARRAY_SIZE(cf_e375ac_gpio_keys
),
512 cf_e375ac_gpio_keys
);
514 platform_device_register(&ath79_mdio0_device
);
516 mdiobus_register_board_info(cf_e375ac_mdio0_info
,
517 ARRAY_SIZE(cf_e375ac_mdio0_info
));
519 /* GMAC0 is connected to an AR8337 switch */
520 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_SGMII
;
521 ath79_eth0_data
.speed
= SPEED_1000
;
522 ath79_eth0_data
.duplex
= DUPLEX_FULL
;
523 ath79_eth0_data
.phy_mask
= BIT(0);
524 ath79_eth0_data
.mii_bus_dev
= &ath79_mdio0_device
.dev
;
525 ath79_register_eth(0);
527 ap91_pci_init(art
+ 0x5000, wlan1_mac
);
529 MIPS_MACHINE(ATH79_MACH_CF_E375AC
, "CF-E375AC", "COMFAST CF-E375AC", cf_e375ac_setup
);
531 static void __init
cf_e380ac_v1v2_common_setup(unsigned long art_ofs
)
533 u8
*mac
= (u8
*) KSEG1ADDR(0x1f000000 + art_ofs
);
535 cf_exxxn_common_setup(art_ofs
, CF_E380AC_V1V2_GPIO_EXT_WDT
);
537 ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN
);
539 ath79_register_mdio(0, 0x0);
540 mdiobus_register_board_info(cf_e380ac_v1v2_mdio0_info
,
541 ARRAY_SIZE(cf_e380ac_v1v2_mdio0_info
));
544 ath79_eth0_data
.mii_bus_dev
= &ath79_mdio0_device
.dev
;
545 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
546 ath79_eth0_data
.phy_mask
= BIT(0);
547 ath79_eth0_pll_data
.pll_1000
= 0xbe000000;
548 ath79_eth0_pll_data
.pll_100
= 0xb0000101;
549 ath79_eth0_pll_data
.pll_10
= 0xb0001313;
550 ath79_init_mac(ath79_eth0_data
.mac_addr
, mac
, 0);
551 ath79_register_eth(0);
553 ap91_pci_init(mac
+ 0x5000, NULL
);
555 /* Disable JTAG (enables GPIO0-3) */
556 ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE
);
558 ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_LAN
, true);
559 ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_WLAN2G
, true);
560 ath79_gpio_direction_select(CF_E380AC_V1V2_GPIO_LED_WLAN5G
, true);
562 ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_LAN
, 0);
563 ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_WLAN2G
, 0);
564 ath79_gpio_output_select(CF_E380AC_V1V2_GPIO_LED_WLAN5G
, 0);
567 ath79_gpio_function_disable(AR934X_GPIO_FUNC_CLK_OBS4_EN
);
569 ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL
,
570 ARRAY_SIZE(cf_e380ac_v1v2_gpio_keys
),
571 cf_e380ac_v1v2_gpio_keys
);
574 static void __init
cf_e380ac_v1_setup(void)
576 cf_e380ac_v1v2_common_setup(0x20000);
578 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e380ac_v1_leds_gpio
),
579 cf_e380ac_v1_leds_gpio
);
582 MIPS_MACHINE(ATH79_MACH_CF_E380AC_V1
, "CF-E380AC-V1", "COMFAST CF-E380AC v1",
585 static void __init
cf_e380ac_v2_setup(void)
587 cf_e380ac_v1v2_common_setup(0x40000);
589 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e380ac_v2_leds_gpio
),
590 cf_e380ac_v2_leds_gpio
);
593 MIPS_MACHINE(ATH79_MACH_CF_E380AC_V2
, "CF-E380AC-V2", "COMFAST CF-E380AC v2",
596 static void __init
cf_e5x0n_gpio_setup(void)
598 ath79_gpio_direction_select(CF_E5X0N_GPIO_LED_WAN
, true);
600 ath79_gpio_output_select(CF_E5X0N_GPIO_LED_WAN
, 0);
602 ath79_register_gpio_keys_polled(-1, CF_EXXXN_KEYS_POLL_INTERVAL
,
603 ARRAY_SIZE(cf_e320n_v2_gpio_keys
),
604 cf_e320n_v2_gpio_keys
);
607 static void __init
cf_e520n_setup(void)
609 cf_exxxn_common_setup(0x10000, -1);
611 cf_exxxn_qca953x_eth_setup();
613 cf_e5x0n_gpio_setup();
615 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e520n_leds_gpio
),
619 MIPS_MACHINE(ATH79_MACH_CF_E520N
, "CF-E520N", "COMFAST CF-E520N",
622 static void __init
cf_e530n_setup(void)
624 cf_exxxn_common_setup(0x10000, -1);
626 cf_exxxn_qca953x_eth_setup();
628 cf_e5x0n_gpio_setup();
630 ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e530n_leds_gpio
),
634 MIPS_MACHINE(ATH79_MACH_CF_E530N
, "CF-E530N", "COMFAST CF-E530N",