Index: /src/linux/universal/linux-3.2/arch/mips/lantiq/Makefile
===================================================================
--- /src/linux/universal/linux-3.2/arch/mips/lantiq/Makefile	(revision 18277)
+++ /src/linux/universal/linux-3.2/arch/mips/lantiq/Makefile	(revision 18278)
@@ -5,5 +5,5 @@
 # by the Free Software Foundation.
 
-obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o proc_lantiqgpio.o
+obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o proc_lantiqgpio.o proc_lantiqgpiostp.o
 
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Index: /src/linux/universal/linux-3.2/arch/mips/lantiq/proc_lantiqgpio.c
===================================================================
--- /src/linux/universal/linux-3.2/arch/mips/lantiq/proc_lantiqgpio.c	(revision 18277)
+++ /src/linux/universal/linux-3.2/arch/mips/lantiq/proc_lantiqgpio.c	(revision 18278)
@@ -57,5 +57,5 @@
 {
 	void __iomem *membase = (void *)KSEG1ADDR(LQ_GPIO0_BASE_ADDR);
-    		
+
 	if (pin >= PINS_PER_PORT) {
 		pin -= PINS_PER_PORT;
@@ -134,4 +134,5 @@
 	return lq_gpio_getbit(membase, LQ_GPIO_OUT, pin);
 }
+
 static void set_dir(int pin, int dir)
 {
@@ -149,51 +150,66 @@
 		membase += LQ_GPIO_SIZE;
 	}
-if (dir)
-{
-	lq_gpio_setbit(membase, LQ_GPIO_OD, pin);
-	lq_gpio_setbit(membase, LQ_GPIO_DIR, pin);
-}
-else
-{
-	lq_gpio_clearbit(membase, LQ_GPIO_OD, pin);
-	lq_gpio_clearbit(membase, LQ_GPIO_DIR, pin);
-}
-
-}
-
-void set_gpio(int pin,int val)
-{
-	if (pin>=200)
-	{
-		ltq_stp_set(NULL,pin-200,val);
+	if (dir) {
+		lq_gpio_setbit(membase, LQ_GPIO_OD, pin);
+		lq_gpio_setbit(membase, LQ_GPIO_DIR, pin);
+	} else {
+		lq_gpio_clearbit(membase, LQ_GPIO_OD, pin);
+		lq_gpio_clearbit(membase, LQ_GPIO_DIR, pin);
+	}
+
+}
+
+
+void set_gpio(int pin, int val)
+{
+	if (pin >= 200) {
+		ltq_stp_set(NULL, pin - 200, val);
 		return;
 	}
-set_dir(pin,1);
-set_gpio_out(pin,val);
-}
+	set_dir(pin, 1);
+	set_gpio_out(pin, val);
+}
+
 EXPORT_SYMBOL(set_gpio);
 
+int usb_led_pin = -1;
+
+void ap_usb_led_on(void)
+{
+	if (usb_led_pin >= 0)
+		set_gpio(usb_led_pin, usb_led_pin & 0xf00 ? 0 : 1);
+}
+
+EXPORT_SYMBOL(ap_usb_led_on);
+
+void ap_usb_led_off(void)
+{
+	if (usb_led_pin >= 0)
+		set_gpio(usb_led_pin, usb_led_pin & 0xf00 ? 1 : 0);
+}
+
+EXPORT_SYMBOL(ap_usb_led_off);
 
 static int get_dir(int pin)
 {
 	void __iomem *membase = (void *)KSEG1ADDR(LQ_GPIO0_BASE_ADDR);
-	int val=0;
-	if (pin >= PINS_PER_PORT) {
-		pin -= PINS_PER_PORT;
-		membase += LQ_GPIO_SIZE;
-	}
-	if (pin >= PINS_PER_PORT) {
-		pin -= PINS_PER_PORT;
-		membase += LQ_GPIO_SIZE;
-	}
-	if (pin >= PINS_PER_PORT) {
-		pin -= PINS_PER_PORT;
-		membase += LQ_GPIO_SIZE;
-
-	}
-
-val|=lq_gpio_getbit(membase, LQ_GPIO_IN, pin);
-val|=lq_gpio_getbit(membase, LQ_GPIO_OD, pin);
-return val;
+	int val = 0;
+	if (pin >= PINS_PER_PORT) {
+		pin -= PINS_PER_PORT;
+		membase += LQ_GPIO_SIZE;
+	}
+	if (pin >= PINS_PER_PORT) {
+		pin -= PINS_PER_PORT;
+		membase += LQ_GPIO_SIZE;
+	}
+	if (pin >= PINS_PER_PORT) {
+		pin -= PINS_PER_PORT;
+		membase += LQ_GPIO_SIZE;
+
+	}
+
+	val |= lq_gpio_getbit(membase, LQ_GPIO_IN, pin);
+	val |= lq_gpio_getbit(membase, LQ_GPIO_OD, pin);
+	return val;
 
 }
