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-ath79/ath79.h>
14 #include "dev-gpio-buttons.h"
15 #include "dev-leds-gpio.h"
16 #include "dev-m25p80.h"
18 #include "machtypes.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 ath79_register_m25p80(&wpe72_flash_data
);
77 ath79_register_mdio(0, 0x0);
79 ath79_init_mac(ath79_eth0_data
.mac_addr
, ath79_mac_base
, 0);
80 ath79_init_mac(ath79_eth1_data
.mac_addr
, ath79_mac_base
, 1);
82 ath79_register_eth(0);
83 ath79_register_eth(1);
88 ath79_register_leds_gpio(-1, ARRAY_SIZE(wpe72_leds_gpio
),
91 ath79_register_gpio_keys_polled(-1, WPE72_KEYS_POLL_INTERVAL
,
92 ARRAY_SIZE(wpe72_gpio_keys
),
96 MIPS_MACHINE(ATH79_MACH_WPE72
, "WPE72", "Compex WPE72", wpe72_setup
);