ar71xx: fix section mismatch in TP-Link Archer C7 v4 support
[openwrt/openwrt.git] / target / linux / ar71xx / files / arch / mips / ath79 / mach-hornet-ub.c
index f8870e711ce0ac1d385626a9567069523f05e9b2..1d2142458563d47ef517aa3c742667232e52d65f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ALFA NETWORKS Hornet-UB board support
+ *  ALFA NETWORK Hornet-UB board support
  *
  *  Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
  *
 #define HORNET_UB_GPIO_LED_LAN         13
 #define HORNET_UB_GPIO_LED_WAN         17
 #define HORNET_UB_GPIO_LED_WPS         27
+#define HORNET_UB_GPIO_EXT_LNA         28
 
-#define HORNET_UB_GPIO_BTN_RESET       11
-#define HORNET_UB_GPIO_BTN_WPS         12
+#define HORNET_UB_GPIO_BTN_RESET       12
+#define HORNET_UB_GPIO_BTN_WPS         11
 
 #define HORNET_UB_GPIO_USB_POWER       26
 
@@ -75,7 +76,7 @@ static struct gpio_keys_button hornet_ub_gpio_keys[] __initdata = {
                .code           = KEY_WPS_BUTTON,
                .debounce_interval = HORNET_UB_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = HORNET_UB_GPIO_BTN_WPS,
-               .active_low     = 1,
+               .active_low     = 0,
        },
        {
                .desc           = "Reset button",
@@ -83,7 +84,7 @@ static struct gpio_keys_button hornet_ub_gpio_keys[] __initdata = {
                .code           = KEY_RESTART,
                .debounce_interval = HORNET_UB_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = HORNET_UB_GPIO_BTN_RESET,
-               .active_low     = 0,
+               .active_low     = 1,
        }
 };
 
@@ -101,8 +102,13 @@ static void __init hornet_ub_gpio_setup(void)
        t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
        ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);
 
-       ath79_set_usb_power_gpio(HORNET_UB_GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH,
-                               "USB power");
+       gpio_request_one(HORNET_UB_GPIO_USB_POWER,
+                        GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+                        "USB power");
+       gpio_request_one(HORNET_UB_GPIO_EXT_LNA,
+                       GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+                       "external LNA0");
+
 }
 
 static void __init hornet_ub_setup(void)
@@ -132,5 +138,5 @@ static void __init hornet_ub_setup(void)
        ath79_register_usb();
 }
 
-MIPS_MACHINE(ATH79_MACH_HORNET_UB, "HORNET-UB", "ALFA NETWORKS Hornet-UB",
+MIPS_MACHINE(ATH79_MACH_HORNET_UB, "HORNET-UB", "ALFA NETWORK Hornet-UB",
             hornet_ub_setup);