source: trunk/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.c @ 23822

Last change on this file since 23822 was 23822, checked in by nbd, 6 years ago

ar71xx: improve the wndr3700 quirks - move most of the code out of ath9k and instead allow the platform device to specify gpio overrides - fixes 5ghz signal strength issues

File size: 1.3 KB
Line 
1/*
2 *  Atheros AP91 reference board PCI initialization
3 *
4 *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
5 *
6 *  This program is free software; you can redistribute it and/or modify it
7 *  under the terms of the GNU General Public License version 2 as published
8 *  by the Free Software Foundation.
9 */
10
11#include <linux/pci.h>
12#include <linux/ath9k_platform.h>
13#include <linux/delay.h>
14
15#include <asm/mach-ar71xx/ar71xx.h>
16#include <asm/mach-ar71xx/pci.h>
17
18#include "dev-ap91-pci.h"
19#include "pci-ath9k-fixup.h"
20
21static struct ath9k_platform_data ap91_wmac_data = {
22        .led_pin = -1,
23};
24static char ap91_wmac_mac[6];
25
26static struct ar71xx_pci_irq ap91_pci_irqs[] __initdata = {
27        {
28                .slot   = 0,
29                .pin    = 1,
30                .irq    = AR71XX_PCI_IRQ_DEV0,
31        }
32};
33
34static int ap91_pci_plat_dev_init(struct pci_dev *dev)
35{
36        switch(PCI_SLOT(dev->devfn)) {
37        case 0:
38                dev->dev.platform_data = &ap91_wmac_data;
39                break;
40        }
41
42        return 0;
43}
44
45void __init ap91_pci_init(u8 *cal_data, u8 *mac_addr)
46{
47        if (cal_data)
48                memcpy(ap91_wmac_data.eeprom_data, cal_data,
49                       sizeof(ap91_wmac_data.eeprom_data));
50
51        if (mac_addr) {
52                memcpy(ap91_wmac_mac, mac_addr, sizeof(ap91_wmac_mac));
53                ap91_wmac_data.macaddr = ap91_wmac_mac;
54        }
55
56        ar71xx_pci_plat_dev_init = ap91_pci_plat_dev_init;
57        ar71xx_pci_init(ARRAY_SIZE(ap91_pci_irqs), ap91_pci_irqs);
58
59        pci_enable_ath9k_fixup(0, ap91_wmac_data.eeprom_data);
60}
Note: See TracBrowser for help on using the repository browser.