[ar71xx] move device registration function prototypes into a separate header file
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-ap83.c
1 /*
2 * Atheros AP83 board support
3 *
4 * Copyright (C) 2008-2009 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
19 #include "devices.h"
20
21 #define AP83_GPIO_LED_WLAN 6
22 #define AP83_GPIO_LED_POWER 14
23 #define AP83_GPIO_LED_JUMPSTART 15
24 #define AP83_GPIO_BTN_JUMPSTART 12
25 #define AP83_GPIO_BTN_RESET 21
26
27 static struct gpio_led ap83_leds_gpio[] __initdata = {
28 {
29 .name = "ap83:green:jumpstart",
30 .gpio = AP83_GPIO_LED_JUMPSTART,
31 .active_low = 0,
32 }, {
33 .name = "ap83:green:power",
34 .gpio = AP83_GPIO_LED_POWER,
35 .active_low = 0,
36 }, {
37 .name = "ap83:green:wlan",
38 .gpio = AP83_GPIO_LED_WLAN,
39 .active_low = 0,
40 },
41 };
42
43 static struct gpio_button ap83_gpio_buttons[] __initdata = {
44 {
45 .desc = "soft_reset",
46 .type = EV_KEY,
47 .code = BTN_0,
48 .threshold = 5,
49 .gpio = AP83_GPIO_BTN_RESET,
50 .active_low = 1,
51 } , {
52 .desc = "jumpstart",
53 .type = EV_KEY,
54 .code = BTN_1,
55 .threshold = 5,
56 .gpio = AP83_GPIO_BTN_JUMPSTART,
57 .active_low = 1,
58 }
59 };
60
61 static void __init ap83_setup(void)
62 {
63 ar71xx_add_device_mdio(0xfffffffe);
64
65 ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
66 ar71xx_eth0_data.phy_mask = 0x1;
67
68 ar71xx_add_device_eth(0);
69
70 ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
71 ar71xx_eth1_data.phy_mask = 0x0;
72 ar71xx_eth1_data.speed = SPEED_1000;
73 ar71xx_eth1_data.duplex = DUPLEX_FULL;
74
75 ar71xx_add_device_eth(1);
76
77 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
78 ap83_leds_gpio);
79
80 ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons),
81 ap83_gpio_buttons);
82
83 ar71xx_add_device_usb();
84
85 ar91xx_add_device_wmac();
86 }
87
88 MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup);