[ar71xx] add gpio leds for the AP83 board
[openwrt-10.03/.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-ap83.c
1 /*
2  *  Atheros AP83 board support
3  *
4  *  Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
5  *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
6  *
7  *  This program is free software; you can redistribute it and/or modify it
8  *  under the terms of the GNU General Public License version 2 as published
9  *  by the Free Software Foundation.
10  */
11
12 #include <linux/platform_device.h>
13 #include <linux/input.h>
14
15 #include <asm/mips_machine.h>
16 #include <asm/mach-ar71xx/ar71xx.h>
17 #include <asm/mach-ar71xx/pci.h>
18 #include <asm/mach-ar71xx/platform.h>
19
20 #define AP83_GPIO_LED_WLAN      6
21 #define AP83_GPIO_LED_POWER     14
22 #define AP83_GPIO_LED_JUMPSTART 15
23
24 static struct gpio_led ap83_leds_gpio[] __initdata = {
25         {
26                 .name           = "ap83:green:jumpstart",
27                 .gpio           = AP83_GPIO_LED_JUMPSTART,
28                 .active_low     = 0,
29         }, {
30                 .name           = "ap83:green:power",
31                 .gpio           = AP83_GPIO_LED_POWER,
32                 .active_low     = 0,
33         }, {
34                 .name           = "ap83:green:wlan",
35                 .gpio           = AP83_GPIO_LED_WLAN,
36                 .active_low     = 0,
37         },
38 };
39
40 static void __init ap83_setup(void)
41 {
42         ar71xx_add_device_mdio(0xfffffffe);
43
44         ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
45         ar71xx_eth0_data.phy_mask = 0x1;
46
47         ar71xx_add_device_eth(0);
48
49         ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
50                                         ap83_leds_gpio);
51
52 }
53
54 MIPS_MACHINE(MACH_AR71XX_AP83, "Atheros AP83", ap83_setup);