2 * Compex WP543/WPJ543 board support
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
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.
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/input.h>
17 #include <asm/mips_machine.h>
18 #include <asm/mach-ar71xx/ar71xx.h>
19 #include <asm/mach-ar71xx/pci.h>
22 #include "dev-m25p80.h"
23 #include "dev-pb42-pci.h"
24 #include "dev-leds-gpio.h"
26 #define WP543_GPIO_SW6 2
27 #define WP543_GPIO_LED_1 3
28 #define WP543_GPIO_LED_2 4
29 #define WP543_GPIO_LED_WLAN 5
30 #define WP543_GPIO_LED_CONN 6
31 #define WP543_GPIO_LED_DIAG 7
32 #define WP543_GPIO_SW4 8
34 #define WP543_BUTTONS_POLL_INTERVAL 20
36 static struct gpio_led wp543_leds_gpio
[] __initdata
= {
38 .name
= "wp543:green:led1",
39 .gpio
= WP543_GPIO_LED_1
,
42 .name
= "wp543:green:led2",
43 .gpio
= WP543_GPIO_LED_2
,
46 .name
= "wp543:green:wlan",
47 .gpio
= WP543_GPIO_LED_WLAN
,
50 .name
= "wp543:green:conn",
51 .gpio
= WP543_GPIO_LED_CONN
,
54 .name
= "wp543:green:diag",
55 .gpio
= WP543_GPIO_LED_DIAG
,
60 static struct gpio_button wp543_gpio_buttons
[] __initdata
= {
66 .gpio
= WP543_GPIO_SW6
,
72 .gpio
= WP543_GPIO_SW4
,
76 static void __init
wp543_setup(void)
78 ar71xx_add_device_m25p80(NULL
);
80 ar71xx_add_device_mdio(0xfffffff7);
82 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
83 ar71xx_eth0_data
.phy_mask
= 0x00000008;
84 ar71xx_eth0_data
.reset_bit
= RESET_MODULE_GE0_MAC
|
86 ar71xx_add_device_eth(0);
88 ar71xx_add_device_usb();
92 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wp543_leds_gpio
),
95 ar71xx_add_device_gpio_buttons(-1, WP543_BUTTONS_POLL_INTERVAL
,
96 ARRAY_SIZE(wp543_gpio_buttons
),
100 MIPS_MACHINE(AR71XX_MACH_WP543
, "Compex WP543", wp543_setup
);