CONFIG_AR71XX_DEV_AP91_PCI=y
CONFIG_AR71XX_DEV_AP94_PCI=y
CONFIG_AR71XX_DEV_AR913X_WMAC=y
+CONFIG_AR71XX_DEV_DSA=y
CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
CONFIG_AR71XX_DEV_LEDS_GPIO=y
CONFIG_AR71XX_DEV_M25P80=y
CONFIG_AR71XX_DEV_AP91_PCI=y
CONFIG_AR71XX_DEV_AP94_PCI=y
CONFIG_AR71XX_DEV_AR913X_WMAC=y
+CONFIG_AR71XX_DEV_DSA=y
CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
CONFIG_AR71XX_DEV_LEDS_GPIO=y
CONFIG_AR71XX_DEV_M25P80=y
CONFIG_AR71XX_DEV_AP91_PCI=y
CONFIG_AR71XX_DEV_AP94_PCI=y
CONFIG_AR71XX_DEV_AR913X_WMAC=y
+CONFIG_AR71XX_DEV_DSA=y
CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
CONFIG_AR71XX_DEV_LEDS_GPIO=y
CONFIG_AR71XX_DEV_M25P80=y
bool "TP-LINK TL-WR841N v1 support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_PB42_PCI if PCI
+ select AR71XX_DEV_DSA
select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default n
bool "TP-LINK TL-WR941ND support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_DSA
select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default n
config AR71XX_DEV_AR913X_WMAC
def_bool n
+config AR71XX_DEV_DSA
+ def_bool n
+
config AR71XX_DEV_GPIO_BUTTONS
def_bool n
obj-$(CONFIG_AR71XX_DEV_AP91_PCI) += dev-ap91-pci.o
obj-$(CONFIG_AR71XX_DEV_AP94_PCI) += dev-ap94-pci.o
obj-$(CONFIG_AR71XX_DEV_AR913X_WMAC) += dev-ar913x-wmac.o
+obj-$(CONFIG_AR71XX_DEV_DSA) += dev-dsa.o
obj-$(CONFIG_AR71XX_DEV_GPIO_BUTTONS) += dev-gpio-buttons.o
obj-$(CONFIG_AR71XX_DEV_LEDS_GPIO) += dev-leds-gpio.o
obj-$(CONFIG_AR71XX_DEV_M25P80) += dev-m25p80.o
--- /dev/null
+/*
+ * Atheros AR71xx DSA switch device support
+ *
+ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ar71xx/ar71xx.h>
+
+#include "devices.h"
+#include "dev-dsa.h"
+
+static struct platform_device ar71xx_dsa_switch_device = {
+ .name = "dsa",
+ .id = 0,
+};
+
+void __init ar71xx_add_device_dsa(unsigned int id,
+ struct dsa_platform_data *d)
+{
+ int i;
+
+ switch (id) {
+ case 0:
+ d->netdev = &ar71xx_eth0_device.dev;
+ break;
+ case 1:
+ d->netdev = &ar71xx_eth1_device.dev;
+ break;
+ default:
+ printk(KERN_ERR
+ "ar71xx: invalid ethernet id %d for DSA switch\n",
+ id);
+ return;
+ }
+
+ for (i = 0; i < d->nr_chips; i++)
+ d->chip[i].mii_bus = &ar71xx_mdio_device.dev;
+
+ ar71xx_dsa_switch_device.dev.platform_data = d;
+
+ platform_device_register(&ar71xx_dsa_switch_device);
+}
--- /dev/null
+/*
+ * Atheros AR71xx DSA switch device support
+ *
+ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#ifndef _AR71XX_DEV_DSA_H
+#define _AR71XX_DEV_DSA_H
+
+#include <net/dsa.h>
+
+void ar71xx_add_device_dsa(unsigned int id,
+ struct dsa_platform_data *d) __init;
+
+#endif /* _AR71XX_DEV_DSA_H */
static struct ag71xx_mdio_platform_data ar71xx_mdio_data;
-static struct platform_device ar71xx_mdio_device = {
+struct platform_device ar71xx_mdio_device = {
.name = "ag71xx-mdio",
.id = -1,
.resource = ar71xx_mdio_resources,
.reset_bit = RESET_MODULE_GE0_MAC,
};
-static struct platform_device ar71xx_eth0_device = {
+struct platform_device ar71xx_eth0_device = {
.name = "ag71xx",
.id = 0,
.resource = ar71xx_eth0_resources,
.reset_bit = RESET_MODULE_GE1_MAC,
};
-static struct platform_device ar71xx_eth1_device = {
+struct platform_device ar71xx_eth1_device = {
.name = "ag71xx",
.id = 1,
.resource = ar71xx_eth1_resources,
printk(KERN_DEBUG "ar71xx: failed to parse mac address "
"\"%s\"\n", mac_str);
}
-
-static struct platform_device ar71xx_dsa_switch_device = {
- .name = "dsa",
- .id = 0,
-};
-
-void __init ar71xx_add_device_dsa(unsigned int id,
- struct dsa_platform_data *d)
-{
- int i;
-
- switch (id) {
- case 0:
- d->netdev = &ar71xx_eth0_device.dev;
- break;
- case 1:
- d->netdev = &ar71xx_eth1_device.dev;
- break;
- default:
- printk(KERN_ERR
- "ar71xx: invalid ethernet id %d for DSA switch\n",
- id);
- return;
- }
-
- for (i = 0; i < d->nr_chips; i++)
- d->chip[i].mii_bus = &ar71xx_mdio_device.dev;
-
- ar71xx_dsa_switch_device.dev.platform_data = d;
-
- platform_device_register(&ar71xx_dsa_switch_device);
-}
#include <asm/mach-ar71xx/platform.h>
-#include <net/dsa.h>
+struct platform_device;
void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
struct spi_board_info const *info,
extern struct ag71xx_platform_data ar71xx_eth0_data;
extern struct ag71xx_platform_data ar71xx_eth1_data;
+extern struct platform_device ar71xx_eth0_device;
+extern struct platform_device ar71xx_eth1_device;
void ar71xx_add_device_eth(unsigned int id) __init;
+extern struct platform_device ar71xx_mdio_device;
void ar71xx_add_device_mdio(u32 phy_mask) __init;
void ar71xx_add_device_uart(void) __init;
void ar71xx_add_device_wdt(void) __init;
-void ar71xx_add_device_dsa(unsigned int id,
- struct dsa_platform_data *d) __init;
-
#endif /* __AR71XX_DEVICES_H */
#include "machtype.h"
#include "devices.h"
+#include "dev-dsa.h"
#include "dev-m25p80.h"
#include "dev-gpio-buttons.h"
#include "dev-pb42-pci.h"
#include "machtype.h"
#include "devices.h"
+#include "dev-dsa.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
#include "dev-gpio-buttons.h"