@@ -217,11 +233,11 @@
 	u32 reg = 0;
 	if ((unsigned int)data & GPIO_IN) {
-	    reg = get_gpio_in(((unsigned int)data)&PIN_MASK);
+		reg = get_gpio_in(((unsigned int)data) & PIN_MASK);
 	}
 	if ((unsigned int)data & GPIO_OUT) {
-	    reg = get_gpio_out(((unsigned int)data)&PIN_MASK);
+		reg = get_gpio_out(((unsigned int)data) & PIN_MASK);
 	}
 	if ((unsigned int)data & GPIO_DIR) {
-	    reg = get_dir(((unsigned int)data)&PIN_MASK);
+		reg = get_dir(((unsigned int)data) & PIN_MASK);
 	}
 
@@ -262,13 +278,12 @@
 
 	if ((unsigned int)data & GPIO_IN) {
-		set_gpio_in(((unsigned int)data)&PIN_MASK, reg);
+		set_gpio_in(((unsigned int)data) & PIN_MASK, reg);
 	}
 	if ((unsigned int)data & GPIO_OUT) {
-		set_gpio_out(((unsigned int)data)&PIN_MASK, reg);
+		set_gpio_out(((unsigned int)data) & PIN_MASK, reg);
 	}
 	if ((unsigned int)data & GPIO_DIR) {
-		set_dir(((unsigned int)data)&PIN_MASK, reg);
-	}
-
+		set_dir(((unsigned int)data) & PIN_MASK, reg);
+	}
 
 	return procfs_buffer_size;
