ar71xx: Add QCA955X GPIO mux and function definitions
[openwrt.git] / target / linux / ar71xx / patches-4.1 / 604-MIPS-ath79-ap81-fixes.patch
1 --- a/arch/mips/ath79/mach-ap81.c
2 +++ b/arch/mips/ath79/mach-ap81.c
3 @@ -9,12 +9,16 @@
4   *  by the Free Software Foundation.
5   */
6  
7 -#include "machtypes.h"
8 -#include "dev-wmac.h"
9 +#include <linux/mtd/mtd.h>
10 +#include <linux/mtd/partitions.h>
11 +
12 +#include "dev-eth.h"
13  #include "dev-gpio-buttons.h"
14  #include "dev-leds-gpio.h"
15 -#include "dev-spi.h"
16 +#include "dev-m25p80.h"
17  #include "dev-usb.h"
18 +#include "dev-wmac.h"
19 +#include "machtypes.h"
20  
21  #define AP81_GPIO_LED_STATUS   1
22  #define AP81_GPIO_LED_AOSS     3
23 @@ -67,20 +71,6 @@ static struct gpio_keys_button ap81_gpio
24         }
25  };
26  
27 -static struct spi_board_info ap81_spi_info[] = {
28 -       {
29 -               .bus_num        = 0,
30 -               .chip_select    = 0,
31 -               .max_speed_hz   = 25000000,
32 -               .modalias       = "m25p64",
33 -       }
34 -};
35 -
36 -static struct ath79_spi_platform_data ap81_spi_data = {
37 -       .bus_num        = 0,
38 -       .num_chipselect = 1,
39 -};
40 -
41  static void __init ap81_setup(void)
42  {
43         u8 *cal_data = (u8 *) KSEG1ADDR(AP81_CAL_DATA_ADDR);
44 @@ -90,10 +80,24 @@ static void __init ap81_setup(void)
45         ath79_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL,
46                                         ARRAY_SIZE(ap81_gpio_keys),
47                                         ap81_gpio_keys);
48 -       ath79_register_spi(&ap81_spi_data, ap81_spi_info,
49 -                          ARRAY_SIZE(ap81_spi_info));
50 +       ath79_register_m25p80(NULL);
51         ath79_register_wmac(cal_data, NULL);
52         ath79_register_usb();
53 +
54 +       ath79_register_mdio(0, 0x0);
55 +
56 +       ath79_init_mac(ath79_eth0_data.mac_addr, cal_data, 0);
57 +       ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
58 +       ath79_eth0_data.speed = SPEED_100;
59 +       ath79_eth0_data.duplex = DUPLEX_FULL;
60 +       ath79_eth0_data.has_ar8216 = 1;
61 +
62 +       ath79_init_mac(ath79_eth1_data.mac_addr, cal_data, 1);
63 +       ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
64 +       ath79_eth1_data.phy_mask = 0x10;
65 +
66 +       ath79_register_eth(0);
67 +       ath79_register_eth(1);
68  }
69  
70  MIPS_MACHINE(ATH79_MACH_AP81, "AP81", "Atheros AP81 reference board",
71 --- a/arch/mips/ath79/Kconfig
72 +++ b/arch/mips/ath79/Kconfig
73 @@ -30,9 +30,10 @@ config ATH79_MACH_AP136
74  config ATH79_MACH_AP81
75         bool "Atheros AP81 reference board"
76         select SOC_AR913X
77 +       select ATH79_DEV_ETH
78         select ATH79_DEV_GPIO_BUTTONS
79         select ATH79_DEV_LEDS_GPIO
80 -       select ATH79_DEV_SPI
81 +       select ATH79_DEV_M25P80
82         select ATH79_DEV_USB
83         select ATH79_DEV_WMAC
84         help