2 * Compex WPE72 board support
4 * Copyright (C) 2012 Johnathan Boyce<jon.boyce@globalreach.eu.com>
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<asm/mach-ar71xx/ar71xx.h>
15 #include "dev-m25p80.h"
16 #include "dev-pb42-pci.h"
17 #include "dev-gpio-buttons.h"
18 #include "dev-leds-gpio.h"
21 #define WPE72_GPIO_RESET 12
22 #define WPE72_GPIO_LED_DIAG 13
23 #define WPE72_GPIO_LED_1 14
24 #define WPE72_GPIO_LED_2 15
25 #define WPE72_GPIO_LED_3 16
26 #define WPE72_GPIO_LED_4 17
28 #define WPE72_KEYS_POLL_INTERVAL 20 /* msecs */
29 #define WPE72_KEYS_DEBOUNCE_INTERVAL (3 * WPE72_KEYS_POLL_INTERVAL)
31 static struct gpio_led wpe72_leds_gpio
[] __initdata
= {
33 .name
= "wpe72:green:led1",
34 .gpio
= WPE72_GPIO_LED_1
,
37 .name
= "wpe72:green:led2",
38 .gpio
= WPE72_GPIO_LED_2
,
41 .name
= "wpe72:green:led3",
42 .gpio
= WPE72_GPIO_LED_3
,
45 .name
= "wpe72:green:led4",
46 .gpio
= WPE72_GPIO_LED_4
,
49 .name
= "wpe72:green:diag",
50 .gpio
= WPE72_GPIO_LED_DIAG
,
55 static struct gpio_keys_button wpe72_gpio_keys
[] __initdata
= {
60 .debounce_interval
= WPE72_KEYS_DEBOUNCE_INTERVAL
,
61 .gpio
= WPE72_GPIO_RESET
,
65 static const char *wpe72_part_probes
[] = {
70 static struct flash_platform_data wpe72_flash_data
= {
71 .part_probes
= wpe72_part_probes
,
74 static void __init
wpe72_setup(void)
76 ar71xx_add_device_m25p80(&wpe72_flash_data
);
77 ar71xx_add_device_mdio(0, 0x0);
79 ar71xx_init_mac(ar71xx_eth0_data
.mac_addr
, ar71xx_mac_base
, 0);
80 ar71xx_init_mac(ar71xx_eth1_data
.mac_addr
, ar71xx_mac_base
, 1);
82 ar71xx_add_device_eth(0);
83 ar71xx_add_device_eth(1);
85 ar71xx_add_device_usb();
89 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wpe72_leds_gpio
),
92 ar71xx_register_gpio_keys_polled(-1, WPE72_KEYS_POLL_INTERVAL
,
93 ARRAY_SIZE(wpe72_gpio_keys
),
97 MIPS_MACHINE(AR71XX_MACH_WPE72
, "WPE72", "Compex WPE72", wpe72_setup
);