Path: blob/master/arch/mips/ath79/dev-ar913x-wmac.c
10818 views
/*1* Atheros AR913X SoC built-in WMAC device support2*3* Copyright (C) 2008-2010 Gabor Juhos <[email protected]>4* Copyright (C) 2008 Imre Kaloz <[email protected]>5*6* This program is free software; you can redistribute it and/or modify it7* under the terms of the GNU General Public License version 2 as published8* by the Free Software Foundation.9*/1011#include <linux/init.h>12#include <linux/delay.h>13#include <linux/irq.h>14#include <linux/platform_device.h>15#include <linux/ath9k_platform.h>1617#include <asm/mach-ath79/ath79.h>18#include <asm/mach-ath79/ar71xx_regs.h>19#include "dev-ar913x-wmac.h"2021static struct ath9k_platform_data ar913x_wmac_data;2223static struct resource ar913x_wmac_resources[] = {24{25.start = AR913X_WMAC_BASE,26.end = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1,27.flags = IORESOURCE_MEM,28}, {29.start = ATH79_CPU_IRQ_IP2,30.end = ATH79_CPU_IRQ_IP2,31.flags = IORESOURCE_IRQ,32},33};3435static struct platform_device ar913x_wmac_device = {36.name = "ath9k",37.id = -1,38.resource = ar913x_wmac_resources,39.num_resources = ARRAY_SIZE(ar913x_wmac_resources),40.dev = {41.platform_data = &ar913x_wmac_data,42},43};4445void __init ath79_register_ar913x_wmac(u8 *cal_data)46{47if (cal_data)48memcpy(ar913x_wmac_data.eeprom_data, cal_data,49sizeof(ar913x_wmac_data.eeprom_data));5051/* reset the WMAC */52ath79_device_reset_set(AR913X_RESET_AMBA2WMAC);53mdelay(10);5455ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC);56mdelay(10);5758platform_device_register(&ar913x_wmac_device);59}606162