#include <linux/etherdevice.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
-#include <linux/ath9k_platform.h>
#include <asm/mach-ar71xx/ar71xx.h>
platform_device_register(&ar71xx_spi_device);
}
-void __init ar71xx_add_device_leds_gpio(int id, unsigned num_leds,
- struct gpio_led *leds)
-{
- struct platform_device *pdev;
- struct gpio_led_platform_data pdata;
- struct gpio_led *p;
- int err;
-
- p = kmalloc(num_leds * sizeof(*p), GFP_KERNEL);
- if (!p)
- return;
-
- memcpy(p, leds, num_leds * sizeof(*p));
-
- pdev = platform_device_alloc("leds-gpio", id);
- if (!pdev)
- goto err_free_leds;
-
- memset(&pdata, 0, sizeof(pdata));
- pdata.num_leds = num_leds;
- pdata.leds = p;
-
- err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
- if (err)
- goto err_put_pdev;
-
- err = platform_device_add(pdev);
- if (err)
- goto err_put_pdev;
-
- return;
-
-err_put_pdev:
- platform_device_put(pdev);
-
-err_free_leds:
- kfree(p);
-}
-
-void __init ar71xx_add_device_gpio_buttons(int id,
- unsigned poll_interval,
- unsigned nbuttons,
- struct gpio_button *buttons)
-{
- struct platform_device *pdev;
- struct gpio_buttons_platform_data pdata;
- struct gpio_button *p;
- int err;
-
- p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
- if (!p)
- return;
-
- memcpy(p, buttons, nbuttons * sizeof(*p));
-
- pdev = platform_device_alloc("gpio-buttons", id);
- if (!pdev)
- goto err_free_buttons;
-
- memset(&pdata, 0, sizeof(pdata));
- pdata.poll_interval = poll_interval;
- pdata.nbuttons = nbuttons;
- pdata.buttons = p;
-
- err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
- if (err)
- goto err_put_pdev;
-
-
- err = platform_device_add(pdev);
- if (err)
- goto err_put_pdev;
-
- return;
-
-err_put_pdev:
- platform_device_put(pdev);
-
-err_free_buttons:
- kfree(p);
-}
-
void __init ar71xx_add_device_wdt(void)
{
platform_device_register_simple("ar71xx-wdt", -1, NULL, 0);
"\"%s\"\n", mac_str);
}
-static struct resource ar91xx_wmac_resources[] = {
- {
- .start = AR91XX_WMAC_BASE,
- .end = AR91XX_WMAC_BASE + AR91XX_WMAC_SIZE - 1,
- .flags = IORESOURCE_MEM,
- }, {
- .start = AR71XX_CPU_IRQ_WMAC,
- .end = AR71XX_CPU_IRQ_WMAC,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct ath9k_platform_data ar91xx_wmac_data;
-
-static struct platform_device ar91xx_wmac_device = {
- .name = "ath9k",
- .id = -1,
- .resource = ar91xx_wmac_resources,
- .num_resources = ARRAY_SIZE(ar91xx_wmac_resources),
- .dev = {
- .platform_data = &ar91xx_wmac_data,
- },
-};
-
-void __init ar91xx_add_device_wmac(void)
-{
- u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
-
- memcpy(ar91xx_wmac_data.eeprom_data, ee,
- sizeof(ar91xx_wmac_data.eeprom_data));
-
- ar71xx_device_stop(RESET_MODULE_AMBA2WMAC);
- mdelay(10);
-
- ar71xx_device_start(RESET_MODULE_AMBA2WMAC);
- mdelay(10);
-
- platform_device_register(&ar91xx_wmac_device);
-}
-
static struct platform_device ar71xx_dsa_switch_device = {
.name = "dsa",
.id = 0,