| 1 | --- a/arch/mips/ath79/Kconfig |
| 2 | +++ b/arch/mips/ath79/Kconfig |
| 3 | @@ -57,9 +57,10 @@ config ATH79_MACH_PB44 |
| 4 | config ATH79_MACH_UBNT_XM |
| 5 | bool "Ubiquiti Networks XM (rev 1.0) board" |
| 6 | select SOC_AR724X |
| 7 | + select ATH79_DEV_AP9X_PCI if PCI |
| 8 | select ATH79_DEV_GPIO_BUTTONS |
| 9 | select ATH79_DEV_LEDS_GPIO |
| 10 | - select ATH79_DEV_SPI |
| 11 | + select ATH79_DEV_M25P80 |
| 12 | help |
| 13 | Say 'Y' here if you want your kernel to support the |
| 14 | Ubiquiti Networks XM (rev 1.0) board. |
| 15 | --- a/arch/mips/ath79/mach-ubnt-xm.c |
| 16 | +++ b/arch/mips/ath79/mach-ubnt-xm.c |
| 17 | @@ -16,10 +16,11 @@ |
| 18 | |
| 19 | #include <asm/mach-ath79/irq.h> |
| 20 | |
| 21 | -#include "machtypes.h" |
| 22 | +#include "dev-ap9x-pci.h" |
| 23 | #include "dev-gpio-buttons.h" |
| 24 | #include "dev-leds-gpio.h" |
| 25 | -#include "dev-spi.h" |
| 26 | +#include "dev-m25p80.h" |
| 27 | +#include "machtypes.h" |
| 28 | #include "pci.h" |
| 29 | |
| 30 | #define UBNT_XM_GPIO_LED_L1 0 |
| 31 | @@ -32,7 +33,7 @@ |
| 32 | #define UBNT_XM_KEYS_POLL_INTERVAL 20 |
| 33 | #define UBNT_XM_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_XM_KEYS_POLL_INTERVAL) |
| 34 | |
| 35 | -#define UBNT_XM_EEPROM_ADDR (u8 *) KSEG1ADDR(0x1fff1000) |
| 36 | +#define UBNT_XM_EEPROM_ADDR 0x1fff1000 |
| 37 | |
| 38 | static struct gpio_led ubnt_xm_leds_gpio[] __initdata = { |
| 39 | { |
| 40 | @@ -65,54 +66,10 @@ static struct gpio_keys_button ubnt_xm_g |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | -static struct ath79_spi_controller_data ubnt_xm_spi0_data = { |
| 45 | - .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, |
| 46 | - .cs_line = 0, |
| 47 | -}; |
| 48 | - |
| 49 | -static struct spi_board_info ubnt_xm_spi_info[] = { |
| 50 | - { |
| 51 | - .bus_num = 0, |
| 52 | - .chip_select = 0, |
| 53 | - .max_speed_hz = 25000000, |
| 54 | - .modalias = "mx25l6405d", |
| 55 | - .controller_data = &ubnt_xm_spi0_data, |
| 56 | - } |
| 57 | -}; |
| 58 | - |
| 59 | -static struct ath79_spi_platform_data ubnt_xm_spi_data = { |
| 60 | - .bus_num = 0, |
| 61 | - .num_chipselect = 1, |
| 62 | -}; |
| 63 | - |
| 64 | -#ifdef CONFIG_PCI |
| 65 | -static struct ath9k_platform_data ubnt_xm_eeprom_data; |
| 66 | - |
| 67 | -static int ubnt_xm_pci_plat_dev_init(struct pci_dev *dev) |
| 68 | -{ |
| 69 | - switch (PCI_SLOT(dev->devfn)) { |
| 70 | - case 0: |
| 71 | - dev->dev.platform_data = &ubnt_xm_eeprom_data; |
| 72 | - break; |
| 73 | - } |
| 74 | - |
| 75 | - return 0; |
| 76 | -} |
| 77 | - |
| 78 | -static void __init ubnt_xm_pci_init(void) |
| 79 | -{ |
| 80 | - memcpy(ubnt_xm_eeprom_data.eeprom_data, UBNT_XM_EEPROM_ADDR, |
| 81 | - sizeof(ubnt_xm_eeprom_data.eeprom_data)); |
| 82 | - |
| 83 | - ath79_pci_set_plat_dev_init(ubnt_xm_pci_plat_dev_init); |
| 84 | - ath79_register_pci(); |
| 85 | -} |
| 86 | -#else |
| 87 | -static inline void ubnt_xm_pci_init(void) {} |
| 88 | -#endif /* CONFIG_PCI */ |
| 89 | - |
| 90 | static void __init ubnt_xm_init(void) |
| 91 | { |
| 92 | + u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR); |
| 93 | + |
| 94 | ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio), |
| 95 | ubnt_xm_leds_gpio); |
| 96 | |
| 97 | @@ -120,10 +77,8 @@ static void __init ubnt_xm_init(void) |
| 98 | ARRAY_SIZE(ubnt_xm_gpio_keys), |
| 99 | ubnt_xm_gpio_keys); |
| 100 | |
| 101 | - ath79_register_spi(&ubnt_xm_spi_data, ubnt_xm_spi_info, |
| 102 | - ARRAY_SIZE(ubnt_xm_spi_info)); |
| 103 | - |
| 104 | - ubnt_xm_pci_init(); |
| 105 | + ath79_register_m25p80(NULL); |
| 106 | + ap91_pci_init(eeprom, NULL); |
| 107 | } |
| 108 | |
| 109 | MIPS_MACHINE(ATH79_MACH_UBNT_XM, |
| 110 | |