Skip to content

Commit

Permalink
add gpio control for LAN port, this is useful when changing LAN IP
Browse files Browse the repository at this point in the history
  • Loading branch information
alzhao committed Mar 22, 2017
1 parent adac177 commit 0c3ec00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions patches/103-gl-usb.patch
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
CONFIG_ATH79_MACH_HIWIFI_HC6361=y
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-usb.c
@@ -0,0 +1,94 @@
@@ -0,0 +1,101 @@
+/*
+ * GL USB nano router support
+ *
Expand All @@ -81,8 +81,9 @@
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define GL_USB_GPIO_LED_WLAN 0
+#define GL_USB_GPIO_LED_WLAN 0
+#define GL_USB_GPIO_LED_LAN 13
+#define GL_USB_GPIO_LAN_RESET 7
+
+#define GL_USB_GPIO_BTN_RESET 11
+
Expand All @@ -105,6 +106,12 @@
+ .active_low = 0,
+ .default_state = 1,
+ },
+ {
+ .name = "gl-usb:resetlan",
+ .gpio = GL_USB_GPIO_LAN_RESET,
+ .active_low = 0,
+ .default_state = 0,
+ },
+};
+
+static struct gpio_keys_button gl_usb_gpio_keys[] __initdata = {
Expand Down
9 changes: 8 additions & 1 deletion target/linux/ar71xx/files/arch/mips/ath79/mach-gl-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
#include "dev-wmac.h"
#include "machtypes.h"

#define GL_USB_GPIO_LED_WLAN 0
#define GL_USB_GPIO_LED_WLAN 0
#define GL_USB_GPIO_LED_LAN 13
#define GL_USB_GPIO_LAN_RESET 7

#define GL_USB_GPIO_BTN_RESET 11

Expand All @@ -47,6 +48,12 @@ static struct gpio_led gl_usb_leds_gpio[] __initdata = {
.active_low = 0,
.default_state = 1,
},
{
.name = "gl-usb:resetlan",
.gpio = GL_USB_GPIO_LAN_RESET,
.active_low = 0,
.default_state = 0,
},
};

static struct gpio_keys_button gl_usb_gpio_keys[] __initdata = {
Expand Down

0 comments on commit 0c3ec00

Please sign in to comment.