[generic/3.9]: refresh patches against -rc4
[openwrt.git] / target / linux / gemini / patches-3.8 / 124-arm-gemini-rut100-register-ethernet.patch
1 --- a/arch/arm/mach-gemini/board-rut1xx.c
2 +++ b/arch/arm/mach-gemini/board-rut1xx.c
3 @@ -15,13 +15,35 @@
4  #include <linux/input.h>
5  #include <linux/gpio_keys.h>
6  #include <linux/sizes.h>
7 +#include <linux/mdio-gpio.h>
8  
9  #include <asm/mach-types.h>
10  #include <asm/mach/arch.h>
11  #include <asm/mach/time.h>
12  
13 +#include <mach/gmac.h>
14 +
15  #include "common.h"
16  
17 +static struct mdio_gpio_platform_data rut1xx_mdio = {
18 +       .mdc            = 22,
19 +       .mdio           = 21,
20 +       .phy_mask       = ~(1 << 1),
21 +};
22 +
23 +static struct platform_device rut1xx_phy_device = {
24 +       .name   = "mdio-gpio",
25 +       .id     = 0,
26 +       .dev    = {
27 +               .platform_data = &rut1xx_mdio,
28 +       },
29 +};
30 +
31 +static struct gemini_gmac_platform_data gmac_data = {
32 +       .bus_id[0] = "gpio-0:01",
33 +       .interface[0] = PHY_INTERFACE_MODE_MII,
34 +};
35 +
36  static struct gpio_keys_button rut1xx_keys[] = {
37         {
38                 .code           = KEY_SETUP,
39 @@ -85,6 +107,8 @@ static void __init rut1xx_init(void)
40         platform_device_register(&rut1xx_keys_device);
41         platform_register_rtc();
42         platform_register_watchdog();
43 +       platform_device_register(&rut1xx_phy_device);
44 +       platform_register_ethernet(&gmac_data);
45  }
46  
47  MACHINE_START(RUT100, "Teltonika RUT100")