ar71xx: merge files-3.2 to files
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ath79 / dev-dsa.c
1 /*
2 * Atheros AR71xx DSA switch device support
3 *
4 * Copyright (C) 2008-2012 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/init.h>
13 #include <linux/platform_device.h>
14
15 #include <asm/mach-ath79/ath79.h>
16
17 #include "dev-dsa.h"
18
19 static struct platform_device ar71xx_dsa_switch_device = {
20 .name = "dsa",
21 .id = 0,
22 };
23
24 void __init ath79_register_dsa(struct device *netdev,
25 struct device *miidev,
26 struct dsa_platform_data *d)
27 {
28 int i;
29
30 d->netdev = netdev;
31 for (i = 0; i < d->nr_chips; i++)
32 d->chip[i].mii_bus = miidev;
33
34 ar71xx_dsa_switch_device.dev.platform_data = d;
35 platform_device_register(&ar71xx_dsa_switch_device);
36 }