Index: /src/linux/universal/linux-3.2/arch/mips/lantiq/proc_lantiqgpiostp.c
===================================================================
--- /src/linux/universal/linux-3.2/arch/mips/lantiq/proc_lantiqgpiostp.c	(revision 18278)
+++ /src/linux/universal/linux-3.2/arch/mips/lantiq/proc_lantiqgpiostp.c	(revision 18278)
@@ -0,0 +1,207 @@
+/*
+ * proc_gpio: AR5315 GPIO pins in /proc/gpio/
+ * by olg 
+ * modification for Danube support by Sebastian Gottschall <s.gottschall@newmedia-net.de>
+ * GPL'ed
+ * some code stolen from Yoshinori Sato <ysato@users.sourceforge.jp>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/stddef.h>
+#include <linux/proc_fs.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/fs.h>
+#include <linux/gpio.h>
+#include <asm/uaccess.h>	/* for copy_from_user */
+#include <lantiq.h>
+
+#define MAXGPIO 24
+
+#define GPIO_IN (1<<6)
+#define GPIO_OUT (1<<7)
+#define GPIO_DIR (1<<8)
+#define PIN_MASK 0x3f
+
+extern void ltq_stp_set(struct gpio_chip *chip, unsigned offset, int value);
+
+static void set_gpio_out(int pin, int val)
+{
+	ltq_stp_set(NULL, pin, val);
+}
+
+static void set_gpio_in(int pin, int val)
+{
+	ltq_stp_set(NULL, pin, val);
+}
+
+static int get_gpio_in(int pin)
+{
+	return 0;
+}
+
+static int get_gpio_out(int pin)
+{
+	return 0;
+}
+
+static void set_dir(int pin, int dir)
+{
+
+}
+
+static int get_dir(int pin)
+{
+	return 0;
+
+}
+
+#define PROCFS_MAX_SIZE 64
+extern const char *get_arch_type(void);
+static struct proc_dir_entry *proc_gpio, *gpio_dir;
+
+//Masks for data exchange through "void *data" pointer
+
+static void cleanup_proc(void);
+
+//The buffer used to store the data returned by the proc file
+static char procfs_buffer[PROCFS_MAX_SIZE];
+static unsigned long procfs_buffer_size = 0;
+
+static int
+gpio_proc_read(char *buf, char **start, off_t offset,
+	       int len, int *eof, void *data)
+{
+	u32 reg = 0;
+	if ((unsigned int)data & GPIO_IN) {
+		reg = get_gpio_in(((unsigned int)data) & PIN_MASK);
+	}
+	if ((unsigned int)data & GPIO_OUT) {
+		reg = get_gpio_out(((unsigned int)data) & PIN_MASK);
+	}
+	if ((unsigned int)data & GPIO_DIR) {
+		reg = get_dir(((unsigned int)data) & PIN_MASK);
+	}
+
+	if (reg)
+		buf[0] = '1';
+	else
+		buf[0] = '0';
+	buf[1] = 0;
+
+	*eof = 1;
+
+	return (2);
+
+}
+
+static int
+gpio_proc_write(struct file *file, const char *buffer, unsigned long count,
+		void *data)
+{
+	u32 reg = 0;
+
+	/* get buffer size */
+	procfs_buffer_size = count;
+	if (procfs_buffer_size > PROCFS_MAX_SIZE) {
+		procfs_buffer_size = PROCFS_MAX_SIZE;
+	}
+	/* write data to the buffer */
+	if (copy_from_user(procfs_buffer, buffer, procfs_buffer_size)) {
+		return -EFAULT;
+	}
+
+	procfs_buffer[procfs_buffer_size] = 0;
+
+	if (procfs_buffer[0] == '0' || procfs_buffer[0] == 'i')
+		reg = 0;
+	if (procfs_buffer[0] == '1' || procfs_buffer[0] == 'o')
+		reg = 1;
+
+	if ((unsigned int)data & GPIO_IN) {
+		set_gpio_in(((unsigned int)data) & PIN_MASK, reg);
+	}
+	if ((unsigned int)data & GPIO_OUT) {
+		set_gpio_out(((unsigned int)data) & PIN_MASK, reg);
+	}
+	if ((unsigned int)data & GPIO_DIR) {
+		set_dir(((unsigned int)data) & PIN_MASK, reg);
+	}
+
+	return procfs_buffer_size;
+}
+
+static __init int register_proc(void)
+{
+	unsigned char i;
+	unsigned int flag = 0;
+	char proc_name[64];
+	int gpiocount = MAXGPIO;
+
+	/* create directory gpio */
+	gpio_dir = proc_mkdir("gpiostp", NULL);
+	if (gpio_dir == NULL)
+		goto fault;
+
+	for (i = 0; i < gpiocount * 3; i++)	//create for every GPIO "x_in"," x_out" and "x_dir"
+	{
+		if (i / gpiocount == 0) {
+			flag = GPIO_IN;
+			sprintf(proc_name, "%i_in", i);
+		}
+		if (i / gpiocount == 1) {
+			flag = GPIO_OUT;
+			sprintf(proc_name, "%i_out", i % gpiocount);
+		}
+		if (i / gpiocount == 2) {
+			flag = GPIO_DIR;
+			sprintf(proc_name, "%i_dir", i % gpiocount);
+		}
+
+		proc_gpio = create_proc_entry(proc_name, S_IRUGO, gpio_dir);
+		if (proc_gpio) {
+			proc_gpio->read_proc = gpio_proc_read;
+			proc_gpio->write_proc = gpio_proc_write;
+			//proc_gpio->owner = THIS_MODULE;
+			proc_gpio->data = (void *)((i % gpiocount) | flag);
+		} else
+			goto fault;
+
+	}
+
+	printk(KERN_NOTICE
+	       "gpio_proc: module loaded and /proc/gpio/ created\n");
+	return 0;
+
+fault:
+	cleanup_proc();
+	return -EFAULT;
+}
+
+static void cleanup_proc(void)
+{
+	unsigned char i;
+	char proc_name[64];
+	int gpiocount = MAXGPIO;
+
+	for (i = 0; i < gpiocount; i++) {
+		sprintf(proc_name, "%i_out", i);
+		remove_proc_entry(proc_name, gpio_dir);
+	}
+	remove_proc_entry("gpiostp", NULL);
+	printk(KERN_INFO "gpio_proc: unloaded and /proc/gpio/ removed\n");
+
+}
+
+module_init(register_proc);
+module_exit(cleanup_proc);
+
+MODULE_AUTHOR("Sebastian Gottschall");
+MODULE_DESCRIPTION("Danube STP GPIO pins in /proc/gpiostp/");
+MODULE_LICENSE("GPL");
Index: /src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-gigasx76x.c
===================================================================
--- /src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-gigasx76x.c	(revision 18277)
+++ /src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-gigasx76x.c	(revision 18278)
@@ -58,5 +58,5 @@
 	},
 };
-
+extern int usb_led_pin;
 static struct gpio_led
 gigasx76x_gpio_leds[] __initdata = {
@@ -231,4 +231,5 @@
 #define GIGASX76X_USB		29
 #define GIGASX76X_MADWIFI_ADDR	0xb07f0000
+	usb_led_pin = 218;
 	ltq_register_gpio_stp();
 	ltq_register_nor(&gigasx76x_flash_data);
Index: /src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-wbmr.c
===================================================================
--- /src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-wbmr.c	(revision 18277)
+++ /src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-wbmr.c	(revision 18278)
@@ -55,4 +55,5 @@
 };
 
+extern int usb_led_pin;
 static struct gpio_led
 wbmr_gpio_leds[] __initdata = {
@@ -104,4 +105,5 @@
 {
 #define WMBR_BRN_MAC			0x1fd0024
+	usb_led_pin = 28|0xf00;
 
 	ltq_add_device_gpio_leds(-1, ARRAY_SIZE(wbmr_gpio_leds), wbmr_gpio_leds);
Index: /src/linux/universal/linux-3.2/drivers/usb/core/hub.c
===================================================================
--- /src/linux/universal/linux-3.2/drivers/usb/core/hub.c	(revision 18277)
+++ /src/linux/universal/linux-3.2/drivers/usb/core/hub.c	(revision 18278)
@@ -1293,5 +1293,5 @@
 	hdev = interface_to_usbdev(intf);
 
-#if defined(CONFIG_MACH_AR7100) || defined(CONFIG_MACH_AR7240)
+#if defined(CONFIG_MACH_AR7100) || defined(CONFIG_MACH_AR7240) || defined(CONFIG_LANTIQ)
 	ap_usb_led_off();
 #endif
@@ -1658,5 +1658,5 @@
 			udev->devnum);
 
-#if defined(CONFIG_MACH_AR7100) || defined(CONFIG_MACH_AR7240)
+#if defined(CONFIG_MACH_AR7100) || defined(CONFIG_MACH_AR7240) || defined(CONFIG_LANTIQ)
         /* Turn USB LED off only if its a last device attached to root hub */
 	if(udev->parent == udev->bus->root_hub)
@@ -2898,5 +2898,5 @@
 
 	retval = -ENODEV;
-#if defined(CONFIG_MACH_AR7100) || defined(CONFIG_MACH_AR7240)
+#if defined(CONFIG_MACH_AR7100) || defined(CONFIG_MACH_AR7240) || defined(CONFIG_LANTIQ)
 	ap_usb_led_on();
 #endif
Index: /src/linux/universal/linux-3.2/drivers/usb/dwc_otg/dwc_otg_hcd.c
===================================================================
--- /src/linux/universal/linux-3.2/drivers/usb/dwc_otg/dwc_otg_hcd.c	(revision 18277)
+++ /src/linux/universal/linux-3.2/drivers/usb/dwc_otg/dwc_otg_hcd.c	(revision 18278)
@@ -1587,4 +1587,6 @@
 }
 #endif /* DWC_HS_ELECT_TST */
+
+
 
 /** Handles hub class-specific requests.*/
