summaryrefslogtreecommitdiff
path: root/target/linux/adm5120
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-04-29 07:36:43 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-04-29 07:36:43 +0000
commite96d52d198511789d66d8fb7bd9a0f3c3c9c0107 (patch)
treea91c5c6dbd1ccf52974ba5063918e1c171ebeb1a /target/linux/adm5120
parent19be4923e0a2dfa6dd173288fc0ead976a0f2b38 (diff)
downloadmtk-20170518-e96d52d198511789d66d8fb7bd9a0f3c3c9c0107.zip
mtk-20170518-e96d52d198511789d66d8fb7bd9a0f3c3c9c0107.tar.gz
mtk-20170518-e96d52d198511789d66d8fb7bd9a0f3c3c9c0107.tar.bz2
adm5120: merge 3.3 patches
SVN-Revision: 31511
Diffstat (limited to 'target/linux/adm5120')
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/Platform19
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/cellvision/cellvision.c6
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/common/clock.c2
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/common/irq.c34
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/common/platform.c52
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/compex/wp54.c18
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/edimax/br-61xx.c19
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c18
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/infineon/infineon.c6
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.c20
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.h2
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/motorola/pmugw.c4
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/osbridge/5gxi.c4
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-33x.c4
-rw-r--r--target/linux/adm5120/files/arch/mips/include/asm/mach-adm5120/adm5120_platform.h11
-rw-r--r--target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c2
-rw-r--r--target/linux/adm5120/files/drivers/ata/pata_rb153_cf.c7
-rw-r--r--target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c107
-rw-r--r--target/linux/adm5120/files/drivers/mtd/trxsplit.c4
-rw-r--r--target/linux/adm5120/files/drivers/net/adm5120sw.c19
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120-dbg.c38
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120-drv.c13
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120-hcd.c67
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120-hub.c19
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120-pm.c4
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120-q.c22
-rw-r--r--target/linux/adm5120/files/drivers/usb/host/adm5120.h9
-rw-r--r--target/linux/adm5120/files/drivers/watchdog/adm5120_wdt.c5
-rw-r--r--target/linux/adm5120/patches-3.3/a00-adm5120-add-Platform-file.patch22
-rw-r--r--target/linux/adm5120/patches-3.3/a01-adm5120-core-build-error-fixes.patch110
-rw-r--r--target/linux/adm5120/patches-3.3/a03-adm5120-remove-CONFIG_MTD_PARTITIONS.patch306
-rw-r--r--target/linux/adm5120/patches-3.3/a04-use-gpio-keys-polled-driver.patch263
-rw-r--r--target/linux/adm5120/patches-3.3/a10-pata-rb150-cf-3.3-fix.patch33
-rw-r--r--target/linux/adm5120/patches-3.3/a11-adm5120_wdt-3.3-fixes.patch21
-rw-r--r--target/linux/adm5120/patches-3.3/a12-adm5120sw-3.3-fixes.patch84
-rw-r--r--target/linux/adm5120/patches-3.3/a13-adm5120_flash-3.3-fixes.patch166
-rw-r--r--target/linux/adm5120/patches-3.3/a14-mtd-trxsplit-fixes.patch20
-rw-r--r--target/linux/adm5120/patches-3.3/a15-adm5120-usb-driver-cleanup.patch582
38 files changed, 223 insertions, 1919 deletions
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/Platform b/target/linux/adm5120/files/arch/mips/adm5120/Platform
new file mode 100644
index 0000000..0c9edf2
--- /dev/null
+++ b/target/linux/adm5120/files/arch/mips/adm5120/Platform
@@ -0,0 +1,19 @@
+#
+# Infineon/ADMtek ADM5120
+#
+
+platform-$(CONFIG_ADM5120) += adm5120/common/
+
+platform-$(CONFIG_ADM5120_OEM_CELLVISION) += adm5120/cellvision/
+platform-$(CONFIG_ADM5120_OEM_COMPEX) += adm5120/compex/
+platform-$(CONFIG_ADM5120_OEM_EDIMAX) += adm5120/edimax/
+platform-$(CONFIG_ADM5120_OEM_GENERIC) += adm5120/generic/
+platform-$(CONFIG_ADM5120_OEM_INFINEON) += adm5120/infineon/
+platform-$(CONFIG_ADM5120_OEM_MIKROTIK) += adm5120/mikrotik/
+platform-$(CONFIG_ADM5120_OEM_MOTOROLA) += adm5120/motorola/
+platform-$(CONFIG_ADM5120_OEM_OSBRIDGE) += adm5120/osbridge/
+platform-$(CONFIG_ADM5120_OEM_ZYXEL) += adm5120/zyxel/
+
+cflags-$(CONFIG_ADM5120) += -I$(srctree)/arch/mips/include/asm/mach-adm5120
+libs-$(CONFIG_ADM5120) += arch/mips/adm5120/prom/
+load-$(CONFIG_ADM5120) += 0xffffffff80001000
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/cellvision/cellvision.c b/target/linux/adm5120/files/arch/mips/adm5120/cellvision/cellvision.c
index eceef13..a7cedf0 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/cellvision/cellvision.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/cellvision/cellvision.c
@@ -19,7 +19,6 @@
#define CELLVISION_CONFIG_OFFSET 0x8000
#define CELLVISION_CONFIG_SIZE 0x1000
-#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition cas6xx_partitions[] = {
{
.name = "admboot",
@@ -65,7 +64,6 @@ static struct mtd_partition cas7xx_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static void switch_bank_gpio5(unsigned bank)
{
@@ -105,20 +103,16 @@ void __init cellvision_mac_setup(void)
void __init cas6xx_flash_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
adm5120_flash0_data.parts = cas6xx_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
cellvision_flash_setup();
}
void __init cas7xx_flash_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas7xx_partitions);
adm5120_flash0_data.parts = cas7xx_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
cellvision_flash_setup();
}
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/common/clock.c b/target/linux/adm5120/files/arch/mips/adm5120/common/clock.c
index 1ada60f..52ae64c 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/common/clock.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/common/clock.c
@@ -33,7 +33,7 @@ static struct clk uart_clk = {
struct clk *clk_get(struct device *dev, const char *id)
{
- char *name = dev_name(dev);
+ const char *name = dev_name(dev);
if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1"))
return &uart_clk;
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/common/irq.c b/target/linux/adm5120/files/arch/mips/adm5120/common/irq.c
index 9a259b2..a26e651 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/common/irq.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/common/irq.c
@@ -23,9 +23,9 @@
#include <asm/mach-adm5120/adm5120_defs.h>
-static void adm5120_intc_irq_unmask(unsigned int irq);
-static void adm5120_intc_irq_mask(unsigned int irq);
-static int adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type);
+static void adm5120_intc_irq_unmask(struct irq_data *d);
+static void adm5120_intc_irq_mask(struct irq_data *d);
+static int adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type);
static inline void intc_write_reg(unsigned int reg, u32 val)
{
@@ -43,10 +43,10 @@ static inline u32 intc_read_reg(unsigned int reg)
static struct irq_chip adm5120_intc_irq_chip = {
.name = "INTC",
- .unmask = adm5120_intc_irq_unmask,
- .mask = adm5120_intc_irq_mask,
- .mask_ack = adm5120_intc_irq_mask,
- .set_type = adm5120_intc_irq_set_type
+ .irq_unmask = adm5120_intc_irq_unmask,
+ .irq_mask = adm5120_intc_irq_mask,
+ .irq_mask_ack = adm5120_intc_irq_mask,
+ .irq_set_type = adm5120_intc_irq_set_type
};
static struct irqaction adm5120_intc_irq_action = {
@@ -54,20 +54,19 @@ static struct irqaction adm5120_intc_irq_action = {
.name = "cascade [INTC]"
};
-static void adm5120_intc_irq_unmask(unsigned int irq)
+static void adm5120_intc_irq_unmask(struct irq_data *d)
{
- irq -= ADM5120_INTC_IRQ_BASE;
- intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << irq);
+ intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE));
}
-static void adm5120_intc_irq_mask(unsigned int irq)
+static void adm5120_intc_irq_mask(struct irq_data *d)
{
- irq -= ADM5120_INTC_IRQ_BASE;
- intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << irq);
+ intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE));
}
-static int adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type)
+static int adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type)
{
+ unsigned int irq = d->irq;
unsigned int sense;
unsigned long mode;
int err = 0;
@@ -105,10 +104,6 @@ static int adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type)
mode &= ~(1 << (irq - ADM5120_INTC_IRQ_BASE));
intc_write_reg(INTC_REG_INT_MODE, mode);
- /* fallthrough */
- default:
- irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
- irq_desc[irq].status |= sense;
break;
}
@@ -162,8 +157,7 @@ static void __init adm5120_intc_irq_init(void)
for (i = ADM5120_INTC_IRQ_BASE;
i <= ADM5120_INTC_IRQ_BASE + INTC_IRQ_LAST;
i++) {
- irq_desc[i].status = INTC_IRQ_STATUS;
- set_irq_chip_and_handler(i, &adm5120_intc_irq_chip,
+ irq_set_chip_and_handler(i, &adm5120_intc_irq_chip,
handle_level_irq);
}
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/common/platform.c b/target/linux/adm5120/files/arch/mips/adm5120/common/platform.c
index de76109..809d77b 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/common/platform.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/common/platform.c
@@ -18,6 +18,7 @@
#include <linux/gpio.h>
#include <linux/irq.h>
#include <linux/slab.h>
+#include <linux/export.h>
#include <asm/bootinfo.h>
@@ -244,31 +245,44 @@ void __init adm5120_add_device_uart(unsigned id)
/*
* GPIO buttons
*/
-#define ADM5120_BUTTON_INTERVAL 20
-struct gpio_buttons_platform_data adm5120_gpio_buttons_data = {
- .poll_interval = ADM5120_BUTTON_INTERVAL,
-};
-
-struct platform_device adm5120_gpio_buttons_device = {
- .name = "gpio-buttons",
- .id = -1,
- .dev.platform_data = &adm5120_gpio_buttons_data,
-};
-
-void __init adm5120_add_device_gpio_buttons(unsigned nbuttons,
- struct gpio_button *buttons)
+void __init adm5120_register_gpio_buttons(int id,
+ unsigned poll_interval,
+ unsigned nbuttons,
+ struct gpio_keys_button *buttons)
{
- struct gpio_button *p;
+ struct platform_device *pdev;
+ struct gpio_keys_platform_data pdata;
+ struct gpio_keys_button *p;
+ int err;
- p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
+ p = kmemdup(buttons, nbuttons * sizeof(*p), GFP_KERNEL);
if (!p)
return;
- memcpy(p, buttons, nbuttons * sizeof(*p));
- adm5120_gpio_buttons_data.nbuttons = nbuttons;
- adm5120_gpio_buttons_data.buttons = p;
+ pdev = platform_device_alloc("gpio-keys-polled", id);
+ if (!pdev)
+ goto err_free_buttons;
+
+ memset(&pdata, 0, sizeof(pdata));
+ pdata.poll_interval = poll_interval;
+ pdata.nbuttons = nbuttons;
+ pdata.buttons = p;
+
+ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+ if (err)
+ goto err_put_pdev;
+
+ err = platform_device_add(pdev);
+ if (err)
+ goto err_put_pdev;
+
+ return;
+
+err_put_pdev:
+ platform_device_put(pdev);
- platform_device_register(&adm5120_gpio_buttons_device);
+err_free_buttons:
+ kfree(p);
}
/*
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/compex/wp54.c b/target/linux/adm5120/files/arch/mips/adm5120/compex/wp54.c
index ef71302..8aa35c5 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/compex/wp54.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/compex/wp54.c
@@ -11,7 +11,9 @@
#include "compex.h"
-#ifdef CONFIG_MTD_PARTITIONS
+#define WP54_KEYS_POLL_INTERVAL 20
+#define WP54_KEYS_DEBOUNCE_INTERVAL (3 * WP54_KEYS_POLL_INTERVAL)
+
static struct mtd_partition wp54g_wrt_partitions[] = {
{
.name = "cfe",
@@ -28,18 +30,17 @@ static struct mtd_partition wp54g_wrt_partitions[] = {
.size = 0x010000,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static struct adm5120_pci_irq wp54_pci_irqs[] __initdata = {
PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
};
-static struct gpio_button wp54_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wp54_gpio_buttons[] __initdata = {
{
.desc = "reset_button",
.type = EV_KEY,
- .code = BTN_0,
- .threshold = 5,
+ .code = KEY_RESTART,
+ .debounce_interval = WP54_KEYS_DEBOUNCE_INTERVAL,
.gpio = ADM5120_GPIO_PIN4,
}
};
@@ -71,8 +72,9 @@ static void __init wp54_setup(void)
adm5120_board_reset = wp54_reset;
adm5120_add_device_switch(2, wp54_vlans);
- adm5120_add_device_gpio_buttons(ARRAY_SIZE(wp54_gpio_buttons),
- wp54_gpio_buttons);
+ adm5120_register_gpio_buttons(-1, WP54_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wp54_gpio_buttons),
+ wp54_gpio_buttons);
adm5120_add_device_gpio_leds(ARRAY_SIZE(wp54_gpio_leds),
wp54_gpio_leds);
@@ -83,10 +85,8 @@ MIPS_MACHINE(MACH_ADM5120_WP54, "WP54", "Compex WP54 family", wp54_setup);
static void __init wp54_wrt_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(wp54g_wrt_partitions);
adm5120_flash0_data.parts = wp54g_wrt_partitions;
-#endif
wp54_setup();
}
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/edimax/br-61xx.c b/target/linux/adm5120/files/arch/mips/adm5120/edimax/br-61xx.c
index 6ecdb4e..cc64ccb 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/edimax/br-61xx.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/edimax/br-61xx.c
@@ -18,7 +18,9 @@
#define BR61XX_CONFIG_OFFSET 0x8000
#define BR61XX_CONFIG_SIZE 0x1000
-#ifdef CONFIG_MTD_PARTITIONS
+#define BR61XX_KEYS_POLL_INTERVAL 20
+#define BR61XX_KEYS_DEBOUNCE_INTERVAL (3 * BR61XX_KEYS_POLL_INTERVAL)
+
static struct mtd_partition br61xx_partitions[] = {
{
.name = "admboot",
@@ -35,14 +37,13 @@ static struct mtd_partition br61xx_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
-static struct gpio_button br61xx_gpio_buttons[] __initdata = {
+static struct gpio_keys_button br61xx_gpio_buttons[] __initdata = {
{
.desc = "reset_button",
.type = EV_KEY,
- .code = BTN_0,
- .threshold = 5,
+ .code = KEY_RESTART,
+ .debounce_interval = BR61XX_KEYS_DEBOUNCE_INTERVAL,
.gpio = ADM5120_GPIO_PIN2,
}
};
@@ -68,10 +69,8 @@ static void __init br61xx_mac_setup(void)
void __init br61xx_generic_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(br61xx_partitions);
adm5120_flash0_data.parts = br61xx_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_flash(0);
adm5120_add_device_gpio(BR61XX_GPIO_DEV_MASK);
@@ -80,8 +79,10 @@ void __init br61xx_generic_setup(void)
adm5120_add_device_uart(1);
adm5120_add_device_switch(5, br61xx_vlans);
- adm5120_add_device_gpio_buttons(ARRAY_SIZE(br61xx_gpio_buttons),
- br61xx_gpio_buttons);
+
+ adm5120_register_gpio_buttons(-1, BR61XX_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(br61xx_gpio_buttons),
+ br61xx_gpio_buttons);
br61xx_mac_setup();
}
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c b/target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c
index d1d5fa9..c62c147 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c
@@ -28,7 +28,9 @@
#define EB214A_GPIO_DEV_MASK 0
#define EB214A_CONFIG_OFFSET 0x4000
-#ifdef CONFIG_MTD_PARTITIONS
+#define EB214A_KEYS_POLL_INTERVAL 20
+#define EB214A_KEYS_DEBOUNCE_INTERVAL (3 * EB214A_KEYS_POLL_INTERVAL)
+
static struct mtd_partition eb214a_partitions[] = {
{
.name = "bootloader",
@@ -45,7 +47,6 @@ static struct mtd_partition eb214a_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static struct adm5120_pci_irq eb214a_pci_irqs[] __initdata = {
PCIIRQ(4, 0, 1, ADM5120_IRQ_PCI0),
@@ -62,12 +63,12 @@ static struct gpio_led eb214a_gpio_leds[] __initdata = {
GPIO_LED_INV(ADM5120_GPIO_P3L0, "usb4", NULL),
};
-static struct gpio_button eb214a_gpio_buttons[] __initdata = {
+static struct gpio_keys_button eb214a_gpio_buttons[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
- .code = BTN_0,
- .threshold = 5,
+ .code = KEY_RESTART,
+ .debounce_interval = EB214A_KEYS_DEBOUNCE_INTERVAL,
.gpio = ADM5120_GPIO_PIN1,
}
};
@@ -94,10 +95,8 @@ static void __init eb214a_mac_setup(void)
static void __init eb214a_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(eb214a_partitions);
adm5120_flash0_data.parts = eb214a_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_flash(0);
adm5120_add_device_gpio(EB214A_GPIO_DEV_MASK);
@@ -109,8 +108,9 @@ static void __init eb214a_setup(void)
eb214a_mac_setup();
- adm5120_add_device_gpio_buttons(ARRAY_SIZE(eb214a_gpio_buttons),
- eb214a_gpio_buttons);
+ adm5120_register_gpio_buttons(-1, EB214A_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(eb214a_gpio_buttons),
+ eb214a_gpio_buttons);
adm5120_add_device_gpio_leds(ARRAY_SIZE(eb214a_gpio_leds),
eb214a_gpio_leds);
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/infineon/infineon.c b/target/linux/adm5120/files/arch/mips/adm5120/infineon/infineon.c
index b52edf0..5c441da 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/infineon/infineon.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/infineon/infineon.c
@@ -16,7 +16,6 @@
#define EASY_CONFIG_OFFSET 0x10000
#define EASY_CONFIG_SIZE 0x1000
-#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition easy_partitions[] = {
{
.name = "admboot",
@@ -33,7 +32,6 @@ static struct mtd_partition easy_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static __init void easy_setup_mac(void)
{
@@ -68,10 +66,8 @@ void __init easy_setup_pqfp(void)
gpio_direction_output(ADM5120_GPIO_PIN3, 0);
adm5120_flash0_data.switch_bank = switch_bank_gpio3;
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
adm5120_flash0_data.parts = easy_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_uart(0);
adm5120_add_device_uart(1);
@@ -100,10 +96,8 @@ void __init easy_setup_bga(void)
gpio_direction_output(ADM5120_GPIO_PIN5, 0);
adm5120_flash0_data.switch_bank = switch_bank_gpio5;
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
adm5120_flash0_data.parts = easy_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_uart(0);
adm5120_add_device_uart(1);
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.c b/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.c
index 7fc6e74..2ad8c42 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.c
@@ -19,13 +19,15 @@
#define RB1XX_NAND_CHIP_DELAY 25
+#define RB1XX_KEYS_POLL_INTERVAL 20
+#define RB1XX_KEYS_DEBOUNCE_INTERVAL (3 * RB1XX_KEYS_POLL_INTERVAL)
+
static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = {
PCIIRQ(1, 0, 1, ADM5120_IRQ_PCI0),
PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI1),
PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI2)
};
-#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition rb1xx_nor_parts[] = {
{
.name = "booter",
@@ -50,7 +52,6 @@ static struct mtd_partition rb1xx_nand_parts[] = {
.size = MTDPART_SIZ_FULL
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
/*
* We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
@@ -79,22 +80,20 @@ static int rb1xx_nand_fixup(struct mtd_info *mtd)
struct platform_nand_data rb1xx_nand_data __initdata = {
.chip = {
.nr_chips = 1,
-#ifdef CONFIG_MTD_PARTITIONS
.nr_partitions = ARRAY_SIZE(rb1xx_nand_parts),
.partitions = rb1xx_nand_parts,
-#endif /* CONFIG_MTD_PARTITIONS */
.chip_delay = RB1XX_NAND_CHIP_DELAY,
.options = NAND_NO_AUTOINCR,
.chip_fixup = rb1xx_nand_fixup,
},
};
-struct gpio_button rb1xx_gpio_buttons[] __initdata = {
+struct gpio_keys_button rb1xx_gpio_buttons[] __initdata = {
{
.desc = "reset_button",
.type = EV_KEY,
- .code = BTN_0,
- .threshold = 5,
+ .code = KEY_RESTART,
+ .debounce_interval = RB1XX_KEYS_DEBOUNCE_INTERVAL,
.gpio = ADM5120_GPIO_PIN7,
}
};
@@ -114,10 +113,8 @@ static void __init rb1xx_mac_setup(void)
void __init rb1xx_add_device_flash(void)
{
/* setup data for flash0 device */
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(rb1xx_nor_parts);
adm5120_flash0_data.parts = rb1xx_nor_parts;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_flash0_data.window_size = 128*1024;
adm5120_add_device_flash(0);
@@ -144,8 +141,9 @@ void __init rb1xx_generic_setup(void)
adm5120_add_device_uart(0);
adm5120_add_device_uart(1);
- adm5120_add_device_gpio_buttons(ARRAY_SIZE(rb1xx_gpio_buttons),
- rb1xx_gpio_buttons);
+ adm5120_register_gpio_buttons(-1, RB1XX_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(rb1xx_gpio_buttons),
+ rb1xx_gpio_buttons);
rb1xx_add_device_flash();
rb1xx_mac_setup();
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.h b/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.h
index 835110d..05e68bd 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.h
+++ b/target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-1xx.h
@@ -26,7 +26,7 @@
#include <prom/routerboot.h>
extern struct platform_nand_data rb1xx_nand_data __initdata;
-extern struct gpio_button rb1xx_gpio_buttons[] __initdata;
+extern struct gpio_keys_button rb1xx_gpio_buttons[] __initdata;
extern void rb1xx_add_device_flash(void) __init;
extern void rb1xx_add_device_nand(void) __init;
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/motorola/pmugw.c b/target/linux/adm5120/files/arch/mips/adm5120/motorola/pmugw.c
index 1e82bd8..a706e57 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/motorola/pmugw.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/motorola/pmugw.c
@@ -26,7 +26,6 @@
#define PMUGW_CONFIG_OFFSET 0x10000
#define PMUGW_CONFIG_SIZE 0x1000
-#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition pmugw_partitions[] = {
{
.name = "admboot",
@@ -43,7 +42,6 @@ static struct mtd_partition pmugw_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static u8 pmugw_vlans[6] __initdata = {
0x41, 0x42, 0x44, 0x48, 0x50, 0x00
@@ -82,10 +80,8 @@ void __init pmugw_setup(void)
gpio_direction_output(ADM5120_GPIO_PIN5, 0);
adm5120_flash0_data.switch_bank = switch_bank_gpio5;
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(pmugw_partitions);
adm5120_flash0_data.parts = pmugw_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_uart(1); /* ttyS0 */
adm5120_add_device_uart(0); /* ttyS1 */
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/osbridge/5gxi.c b/target/linux/adm5120/files/arch/mips/adm5120/osbridge/5gxi.c
index 0fd449a..a5c2c36 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/osbridge/5gxi.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/osbridge/5gxi.c
@@ -20,7 +20,6 @@
#include <asm/mach-adm5120/adm5120_platform.h>
#include <asm/mach-adm5120/adm5120_info.h>
-#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition osbridge_5gxi_partitions[] = {
{
.name = "bootloader",
@@ -37,7 +36,6 @@ static struct mtd_partition osbridge_5gxi_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static struct gpio_led osbridge_5gxi_gpio_leds[] __initdata = {
GPIO_LED_INV(ADM5120_GPIO_PIN6, "5gxi:green:user", NULL),
@@ -54,10 +52,8 @@ static u8 osbridge_5gxi_vlans[6] __initdata = {
static void __init osbridge_5gxi_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(osbridge_5gxi_partitions);
adm5120_flash0_data.parts = osbridge_5gxi_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_uart(0);
adm5120_add_device_uart(1);
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-33x.c b/target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-33x.c
index 24dce32..7f86cab 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-33x.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-33x.c
@@ -16,7 +16,6 @@
#define P33X_GPIO_FLASH_A20 ADM5120_GPIO_PIN5
#define P33X_GPIO_DEV_MASK (1 << P33X_GPIO_FLASH_A20)
-#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition p33x_partitions[] = {
{
.name = "bootbase",
@@ -46,7 +45,6 @@ static struct mtd_partition p33x_partitions[] = {
.size = MTDPART_SIZ_FULL,
}
};
-#endif /* CONFIG_MTD_PARTITIONS */
static struct adm5120_pci_irq p33x_pci_irqs[] __initdata = {
PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
@@ -75,10 +73,8 @@ void __init p33x_generic_setup(void)
gpio_request(P33X_GPIO_FLASH_A20, NULL); /* for flash A20 line */
gpio_direction_output(P33X_GPIO_FLASH_A20, 0);
adm5120_flash0_data.switch_bank = switch_bank_gpio5;
-#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(p33x_partitions);
adm5120_flash0_data.parts = p33x_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
adm5120_add_device_flash(0);
adm5120_add_device_uart(0);
diff --git a/target/linux/adm5120/files/arch/mips/include/asm/mach-adm5120/adm5120_platform.h b/target/linux/adm5120/files/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
index 0159301..952c7ad 100644
--- a/target/linux/adm5120/files/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
+++ b/target/linux/adm5120/files/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
@@ -20,7 +20,8 @@
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h>
-#include <linux/gpio_buttons.h>
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
#include <linux/amba/bus.h>
#include <linux/amba/serial.h>
@@ -28,10 +29,8 @@ struct adm5120_flash_platform_data {
void (*set_vpp)(struct map_info *, int);
void (*switch_bank)(unsigned);
u32 window_size;
-#ifdef CONFIG_MTD_PARTITIONS
unsigned int nr_parts;
struct mtd_partition *parts;
-#endif
};
struct adm5120_switch_platform_data {
@@ -68,8 +67,10 @@ extern void adm5120_add_device_uart(unsigned id) __init;
extern void adm5120_add_device_nand(struct platform_nand_data *pdata) __init;
extern void adm5120_add_device_switch(unsigned num_ports, u8 *vlan_map) __init;
extern void adm5120_add_device_gpio(u32 disable_mask) __init;
-extern void adm5120_add_device_gpio_buttons(unsigned nbuttons,
- struct gpio_button *buttons) __init;
+extern void adm5120_register_gpio_buttons(int id,
+ unsigned poll_interval,
+ unsigned nbuttons,
+ struct gpio_keys_button *buttons);
#define GPIO_LED_DEF(g, n, t, a) { \
.name = (n), \
diff --git a/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c b/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c
index 86657ce..f8d3598 100644
--- a/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c
+++ b/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c
@@ -49,7 +49,7 @@
static unsigned int adm5120_pci_nr_irqs __initdata;
static struct adm5120_pci_irq *adm5120_pci_irq_map __initdata;
-static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pci_lock);
/* -------------------------------------------------------------------------*/
diff --git a/target/linux/adm5120/files/drivers/ata/pata_rb153_cf.c b/target/linux/adm5120/files/drivers/ata/pata_rb153_cf.c
index f5cae63..71f8ad6 100644
--- a/target/linux/adm5120/files/drivers/ata/pata_rb153_cf.c
+++ b/target/linux/adm5120/files/drivers/ata/pata_rb153_cf.c
@@ -56,7 +56,7 @@ static inline void rb153_pata_finish_io(struct ata_port *ap)
ata_sff_dma_pause(ap);
ndelay(RB153_CF_IO_DELAY);
- set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
+ irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
}
static void rb153_pata_exec_command(struct ata_port *ap,
@@ -107,11 +107,11 @@ static irqreturn_t rb153_pata_irq_handler(int irq, void *dev_instance)
struct rb153_cf_info *info = ah->private_data;
if (gpio_get_value(info->gpio_line)) {
- set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW);
+ irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW);
if (!info->frozen)
ata_sff_interrupt(irq, dev_instance);
} else {
- set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
+ irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
}
return IRQ_HANDLED;
@@ -138,7 +138,6 @@ static void rb153_pata_setup_port(struct ata_host *ah)
ap->ops = &rb153_pata_port_ops;
ap->pio_mask = 0x1f; /* PIO4 */
- ap->flags = ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO;
ap->ioaddr.cmd_addr = info->iobase + RB153_CF_REG_CMD;
ap->ioaddr.ctl_addr = info->iobase + RB153_CF_REG_CTRL;
diff --git a/target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c b/target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c
index af292a0..58cf277 100644
--- a/target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c
+++ b/target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c
@@ -54,10 +54,6 @@ struct adm5120_flash_info {
struct resource *res;
struct platform_device *dev;
struct adm5120_map_info amap;
-#ifdef CONFIG_MTD_PARTITIONS
- int nr_parts;
- struct mtd_partition *parts[MAX_PARSED_PARTS];
-#endif
};
struct flash_desc {
@@ -96,7 +92,6 @@ static const char const *probe_types[] = {
NULL
};
-#ifdef CONFIG_MTD_PARTITIONS
static const char const *parse_types[] = {
"cmdlinepart",
#ifdef CONFIG_MTD_REDBOOT_PARTS
@@ -106,7 +101,6 @@ static const char const *parse_types[] = {
"MyLoader",
#endif
};
-#endif
#define BANK_SIZE (2<<20)
#define BANK_SIZE_MAX (4<<20)
@@ -318,89 +312,6 @@ static void adm5120_flash_initbanks(struct adm5120_flash_info *info)
info->mtd->size = info->amap.window_size;
}
-#ifdef CONFIG_MTD_PARTITIONS
-static int adm5120_flash_initparts(struct adm5120_flash_info *info)
-{
- struct adm5120_flash_platform_data *pdata;
- struct map_info *map = &info->amap.map;
- int num_parsers;
- const char *parser[2];
- int err = 0;
- int nr_parts;
- int i;
-
- info->nr_parts = 0;
-
- pdata = info->dev->dev.platform_data;
- if (pdata == NULL)
- goto out;
-
- if (pdata->nr_parts) {
- MAP_INFO(map, "adding static partitions\n");
- err = add_mtd_partitions(info->mtd, pdata->parts,
- pdata->nr_parts);
- if (err == 0) {
- info->nr_parts += pdata->nr_parts;
- goto out;
- }
- }
-
- num_parsers = ARRAY_SIZE(parse_types);
- if (num_parsers > MAX_PARSED_PARTS)
- num_parsers = MAX_PARSED_PARTS;
-
- parser[1] = NULL;
- for (i = 0; i < num_parsers; i++) {
- parser[0] = parse_types[i];
-
- MAP_INFO(map, "parsing \"%s\" partitions\n",
- parser[0]);
- nr_parts = parse_mtd_partitions(info->mtd, parser,
- &info->parts[i], 0);
-
- if (nr_parts <= 0)
- continue;
-
- MAP_INFO(map, "adding \"%s\" partitions\n",
- parser[0]);
-
- err = add_mtd_partitions(info->mtd, info->parts[i], nr_parts);
- if (err)
- break;
-
- info->nr_parts += nr_parts;
- }
-out:
- return err;
-}
-#else
-static int adm5120_flash_initparts(struct adm5120_flash_info *info)
-{
- return 0;
-}
-#endif /* CONFIG_MTD_PARTITIONS */
-
-#ifdef CONFIG_MTD_PARTITIONS
-static void adm5120_flash_remove_mtd(struct adm5120_flash_info *info)
-{
- int i;
-
- if (info->nr_parts) {
- del_mtd_partitions(info->mtd);
- for (i = 0; i < MAX_PARSED_PARTS; i++)
- if (info->parts[i] != NULL)
- kfree(info->parts[i]);
- } else {
- del_mtd_device(info->mtd);
- }
-}
-#else
-static void adm5120_flash_remove_mtd(struct adm5120_flash_info *info)
-{
- del_mtd_device(info->mtd);
-}
-#endif
-
static int adm5120_flash_remove(struct platform_device *dev)
{
struct adm5120_flash_info *info;
@@ -412,7 +323,7 @@ static int adm5120_flash_remove(struct platform_device *dev)
platform_set_drvdata(dev, NULL);
if (info->mtd != NULL) {
- adm5120_flash_remove_mtd(info);
+ mtd_device_unregister(info->mtd);
map_destroy(info->mtd);
}
@@ -429,11 +340,18 @@ static int adm5120_flash_remove(struct platform_device *dev)
static int adm5120_flash_probe(struct platform_device *dev)
{
+ struct adm5120_flash_platform_data *pdata;
struct adm5120_flash_info *info;
struct map_info *map;
const char **probe_type;
int err;
+ pdata = dev->dev.platform_data;
+ if (!pdata) {
+ dev_err(&dev->dev, "no platform data\n");
+ return -EINVAL;
+ }
+
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL) {
err = -ENOMEM;
@@ -484,16 +402,11 @@ static int adm5120_flash_probe(struct platform_device *dev)
info->mtd->owner = THIS_MODULE;
- err = adm5120_flash_initparts(info);
+ err = mtd_device_parse_register(info->mtd, parse_types, 0,
+ pdata->parts, pdata->nr_parts);
if (err)
goto err_out;
- if (info->nr_parts == 0) {
- MAP_INFO(map, "no partitions available, registering "
- "whole flash\n");
- add_mtd_device(info->mtd);
- }
-
return 0;
err_out:
diff --git a/target/linux/adm5120/files/drivers/mtd/trxsplit.c b/target/linux/adm5120/files/drivers/mtd/trxsplit.c
index 7ae0a45..6f60264 100644
--- a/target/linux/adm5120/files/drivers/mtd/trxsplit.c
+++ b/target/linux/adm5120/files/drivers/mtd/trxsplit.c
@@ -144,7 +144,7 @@ static void trxsplit_create_partitions(struct mtd_info *mtd)
part = &trx_parts[i];
part->name = "rootfs";
- err = add_mtd_partitions(mtd, trx_parts, trx_nr_parts);
+ err = mtd_device_register(mtd, trx_parts, trx_nr_parts);
if (err) {
printk(KERN_ALERT PFX "adding TRX partitions failed\n");
return;
@@ -159,7 +159,7 @@ static int trxsplit_refresh_partitions(struct mtd_info *mtd)
mtd->name, MTD_BLOCK_MAJOR, mtd->index);
/* remove old partitions */
- del_mtd_partitions(mtd);
+ mtd_device_unregister(mtd);
trxsplit_findtrx(mtd);
if (!trx_mtd)
diff --git a/target/linux/adm5120/files/drivers/net/adm5120sw.c b/target/linux/adm5120/files/drivers/net/adm5120sw.c
index 17b1f4e..d80a6a3 100644
--- a/target/linux/adm5120/files/drivers/net/adm5120sw.c
+++ b/target/linux/adm5120/files/drivers/net/adm5120sw.c
@@ -38,6 +38,7 @@
#include <asm/mach-adm5120/adm5120_switch.h>
#include "adm5120sw.h"
+#include <linux/dma-mapping.h>
#define DRV_NAME "adm5120-switch"
#define DRV_DESC "ADM5120 built-in ethernet switch driver"
@@ -153,7 +154,7 @@ static unsigned int cur_txl, dirty_txl;
static unsigned int sw_used;
-static spinlock_t tx_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(tx_lock);
/* ------------------------------------------------------------------------ */
@@ -216,6 +217,7 @@ static inline int desc_ipcsum_fail(struct dma_desc *desc)
/* ------------------------------------------------------------------------ */
+#ifdef CONFIG_ADM5120_SWITCH_DEBUG
static void sw_dump_desc(char *label, struct dma_desc *desc, int tx)
{
u32 t;
@@ -336,6 +338,11 @@ static void sw_dump_regs(void)
t = sw_read_reg(SWITCH_REG_RLDA);
SW_DBG("rlda: %08X\n", t);
}
+#else
+static inline void sw_dump_desc(char *label, struct dma_desc *desc, int tx) {}
+static void sw_dump_intr_mask(char *label, u32 mask) {}
+static inline void sw_dump_regs(void) {}
+#endif /* CONFIG_ADM5120_SWITCH_DEBUG */
/* ------------------------------------------------------------------------ */
@@ -502,7 +509,7 @@ static int adm5120_if_poll(struct napi_struct *napi, int limit)
{
struct adm5120_if_priv *priv = container_of(napi,
struct adm5120_if_priv, napi);
- struct net_device *dev = priv->dev;
+ struct net_device *dev __maybe_unused = priv->dev;
int done;
u32 status;
@@ -920,7 +927,7 @@ static void adm5120_if_tx_timeout(struct net_device *dev)
SW_INFO("TX timeout on %s\n", dev->name);
}
-static void adm5120_if_set_multicast_list(struct net_device *dev)
+static void adm5120_if_set_rx_mode(struct net_device *dev)
{
struct adm5120_if_priv *priv = netdev_priv(dev);
u32 ports;
@@ -937,7 +944,7 @@ static void adm5120_if_set_multicast_list(struct net_device *dev)
t |= (ports << CPUP_CONF_DUNP_SHIFT);
if (dev->flags & IFF_PROMISC || dev->flags & IFF_ALLMULTI ||
- dev->mc_count)
+ netdev_mc_count(dev))
/* enable multicast packets */
t &= ~(ports << CPUP_CONF_DMCP_SHIFT);
else
@@ -1024,7 +1031,7 @@ static const struct net_device_ops adm5120sw_netdev_ops = {
.ndo_open = adm5120_if_open,
.ndo_stop = adm5120_if_stop,
.ndo_start_xmit = adm5120_if_hard_start_xmit,
- .ndo_set_multicast_list = adm5120_if_set_multicast_list,
+ .ndo_set_rx_mode = adm5120_if_set_rx_mode,
.ndo_do_ioctl = adm5120_if_do_ioctl,
.ndo_tx_timeout = adm5120_if_tx_timeout,
.ndo_validate_addr = eth_validate_addr,
@@ -1076,7 +1083,7 @@ static void adm5120_switch_cleanup(void)
adm5120_switch_rx_ring_free();
}
-static int __init adm5120_switch_probe(struct platform_device *pdev)
+static int __devinit adm5120_switch_probe(struct platform_device *pdev)
{
u32 t;
int i, err;
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-dbg.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-dbg.c
index 34ee941..2d5dc2a 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120-dbg.c
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-dbg.c
@@ -401,25 +401,28 @@ static const struct file_operations debug_async_fops = {
.open = debug_async_open,
.read = debug_output,
.release = debug_close,
+ .llseek = default_llseek,
};
static const struct file_operations debug_periodic_fops = {
.owner = THIS_MODULE,
.open = debug_periodic_open,
.read = debug_output,
.release = debug_close,
+ .llseek = default_llseek,
};
static const struct file_operations debug_registers_fops = {
.owner = THIS_MODULE,
.open = debug_registers_open,
.read = debug_output,
.release = debug_close,
+ .llseek = default_llseek,
};
static struct dentry *admhc_debug_root;
struct debug_buffer {
ssize_t (*fill_func)(struct debug_buffer *); /* fill method */
- struct device *dev;
+ struct admhcd *ahcd;
struct mutex mutex; /* protect filling of buffer */
size_t count; /* number of characters filled into buffer */
char *page;
@@ -494,15 +497,11 @@ show_list(struct admhcd *ahcd, char *buf, size_t count, struct ed *ed)
static ssize_t fill_async_buffer(struct debug_buffer *buf)
{
- struct usb_bus *bus;
- struct usb_hcd *hcd;
struct admhcd *ahcd;
size_t temp;
unsigned long flags;
- bus = dev_get_drvdata(buf->dev);
- hcd = bus_to_hcd(bus);
- ahcd = hcd_to_admhcd(hcd);
+ ahcd = buf->ahcd;
spin_lock_irqsave(&ahcd->lock, flags);
temp = show_list(ahcd, buf->page, PAGE_SIZE, ahcd->ed_head);
@@ -516,8 +515,6 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)
static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
{
- struct usb_bus *bus;
- struct usb_hcd *hcd;
struct admhcd *ahcd;
struct ed **seen, *ed;
unsigned long flags;
@@ -530,9 +527,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
return 0;
seen_count = 0;
- bus = dev_get_drvdata(buf->dev);
- hcd = bus_to_hcd(bus);
- ahcd = hcd_to_admhcd(hcd);
+ ahcd = buf->ahcd;
next = buf->page;
size = PAGE_SIZE;
@@ -615,7 +610,6 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
static ssize_t fill_registers_buffer(struct debug_buffer *buf)
{
- struct usb_bus *bus;
struct usb_hcd *hcd;
struct admhcd *ahcd;
struct admhcd_regs __iomem *regs;
@@ -624,9 +618,8 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
char *next;
u32 rdata;
- bus = dev_get_drvdata(buf->dev);
- hcd = bus_to_hcd(bus);
- ahcd = hcd_to_admhcd(hcd);
+ ahcd = buf->ahcd;
+ hcd = admhc_to_hcd(ahcd);
regs = ahcd->regs;
next = buf->page;
size = PAGE_SIZE;
@@ -638,13 +631,13 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
admhc_dbg_sw(ahcd, &next, &size,
"bus %s, device %s\n"
"%s\n"
- "%s version " DRIVER_VERSION "\n",
+ "%s\n",
hcd->self.controller->bus->name,
dev_name(hcd->self.controller),
hcd->product_desc,
hcd_name);
- if (bus->controller->power.power_state.event) {
+ if (!HCD_HW_ACCESSIBLE(hcd)) {
size -= scnprintf(next, size,
"SUSPENDED (no register access)\n");
goto done;
@@ -691,7 +684,7 @@ done:
}
-static struct debug_buffer *alloc_buffer(struct device *dev,
+static struct debug_buffer *alloc_buffer(struct admhcd *ahcd,
ssize_t (*fill_func)(struct debug_buffer *))
{
struct debug_buffer *buf;
@@ -699,7 +692,7 @@ static struct debug_buffer *alloc_buffer(struct device *dev,
buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
if (buf) {
- buf->dev = dev;
+ buf->ahcd = ahcd;
buf->fill_func = fill_func;
mutex_init(&buf->mutex);
}
@@ -792,26 +785,25 @@ static int debug_registers_open(struct inode *inode, struct file *file)
static inline void create_debug_files(struct admhcd *ahcd)
{
struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self;
- struct device *dev = bus->dev;
ahcd->debug_dir = debugfs_create_dir(bus->bus_name, admhc_debug_root);
if (!ahcd->debug_dir)
goto dir_error;
ahcd->debug_async = debugfs_create_file("async", S_IRUGO,
- ahcd->debug_dir, dev,
+ ahcd->debug_dir, ahcd,
&debug_async_fops);
if (!ahcd->debug_async)
goto async_error;
ahcd->debug_periodic = debugfs_create_file("periodic", S_IRUGO,
- ahcd->debug_dir, dev,
+ ahcd->debug_dir, ahcd,
&debug_periodic_fops);
if (!ahcd->debug_periodic)
goto periodic_error;
ahcd->debug_registers = debugfs_create_file("registers", S_IRUGO,
- ahcd->debug_dir, dev,
+ ahcd->debug_dir, ahcd,
&debug_registers_fops);
if (!ahcd->debug_registers)
goto registers_error;
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-drv.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-drv.c
index 5aa90d6..99ea9d5 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120-drv.c
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-drv.c
@@ -9,7 +9,7 @@
* (C) Copyright 2002 Hewlett-Packard Company
*
* Written by Christopher Hoover <ch@hpl.hp.com>
- * Based on fragments of previous driver by Rusell King et al.
+ * Based on fragments of previous driver by Russell King et al.
*
* Modified for LH7A404 from ahcd-sa1111.c
* by Durgesh Pattamatta <pattamattad@sharpsec.com>
@@ -81,7 +81,7 @@ static int admhc_adm5120_probe(const struct hc_driver *driver,
admhc_hcd_init(hcd_to_admhcd(hcd));
- retval = usb_add_hcd(hcd, irq, IRQF_DISABLED);
+ retval = usb_add_hcd(hcd, irq, 0);
if (retval)
goto err_io;
@@ -109,10 +109,7 @@ static void admhc_adm5120_remove(struct usb_hcd *hcd,
usb_put_hcd(hcd);
}
-/*-------------------------------------------------------------------------*/
-
-static int __devinit
-admhc_adm5120_start(struct usb_hcd *hcd)
+static int __devinit admhc_adm5120_start(struct usb_hcd *hcd)
{
struct admhcd *ahcd = hcd_to_admhcd(hcd);
int ret;
@@ -137,8 +134,6 @@ err:
return ret;
}
-/*-------------------------------------------------------------------------*/
-
static const struct hc_driver adm5120_hc_driver = {
.description = hcd_name,
.product_desc = "ADM5120 built-in USB 1.1 Host Controller",
@@ -181,8 +176,6 @@ static const struct hc_driver adm5120_hc_driver = {
.start_port_reset = admhc_start_port_reset,
};
-/*-------------------------------------------------------------------------*/
-
static int usb_hcd_adm5120_probe(struct platform_device *pdev)
{
int ret;
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-hcd.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-hcd.c
index 0412546..7dfa804 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120-hcd.c
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-hcd.c
@@ -32,9 +32,9 @@
#include <linux/list.h>
#include <linux/usb.h>
#include <linux/usb/otg.h>
+#include <linux/usb/hcd.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
-#include <linux/reboot.h>
#include <linux/debugfs.h>
#include <linux/io.h>
@@ -43,9 +43,6 @@
#include <asm/unaligned.h>
#include <asm/byteorder.h>
-#include "../core/hcd.h"
-#include "../core/hub.h"
-
#define DRIVER_VERSION "0.27.0"
#define DRIVER_AUTHOR "Gabor Juhos <juhosg@openwrt.org>"
#define DRIVER_DESC "ADMtek USB 1.1 Host Controller Driver"
@@ -117,7 +114,7 @@ static int admhc_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
td_cnt = 2;
/* FALLTHROUGH */
case PIPE_BULK:
- /* one TD for every 4096 Bytes (can be upto 8K) */
+ /* one TD for every 4096 Bytes (can be up to 8K) */
td_cnt += urb->transfer_buffer_length / TD_DATALEN_MAX;
/* ... and for any remaining bytes ... */
if ((urb->transfer_buffer_length % TD_DATALEN_MAX) != 0)
@@ -153,7 +150,7 @@ static int admhc_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
spin_lock_irqsave(&ahcd->lock, flags);
/* don't submit to a dead HC */
- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+ if (!HCD_HW_ACCESSIBLE(hcd)) {
ret = -ENODEV;
goto fail;
}
@@ -321,7 +318,6 @@ sanitize:
ep->hcpriv = NULL;
spin_unlock_irqrestore(&ahcd->lock, flags);
- return;
}
static int admhc_get_frame_number(struct usb_hcd *hcd)
@@ -488,7 +484,7 @@ err:
*/
static int admhc_run(struct admhcd *ahcd)
{
- u32 temp;
+ u32 val;
int first = ahcd->fminterval == 0;
struct usb_hcd *hcd = admhcd_to_hcd(ahcd);
@@ -496,8 +492,8 @@ static int admhc_run(struct admhcd *ahcd)
/* boot firmware should have set this up (5.1.1.3.1) */
if (first) {
- temp = admhc_readl(ahcd, &ahcd->regs->fminterval);
- ahcd->fminterval = temp & ADMHC_SFI_FI_MASK;
+ val = admhc_readl(ahcd, &ahcd->regs->fminterval);
+ ahcd->fminterval = val & ADMHC_SFI_FI_MASK;
if (ahcd->fminterval != FI)
admhc_dbg(ahcd, "fminterval delta %d\n",
ahcd->fminterval - FI);
@@ -507,30 +503,30 @@ static int admhc_run(struct admhcd *ahcd)
}
#if 0 /* TODO: not applicable */
- /* Reset USB nearly "by the book". RemoteWakeupConnected was
- * saved if boot firmware (BIOS/SMM/...) told us it's connected,
- * or if bus glue did the same (e.g. for PCI add-in cards with
- * PCI PM support).
+ /* Reset USB nearly "by the book". RemoteWakeupConnected has
+ * to be checked in case boot firmware (BIOS/SMM/...) has set up
+ * wakeup in a way the bus isn't aware of (e.g., legacy PCI PM).
+ * If the bus glue detected wakeup capability then it should
+ * already be enabled; if so we'll just enable it again.
*/
- if ((ahcd->hc_control & OHCI_CTRL_RWC) != 0
- && !device_may_wakeup(hcd->self.controller))
- device_init_wakeup(hcd->self.controller, 1);
+ if ((ahcd->hc_control & OHCI_CTRL_RWC) != 0)
+ device_set_wakeup_capable(hcd->self.controller, 1);
#endif
switch (ahcd->host_control & ADMHC_HC_BUSS) {
case ADMHC_BUSS_OPER:
- temp = 0;
+ val = 0;
break;
case ADMHC_BUSS_SUSPEND:
/* FALLTHROUGH ? */
case ADMHC_BUSS_RESUME:
ahcd->host_control = ADMHC_BUSS_RESUME;
- temp = 10 /* msec wait */;
+ val = 10 /* msec wait */;
break;
/* case ADMHC_BUSS_RESET: */
default:
ahcd->host_control = ADMHC_BUSS_RESET;
- temp = 50 /* msec wait */;
+ val = 50 /* msec wait */;
break;
}
admhc_writel(ahcd, ahcd->host_control, &ahcd->regs->host_control);
@@ -538,12 +534,12 @@ static int admhc_run(struct admhcd *ahcd)
/* flush the writes */
admhc_writel_flush(ahcd);
- msleep(temp);
- temp = admhc_read_rhdesc(ahcd);
- if (!(temp & ADMHC_RH_NPS)) {
+ msleep(val);
+ val = admhc_read_rhdesc(ahcd);
+ if (!(val & ADMHC_RH_NPS)) {
/* power down each port */
- for (temp = 0; temp < ahcd->num_ports; temp++)
- admhc_write_portstatus(ahcd, temp, ADMHC_PS_CPP);
+ for (val = 0; val < ahcd->num_ports; val++)
+ admhc_write_portstatus(ahcd, val, ADMHC_PS_CPP);
}
/* flush those writes */
admhc_writel_flush(ahcd);
@@ -552,9 +548,9 @@ static int admhc_run(struct admhcd *ahcd)
spin_lock_irq(&ahcd->lock);
admhc_writel(ahcd, ADMHC_CTRL_SR, &ahcd->regs->gencontrol);
- temp = 30; /* ... allow extra time */
+ val = 30; /* ... allow extra time */
while ((admhc_readl(ahcd, &ahcd->regs->gencontrol) & ADMHC_CTRL_SR) != 0) {
- if (--temp == 0) {
+ if (--val == 0) {
spin_unlock_irq(&ahcd->lock);
admhc_err(ahcd, "USB HC reset timed out!\n");
return -1;
@@ -571,7 +567,7 @@ static int admhc_run(struct admhcd *ahcd)
periodic_reinit(ahcd);
/* use rhsc irqs after khubd is fully initialized */
- hcd->poll_rh = 1;
+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
hcd->uses_new_polling = 1;
#if 0
@@ -594,10 +590,10 @@ static int admhc_run(struct admhcd *ahcd)
ahcd->host_control = ADMHC_BUSS_OPER;
admhc_writel(ahcd, ahcd->host_control, &ahcd->regs->host_control);
- temp = 20;
+ val = 20;
while ((admhc_readl(ahcd, &ahcd->regs->host_control)
& ADMHC_HC_BUSS) != ADMHC_BUSS_OPER) {
- if (--temp == 0) {
+ if (--val == 0) {
spin_unlock_irq(&ahcd->lock);
admhc_err(ahcd, "unable to setup operational mode!\n");
return -1;
@@ -613,10 +609,10 @@ static int admhc_run(struct admhcd *ahcd)
/* FIXME: enabling DMA is always failed here for an unknown reason */
admhc_dma_enable(ahcd);
- temp = 200;
+ val = 200;
while ((admhc_readl(ahcd, &ahcd->regs->host_control)
& ADMHC_HC_DMAE) != ADMHC_HC_DMAE) {
- if (--temp == 0) {
+ if (--val == 0) {
spin_unlock_irq(&ahcd->lock);
admhc_err(ahcd, "unable to enable DMA!\n");
admhc_dump(ahcd, 1);
@@ -688,7 +684,7 @@ static irqreturn_t admhc_irq(struct usb_hcd *hcd)
*/
admhc_vdbg(ahcd, "Resume Detect\n");
admhc_intr_ack(ahcd, ADMHC_INTR_RESI);
- hcd->poll_rh = 1;
+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
if (ahcd->autostop) {
spin_lock(&ahcd->lock);
admhc_rh_resume(ahcd);
@@ -799,9 +795,10 @@ static int __init admhc_hcd_mod_init(void)
pr_info("%s: " DRIVER_INFO "\n", hcd_name);
pr_info("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
sizeof(struct ed), sizeof(struct td));
+ set_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
#ifdef DEBUG
- admhc_debug_root = debugfs_create_dir("admhc", NULL);
+ admhc_debug_root = debugfs_create_dir("admhc", usb_debug_root);
if (!admhc_debug_root) {
ret = -ENOENT;
goto error_debug;
@@ -826,6 +823,7 @@ error_platform:
admhc_debug_root = NULL;
error_debug:
#endif
+ clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
return ret;
}
module_init(admhc_hcd_mod_init);
@@ -836,6 +834,7 @@ static void __exit admhc_hcd_mod_exit(void)
#ifdef DEBUG
debugfs_remove(admhc_debug_root);
#endif
+ clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
}
module_exit(admhc_hcd_mod_exit);
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-hub.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-hub.c
index 3c1ab65..8cabaf9 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120-hub.c
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-hub.c
@@ -75,7 +75,7 @@ admhc_hub_status_data(struct usb_hcd *hcd, char *buf)
u32 status;
spin_lock_irqsave(&ahcd->lock, flags);
- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
+ if (!HCD_HW_ACCESSIBLE(hcd))
goto done;
/* init status */
@@ -106,8 +106,11 @@ admhc_hub_status_data(struct usb_hcd *hcd, char *buf)
}
}
- hcd->poll_rh = admhc_root_hub_state_changes(ahcd, changed,
- any_connected);
+ if (admhc_root_hub_state_changes(ahcd, changed,
+ any_connected))
+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+ else
+ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
done:
spin_unlock_irqrestore(&ahcd->lock, flags);
@@ -143,9 +146,9 @@ static int admhc_get_hub_descriptor(struct admhcd *ahcd, char *buf)
temp |= 0x0008;
desc->wHubCharacteristics = (__force __u16)cpu_to_hc16(ahcd, temp);
- /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */
- desc->bitmap[0] = 0;
- desc->bitmap[0] = ~0;
+ /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
+ desc->u.hs.DeviceRemovable[0] = 0;
+ desc->u.hs.DeviceRemovable[0] = ~0;
return 0;
}
@@ -310,10 +313,10 @@ static int admhc_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
u16 wIndex, char *buf, u16 wLength)
{
struct admhcd *ahcd = hcd_to_admhcd(hcd);
- int ports = hcd_to_bus(hcd)->root_hub->maxchild;
+ int ports = ahcd->num_ports;
int ret = 0;
- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
+ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
return -ESHUTDOWN;
switch (typeReq) {
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-pm.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-pm.c
index 0ccf829..7d7fc24 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120-pm.c
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-pm.c
@@ -257,7 +257,7 @@ static int admhc_bus_suspend(struct usb_hcd *hcd)
spin_lock_irq(&ahcd->lock);
- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
+ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
rc = -ESHUTDOWN;
else
rc = admhc_rh_suspend(ahcd, 0);
@@ -275,7 +275,7 @@ static int admhc_bus_resume(struct usb_hcd *hcd)
spin_lock_irq(&ahcd->lock);
- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
+ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
rc = -ESHUTDOWN;
else
rc = admhc_rh_resume(ahcd);
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c
index d7d9e67..cd9c892 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c
@@ -14,6 +14,7 @@
*/
#include <linux/irq.h>
+#include <linux/slab.h>
/*-------------------------------------------------------------------------*/
@@ -300,7 +301,7 @@ static struct ed *ed_get(struct admhcd *ahcd, struct usb_host_endpoint *ep,
u32 info;
/* FIXME: usbcore changes dev->devnum before SET_ADDRESS
- * suceeds ... otherwise we wouldn't need "pipe".
+ * succeeds ... otherwise we wouldn't need "pipe".
*/
info = usb_pipedevice(pipe);
info |= (ep->desc.bEndpointAddress & ~USB_DIR_IN) << ED_EN_SHIFT;
@@ -634,8 +635,7 @@ static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td)
/*-------------------------------------------------------------------------*/
-static inline void
-ed_halted(struct admhcd *ahcd, struct td *td, int cc, struct td *rev)
+static void ed_halted(struct admhcd *ahcd, struct td *td, int cc)
{
struct urb *urb = td->urb;
struct urb_priv *urb_priv = urb->hcpriv;
@@ -764,6 +764,7 @@ rescan_this:
struct urb *urb;
struct urb_priv *urb_priv;
__hc32 savebits;
+ u32 tdINFO;
int status;
td = list_entry(entry, struct td, td_list);
@@ -781,6 +782,16 @@ rescan_this:
/* patch pointer hc uses */
savebits = *prev & ~cpu_to_hc32(ahcd, TD_MASK);
*prev = td->hwNextTD | savebits;
+ /* If this was unlinked, the TD may not have been
+ * retired ... so manually save dhe data toggle.
+ * The controller ignores the value we save for
+ * control and ISO endpoints.
+ */
+ tdINFO = hc32_to_cpup(ahcd, &td->hwINFO);
+ if ((tdINFO & TD_T) == TD_T_DATA0)
+ ed->hwHeadP &= ~cpu_to_hc32(ahcd, ED_C);
+ else if ((tdINFO & TD_T) == TD_T_DATA1)
+ ed->hwHeadP |= cpu_to_hc32(ahcd, ED_C);
/* HC may have partly processed this TD */
#ifdef ADMHC_VERBOSE_DEBUG
@@ -816,13 +827,12 @@ rescan_this:
}
/*-------------------------------------------------------------------------*/
-
/*
* Process normal completions (error or success) and clean the schedules.
*
* This is the main path for handing urbs back to drivers. The only other
- * path is finish_unlinks(), which unlinks URBs using ed_rm_list, instead of
- * scanning the (re-reversed) donelist as this does.
+ * normal path is finish_unlinks(), which unlinks URBs using ed_rm_list,
+ * instead of scanning the (re-reversed) donelist as this does.
*/
static void ed_unhalt(struct admhcd *ahcd, struct ed *ed, struct urb *urb)
diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120.h b/target/linux/adm5120/files/drivers/usb/host/adm5120.h
index 52fe039..e47aac8 100644
--- a/target/linux/adm5120/files/drivers/usb/host/adm5120.h
+++ b/target/linux/adm5120/files/drivers/usb/host/adm5120.h
@@ -403,6 +403,7 @@ struct admhcd {
* other external transceivers should be software-transparent
*/
struct otg_transceiver *transceiver;
+ void (*start_hnp)(struct admhcd *ahcd);
#endif
/*
@@ -537,15 +538,7 @@ static inline struct usb_hcd *admhcd_to_hcd(const struct admhcd *ahcd)
* Big-endian read/write functions are arch-specific.
* Other arches can be added if/when they're needed.
*
- * REVISIT: arch/powerpc now has readl/writel_be, so the
- * definition below can die once the STB04xxx support is
- * finally ported over.
*/
-#if defined(CONFIG_PPC) && !defined(CONFIG_PPC_MERGE)
-#define readl_be(addr) in_be32((__force unsigned *)addr)
-#define writel_be(val, addr) out_be32((__force unsigned *)addr, val)
-#endif
-
static inline unsigned int admhc_readl(const struct admhcd *ahcd,
__hc32 __iomem *regs)
{
diff --git a/target/linux/adm5120/files/drivers/watchdog/adm5120_wdt.c b/target/linux/adm5120/files/drivers/watchdog/adm5120_wdt.c
index bf90568..d5d63b2 100644
--- a/target/linux/adm5120/files/drivers/watchdog/adm5120_wdt.c
+++ b/target/linux/adm5120/files/drivers/watchdog/adm5120_wdt.c
@@ -123,8 +123,7 @@ static ssize_t wdt_write(struct file *file, const char *data, size_t len, loff_t
return 0;
}
-static int wdt_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int new_timeout;
static struct watchdog_info ident = {
@@ -166,7 +165,7 @@ static const struct file_operations wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = wdt_write,
- .ioctl = wdt_ioctl,
+ .unlocked_ioctl = wdt_ioctl,
.open = wdt_open,
.release = wdt_release,
};
diff --git a/target/linux/adm5120/patches-3.3/a00-adm5120-add-Platform-file.patch b/target/linux/adm5120/patches-3.3/a00-adm5120-add-Platform-file.patch
deleted file mode 100644
index ddfbff4..0000000
--- a/target/linux/adm5120/patches-3.3/a00-adm5120-add-Platform-file.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- /dev/null
-+++ b/arch/mips/adm5120/Platform
-@@ -0,0 +1,19 @@
-+#
-+# Infineon/ADMtek ADM5120
-+#
-+
-+platform-$(CONFIG_ADM5120) += adm5120/common/
-+
-+platform-$(CONFIG_ADM5120_OEM_CELLVISION) += adm5120/cellvision/
-+platform-$(CONFIG_ADM5120_OEM_COMPEX) += adm5120/compex/
-+platform-$(CONFIG_ADM5120_OEM_EDIMAX) += adm5120/edimax/
-+platform-$(CONFIG_ADM5120_OEM_GENERIC) += adm5120/generic/
-+platform-$(CONFIG_ADM5120_OEM_INFINEON) += adm5120/infineon/
-+platform-$(CONFIG_ADM5120_OEM_MIKROTIK) += adm5120/mikrotik/
-+platform-$(CONFIG_ADM5120_OEM_MOTOROLA) += adm5120/motorola/
-+platform-$(CONFIG_ADM5120_OEM_OSBRIDGE) += adm5120/osbridge/
-+platform-$(CONFIG_ADM5120_OEM_ZYXEL) += adm5120/zyxel/
-+
-+cflags-$(CONFIG_ADM5120) += -I$(srctree)/arch/mips/include/asm/mach-adm5120
-+libs-$(CONFIG_ADM5120) += arch/mips/adm5120/prom/
-+load-$(CONFIG_ADM5120) += 0xffffffff80001000
diff --git a/target/linux/adm5120/patches-3.3/a01-adm5120-core-build-error-fixes.patch b/target/linux/adm5120/patches-3.3/a01-adm5120-core-build-error-fixes.patch
deleted file mode 100644
index bf0022d..0000000
--- a/target/linux/adm5120/patches-3.3/a01-adm5120-core-build-error-fixes.patch
+++ /dev/null
@@ -1,110 +0,0 @@
---- a/arch/mips/adm5120/common/platform.c
-+++ b/arch/mips/adm5120/common/platform.c
-@@ -18,6 +18,7 @@
- #include <linux/gpio.h>
- #include <linux/irq.h>
- #include <linux/slab.h>
-+#include <linux/export.h>
-
- #include <asm/bootinfo.h>
-
---- a/arch/mips/adm5120/common/clock.c
-+++ b/arch/mips/adm5120/common/clock.c
-@@ -33,7 +33,7 @@ static struct clk uart_clk = {
-
- struct clk *clk_get(struct device *dev, const char *id)
- {
-- char *name = dev_name(dev);
-+ const char *name = dev_name(dev);
-
- if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1"))
- return &uart_clk;
---- a/arch/mips/pci/pci-adm5120.c
-+++ b/arch/mips/pci/pci-adm5120.c
-@@ -49,7 +49,7 @@
- static unsigned int adm5120_pci_nr_irqs __initdata;
- static struct adm5120_pci_irq *adm5120_pci_irq_map __initdata;
-
--static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
-+static DEFINE_SPINLOCK(pci_lock);
-
- /* -------------------------------------------------------------------------*/
-
---- a/arch/mips/adm5120/common/irq.c
-+++ b/arch/mips/adm5120/common/irq.c
-@@ -23,9 +23,9 @@
-
- #include <asm/mach-adm5120/adm5120_defs.h>
-
--static void adm5120_intc_irq_unmask(unsigned int irq);
--static void adm5120_intc_irq_mask(unsigned int irq);
--static int adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type);
-+static void adm5120_intc_irq_unmask(struct irq_data *d);
-+static void adm5120_intc_irq_mask(struct irq_data *d);
-+static int adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type);
-
- static inline void intc_write_reg(unsigned int reg, u32 val)
- {
-@@ -43,10 +43,10 @@ static inline u32 intc_read_reg(unsigned
-
- static struct irq_chip adm5120_intc_irq_chip = {
- .name = "INTC",
-- .unmask = adm5120_intc_irq_unmask,
-- .mask = adm5120_intc_irq_mask,
-- .mask_ack = adm5120_intc_irq_mask,
-- .set_type = adm5120_intc_irq_set_type
-+ .irq_unmask = adm5120_intc_irq_unmask,
-+ .irq_mask = adm5120_intc_irq_mask,
-+ .irq_mask_ack = adm5120_intc_irq_mask,
-+ .irq_set_type = adm5120_intc_irq_set_type
- };
-
- static struct irqaction adm5120_intc_irq_action = {
-@@ -54,20 +54,19 @@ static struct irqaction adm5120_intc_irq
- .name = "cascade [INTC]"
- };
-
--static void adm5120_intc_irq_unmask(unsigned int irq)
-+static void adm5120_intc_irq_unmask(struct irq_data *d)
- {
-- irq -= ADM5120_INTC_IRQ_BASE;
-- intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << irq);
-+ intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE));
- }
-
--static void adm5120_intc_irq_mask(unsigned int irq)
-+static void adm5120_intc_irq_mask(struct irq_data *d)
- {
-- irq -= ADM5120_INTC_IRQ_BASE;
-- intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << irq);
-+ intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE));
- }
-
--static int adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type)
-+static int adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type)
- {
-+ unsigned int irq = d->irq;
- unsigned int sense;
- unsigned long mode;
- int err = 0;
-@@ -105,10 +104,6 @@ static int adm5120_intc_irq_set_type(uns
- mode &= ~(1 << (irq - ADM5120_INTC_IRQ_BASE));
-
- intc_write_reg(INTC_REG_INT_MODE, mode);
-- /* fallthrough */
-- default:
-- irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
-- irq_desc[irq].status |= sense;
- break;
- }
-
-@@ -162,8 +157,7 @@ static void __init adm5120_intc_irq_init
- for (i = ADM5120_INTC_IRQ_BASE;
- i <= ADM5120_INTC_IRQ_BASE + INTC_IRQ_LAST;
- i++) {
-- irq_desc[i].status = INTC_IRQ_STATUS;
-- set_irq_chip_and_handler(i, &adm5120_intc_irq_chip,
-+ irq_set_chip_and_handler(i, &adm5120_intc_irq_chip,
- handle_level_irq);
- }
-
diff --git a/target/linux/adm5120/patches-3.3/a03-adm5120-remove-CONFIG_MTD_PARTITIONS.patch b/target/linux/adm5120/patches-3.3/a03-adm5120-remove-CONFIG_MTD_PARTITIONS.patch
deleted file mode 100644
index 4ee4af6..0000000
--- a/target/linux/adm5120/patches-3.3/a03-adm5120-remove-CONFIG_MTD_PARTITIONS.patch
+++ /dev/null
@@ -1,306 +0,0 @@
---- a/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
-+++ b/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
-@@ -28,10 +28,8 @@ struct adm5120_flash_platform_data {
- void (*set_vpp)(struct map_info *, int);
- void (*switch_bank)(unsigned);
- u32 window_size;
--#ifdef CONFIG_MTD_PARTITIONS
- unsigned int nr_parts;
- struct mtd_partition *parts;
--#endif
- };
-
- struct adm5120_switch_platform_data {
---- a/arch/mips/adm5120/infineon/infineon.c
-+++ b/arch/mips/adm5120/infineon/infineon.c
-@@ -16,7 +16,6 @@
- #define EASY_CONFIG_OFFSET 0x10000
- #define EASY_CONFIG_SIZE 0x1000
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition easy_partitions[] = {
- {
- .name = "admboot",
-@@ -33,7 +32,6 @@ static struct mtd_partition easy_partiti
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static __init void easy_setup_mac(void)
- {
-@@ -68,10 +66,8 @@ void __init easy_setup_pqfp(void)
- gpio_direction_output(ADM5120_GPIO_PIN3, 0);
- adm5120_flash0_data.switch_bank = switch_bank_gpio3;
-
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
- adm5120_flash0_data.parts = easy_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
-
- adm5120_add_device_uart(0);
- adm5120_add_device_uart(1);
-@@ -100,10 +96,8 @@ void __init easy_setup_bga(void)
- gpio_direction_output(ADM5120_GPIO_PIN5, 0);
- adm5120_flash0_data.switch_bank = switch_bank_gpio5;
-
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
- adm5120_flash0_data.parts = easy_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
-
- adm5120_add_device_uart(0);
- adm5120_add_device_uart(1);
---- a/arch/mips/adm5120/cellvision/cellvision.c
-+++ b/arch/mips/adm5120/cellvision/cellvision.c
-@@ -19,7 +19,6 @@
- #define CELLVISION_CONFIG_OFFSET 0x8000
- #define CELLVISION_CONFIG_SIZE 0x1000
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition cas6xx_partitions[] = {
- {
- .name = "admboot",
-@@ -65,7 +64,6 @@ static struct mtd_partition cas7xx_parti
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static void switch_bank_gpio5(unsigned bank)
- {
-@@ -105,20 +103,16 @@ void __init cellvision_mac_setup(void)
-
- void __init cas6xx_flash_setup(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
- adm5120_flash0_data.parts = cas6xx_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
-
- cellvision_flash_setup();
- }
-
- void __init cas7xx_flash_setup(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas7xx_partitions);
- adm5120_flash0_data.parts = cas7xx_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
-
- cellvision_flash_setup();
- }
---- a/arch/mips/adm5120/edimax/br-61xx.c
-+++ b/arch/mips/adm5120/edimax/br-61xx.c
-@@ -18,7 +18,6 @@
- #define BR61XX_CONFIG_OFFSET 0x8000
- #define BR61XX_CONFIG_SIZE 0x1000
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition br61xx_partitions[] = {
- {
- .name = "admboot",
-@@ -35,7 +34,6 @@ static struct mtd_partition br61xx_parti
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static struct gpio_button br61xx_gpio_buttons[] __initdata = {
- {
-@@ -68,10 +66,8 @@ static void __init br61xx_mac_setup(void
- void __init br61xx_generic_setup(void)
- {
-
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(br61xx_partitions);
- adm5120_flash0_data.parts = br61xx_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
- adm5120_add_device_flash(0);
-
- adm5120_add_device_gpio(BR61XX_GPIO_DEV_MASK);
---- a/arch/mips/adm5120/mikrotik/rb-1xx.c
-+++ b/arch/mips/adm5120/mikrotik/rb-1xx.c
-@@ -25,7 +25,6 @@ static struct adm5120_pci_irq rb1xx_pci_
- PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI2)
- };
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition rb1xx_nor_parts[] = {
- {
- .name = "booter",
-@@ -50,7 +49,6 @@ static struct mtd_partition rb1xx_nand_p
- .size = MTDPART_SIZ_FULL
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- /*
- * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
-@@ -79,10 +77,8 @@ static int rb1xx_nand_fixup(struct mtd_i
- struct platform_nand_data rb1xx_nand_data __initdata = {
- .chip = {
- .nr_chips = 1,
--#ifdef CONFIG_MTD_PARTITIONS
- .nr_partitions = ARRAY_SIZE(rb1xx_nand_parts),
- .partitions = rb1xx_nand_parts,
--#endif /* CONFIG_MTD_PARTITIONS */
- .chip_delay = RB1XX_NAND_CHIP_DELAY,
- .options = NAND_NO_AUTOINCR,
- .chip_fixup = rb1xx_nand_fixup,
-@@ -114,10 +110,8 @@ static void __init rb1xx_mac_setup(void)
- void __init rb1xx_add_device_flash(void)
- {
- /* setup data for flash0 device */
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(rb1xx_nor_parts);
- adm5120_flash0_data.parts = rb1xx_nor_parts;
--#endif /* CONFIG_MTD_PARTITIONS */
- adm5120_flash0_data.window_size = 128*1024;
-
- adm5120_add_device_flash(0);
---- a/arch/mips/adm5120/compex/wp54.c
-+++ b/arch/mips/adm5120/compex/wp54.c
-@@ -11,7 +11,6 @@
-
- #include "compex.h"
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition wp54g_wrt_partitions[] = {
- {
- .name = "cfe",
-@@ -28,7 +27,6 @@ static struct mtd_partition wp54g_wrt_pa
- .size = 0x010000,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static struct adm5120_pci_irq wp54_pci_irqs[] __initdata = {
- PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
-@@ -83,10 +81,8 @@ MIPS_MACHINE(MACH_ADM5120_WP54, "WP54",
-
- static void __init wp54_wrt_setup(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(wp54g_wrt_partitions);
- adm5120_flash0_data.parts = wp54g_wrt_partitions;
--#endif
-
- wp54_setup();
- }
---- a/arch/mips/adm5120/zyxel/p-33x.c
-+++ b/arch/mips/adm5120/zyxel/p-33x.c
-@@ -16,7 +16,6 @@
- #define P33X_GPIO_FLASH_A20 ADM5120_GPIO_PIN5
- #define P33X_GPIO_DEV_MASK (1 << P33X_GPIO_FLASH_A20)
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition p33x_partitions[] = {
- {
- .name = "bootbase",
-@@ -46,7 +45,6 @@ static struct mtd_partition p33x_partiti
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static struct adm5120_pci_irq p33x_pci_irqs[] __initdata = {
- PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
-@@ -75,10 +73,8 @@ void __init p33x_generic_setup(void)
- gpio_request(P33X_GPIO_FLASH_A20, NULL); /* for flash A20 line */
- gpio_direction_output(P33X_GPIO_FLASH_A20, 0);
- adm5120_flash0_data.switch_bank = switch_bank_gpio5;
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(p33x_partitions);
- adm5120_flash0_data.parts = p33x_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
- adm5120_add_device_flash(0);
-
- adm5120_add_device_uart(0);
---- a/arch/mips/adm5120/generic/eb-214a.c
-+++ b/arch/mips/adm5120/generic/eb-214a.c
-@@ -28,7 +28,6 @@
- #define EB214A_GPIO_DEV_MASK 0
- #define EB214A_CONFIG_OFFSET 0x4000
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition eb214a_partitions[] = {
- {
- .name = "bootloader",
-@@ -45,7 +44,6 @@ static struct mtd_partition eb214a_parti
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static struct adm5120_pci_irq eb214a_pci_irqs[] __initdata = {
- PCIIRQ(4, 0, 1, ADM5120_IRQ_PCI0),
-@@ -94,10 +92,8 @@ static void __init eb214a_mac_setup(void
-
- static void __init eb214a_setup(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(eb214a_partitions);
- adm5120_flash0_data.parts = eb214a_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
- adm5120_add_device_flash(0);
-
- adm5120_add_device_gpio(EB214A_GPIO_DEV_MASK);
---- a/arch/mips/adm5120/motorola/pmugw.c
-+++ b/arch/mips/adm5120/motorola/pmugw.c
-@@ -26,7 +26,6 @@
- #define PMUGW_CONFIG_OFFSET 0x10000
- #define PMUGW_CONFIG_SIZE 0x1000
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition pmugw_partitions[] = {
- {
- .name = "admboot",
-@@ -43,7 +42,6 @@ static struct mtd_partition pmugw_partit
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static u8 pmugw_vlans[6] __initdata = {
- 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
-@@ -82,10 +80,8 @@ void __init pmugw_setup(void)
- gpio_direction_output(ADM5120_GPIO_PIN5, 0);
- adm5120_flash0_data.switch_bank = switch_bank_gpio5;
-
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(pmugw_partitions);
- adm5120_flash0_data.parts = pmugw_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
-
- adm5120_add_device_uart(1); /* ttyS0 */
- adm5120_add_device_uart(0); /* ttyS1 */
---- a/arch/mips/adm5120/osbridge/5gxi.c
-+++ b/arch/mips/adm5120/osbridge/5gxi.c
-@@ -20,7 +20,6 @@
- #include <asm/mach-adm5120/adm5120_platform.h>
- #include <asm/mach-adm5120/adm5120_info.h>
-
--#ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition osbridge_5gxi_partitions[] = {
- {
- .name = "bootloader",
-@@ -37,7 +36,6 @@ static struct mtd_partition osbridge_5gx
- .size = MTDPART_SIZ_FULL,
- }
- };
--#endif /* CONFIG_MTD_PARTITIONS */
-
- static struct gpio_led osbridge_5gxi_gpio_leds[] __initdata = {
- GPIO_LED_INV(ADM5120_GPIO_PIN6, "5gxi:green:user", NULL),
-@@ -54,10 +52,8 @@ static u8 osbridge_5gxi_vlans[6] __initd
-
- static void __init osbridge_5gxi_setup(void)
- {
--#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(osbridge_5gxi_partitions);
- adm5120_flash0_data.parts = osbridge_5gxi_partitions;
--#endif /* CONFIG_MTD_PARTITIONS */
-
- adm5120_add_device_uart(0);
- adm5120_add_device_uart(1);
diff --git a/target/linux/adm5120/patches-3.3/a04-use-gpio-keys-polled-driver.patch b/target/linux/adm5120/patches-3.3/a04-use-gpio-keys-polled-driver.patch
deleted file mode 100644
index ce9d7fa..0000000
--- a/target/linux/adm5120/patches-3.3/a04-use-gpio-keys-polled-driver.patch
+++ /dev/null
@@ -1,263 +0,0 @@
---- a/arch/mips/adm5120/common/platform.c
-+++ b/arch/mips/adm5120/common/platform.c
-@@ -245,31 +245,44 @@ void __init adm5120_add_device_uart(unsi
- /*
- * GPIO buttons
- */
--#define ADM5120_BUTTON_INTERVAL 20
--struct gpio_buttons_platform_data adm5120_gpio_buttons_data = {
-- .poll_interval = ADM5120_BUTTON_INTERVAL,
--};
--
--struct platform_device adm5120_gpio_buttons_device = {
-- .name = "gpio-buttons",
-- .id = -1,
-- .dev.platform_data = &adm5120_gpio_buttons_data,
--};
--
--void __init adm5120_add_device_gpio_buttons(unsigned nbuttons,
-- struct gpio_button *buttons)
-+void __init adm5120_register_gpio_buttons(int id,
-+ unsigned poll_interval,
-+ unsigned nbuttons,
-+ struct gpio_keys_button *buttons)
- {
-- struct gpio_button *p;
-+ struct platform_device *pdev;
-+ struct gpio_keys_platform_data pdata;
-+ struct gpio_keys_button *p;
-+ int err;
-
-- p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
-+ p = kmemdup(buttons, nbuttons * sizeof(*p), GFP_KERNEL);
- if (!p)
- return;
-
-- memcpy(p, buttons, nbuttons * sizeof(*p));
-- adm5120_gpio_buttons_data.nbuttons = nbuttons;
-- adm5120_gpio_buttons_data.buttons = p;
-+ pdev = platform_device_alloc("gpio-keys-polled", id);
-+ if (!pdev)
-+ goto err_free_buttons;
-+
-+ memset(&pdata, 0, sizeof(pdata));
-+ pdata.poll_interval = poll_interval;
-+ pdata.nbuttons = nbuttons;
-+ pdata.buttons = p;
-+
-+ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
-+ if (err)
-+ goto err_put_pdev;
-+
-+ err = platform_device_add(pdev);
-+ if (err)
-+ goto err_put_pdev;
-+
-+ return;
-+
-+err_put_pdev:
-+ platform_device_put(pdev);
-
-- platform_device_register(&adm5120_gpio_buttons_device);
-+err_free_buttons:
-+ kfree(p);
- }
-
- /*
---- a/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
-+++ b/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
-@@ -20,7 +20,8 @@
- #include <linux/mtd/map.h>
- #include <linux/mtd/partitions.h>
- #include <linux/mtd/nand.h>
--#include <linux/gpio_buttons.h>
-+#include <linux/input.h>
-+#include <linux/gpio_keys.h>
- #include <linux/amba/bus.h>
- #include <linux/amba/serial.h>
-
-@@ -66,8 +67,10 @@ extern void adm5120_add_device_uart(unsi
- extern void adm5120_add_device_nand(struct platform_nand_data *pdata) __init;
- extern void adm5120_add_device_switch(unsigned num_ports, u8 *vlan_map) __init;
- extern void adm5120_add_device_gpio(u32 disable_mask) __init;
--extern void adm5120_add_device_gpio_buttons(unsigned nbuttons,
-- struct gpio_button *buttons) __init;
-+extern void adm5120_register_gpio_buttons(int id,
-+ unsigned poll_interval,
-+ unsigned nbuttons,
-+ struct gpio_keys_button *buttons);
-
- #define GPIO_LED_DEF(g, n, t, a) { \
- .name = (n), \
---- a/arch/mips/adm5120/compex/wp54.c
-+++ b/arch/mips/adm5120/compex/wp54.c
-@@ -11,6 +11,9 @@
-
- #include "compex.h"
-
-+#define WP54_KEYS_POLL_INTERVAL 20
-+#define WP54_KEYS_DEBOUNCE_INTERVAL (3 * WP54_KEYS_POLL_INTERVAL)
-+
- static struct mtd_partition wp54g_wrt_partitions[] = {
- {
- .name = "cfe",
-@@ -32,12 +35,12 @@ static struct adm5120_pci_irq wp54_pci_i
- PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
- };
-
--static struct gpio_button wp54_gpio_buttons[] __initdata = {
-+static struct gpio_keys_button wp54_gpio_buttons[] __initdata = {
- {
- .desc = "reset_button",
- .type = EV_KEY,
-- .code = BTN_0,
-- .threshold = 5,
-+ .code = KEY_RESTART,
-+ .debounce_interval = WP54_KEYS_DEBOUNCE_INTERVAL,
- .gpio = ADM5120_GPIO_PIN4,
- }
- };
-@@ -69,8 +72,9 @@ static void __init wp54_setup(void)
- adm5120_board_reset = wp54_reset;
-
- adm5120_add_device_switch(2, wp54_vlans);
-- adm5120_add_device_gpio_buttons(ARRAY_SIZE(wp54_gpio_buttons),
-- wp54_gpio_buttons);
-+ adm5120_register_gpio_buttons(-1, WP54_KEYS_POLL_INTERVAL,
-+ ARRAY_SIZE(wp54_gpio_buttons),
-+ wp54_gpio_buttons);
- adm5120_add_device_gpio_leds(ARRAY_SIZE(wp54_gpio_leds),
- wp54_gpio_leds);
-
---- a/arch/mips/adm5120/mikrotik/rb-1xx.c
-+++ b/arch/mips/adm5120/mikrotik/rb-1xx.c
-@@ -19,6 +19,9 @@
-
- #define RB1XX_NAND_CHIP_DELAY 25
-
-+#define RB1XX_KEYS_POLL_INTERVAL 20
-+#define RB1XX_KEYS_DEBOUNCE_INTERVAL (3 * RB1XX_KEYS_POLL_INTERVAL)
-+
- static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = {
- PCIIRQ(1, 0, 1, ADM5120_IRQ_PCI0),
- PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI1),
-@@ -85,12 +88,12 @@ struct platform_nand_data rb1xx_nand_dat
- },
- };
-
--struct gpio_button rb1xx_gpio_buttons[] __initdata = {
-+struct gpio_keys_button rb1xx_gpio_buttons[] __initdata = {
- {
- .desc = "reset_button",
- .type = EV_KEY,
-- .code = BTN_0,
-- .threshold = 5,
-+ .code = KEY_RESTART,
-+ .debounce_interval = RB1XX_KEYS_DEBOUNCE_INTERVAL,
- .gpio = ADM5120_GPIO_PIN7,
- }
- };
-@@ -138,8 +141,9 @@ void __init rb1xx_generic_setup(void)
- adm5120_add_device_uart(0);
- adm5120_add_device_uart(1);
-
-- adm5120_add_device_gpio_buttons(ARRAY_SIZE(rb1xx_gpio_buttons),
-- rb1xx_gpio_buttons);
-+ adm5120_register_gpio_buttons(-1, RB1XX_KEYS_POLL_INTERVAL,
-+ ARRAY_SIZE(rb1xx_gpio_buttons),
-+ rb1xx_gpio_buttons);
-
- rb1xx_add_device_flash();
- rb1xx_mac_setup();
---- a/arch/mips/adm5120/generic/eb-214a.c
-+++ b/arch/mips/adm5120/generic/eb-214a.c
-@@ -28,6 +28,9 @@
- #define EB214A_GPIO_DEV_MASK 0
- #define EB214A_CONFIG_OFFSET 0x4000
-
-+#define EB214A_KEYS_POLL_INTERVAL 20
-+#define EB214A_KEYS_DEBOUNCE_INTERVAL (3 * EB214A_KEYS_POLL_INTERVAL)
-+
- static struct mtd_partition eb214a_partitions[] = {
- {
- .name = "bootloader",
-@@ -60,12 +63,12 @@ static struct gpio_led eb214a_gpio_leds[
- GPIO_LED_INV(ADM5120_GPIO_P3L0, "usb4", NULL),
- };
-
--static struct gpio_button eb214a_gpio_buttons[] __initdata = {
-+static struct gpio_keys_button eb214a_gpio_buttons[] __initdata = {
- {
- .desc = "reset",
- .type = EV_KEY,
-- .code = BTN_0,
-- .threshold = 5,
-+ .code = KEY_RESTART,
-+ .debounce_interval = EB214A_KEYS_DEBOUNCE_INTERVAL,
- .gpio = ADM5120_GPIO_PIN1,
- }
- };
-@@ -105,8 +108,9 @@ static void __init eb214a_setup(void)
-
- eb214a_mac_setup();
-
-- adm5120_add_device_gpio_buttons(ARRAY_SIZE(eb214a_gpio_buttons),
-- eb214a_gpio_buttons);
-+ adm5120_register_gpio_buttons(-1, EB214A_KEYS_POLL_INTERVAL,
-+ ARRAY_SIZE(eb214a_gpio_buttons),
-+ eb214a_gpio_buttons);
-
- adm5120_add_device_gpio_leds(ARRAY_SIZE(eb214a_gpio_leds),
- eb214a_gpio_leds);
---- a/arch/mips/adm5120/edimax/br-61xx.c
-+++ b/arch/mips/adm5120/edimax/br-61xx.c
-@@ -18,6 +18,9 @@
- #define BR61XX_CONFIG_OFFSET 0x8000
- #define BR61XX_CONFIG_SIZE 0x1000
-
-+#define BR61XX_KEYS_POLL_INTERVAL 20
-+#define BR61XX_KEYS_DEBOUNCE_INTERVAL (3 * BR61XX_KEYS_POLL_INTERVAL)
-+
- static struct mtd_partition br61xx_partitions[] = {
- {
- .name = "admboot",
-@@ -35,12 +38,12 @@ static struct mtd_partition br61xx_parti
- }
- };
-
--static struct gpio_button br61xx_gpio_buttons[] __initdata = {
-+static struct gpio_keys_button br61xx_gpio_buttons[] __initdata = {
- {
- .desc = "reset_button",
- .type = EV_KEY,
-- .code = BTN_0,
-- .threshold = 5,
-+ .code = KEY_RESTART,
-+ .debounce_interval = BR61XX_KEYS_DEBOUNCE_INTERVAL,
- .gpio = ADM5120_GPIO_PIN2,
- }
- };
-@@ -76,8 +79,10 @@ void __init br61xx_generic_setup(void)
- adm5120_add_device_uart(1);
-
- adm5120_add_device_switch(5, br61xx_vlans);
-- adm5120_add_device_gpio_buttons(ARRAY_SIZE(br61xx_gpio_buttons),
-- br61xx_gpio_buttons);
-+
-+ adm5120_register_gpio_buttons(-1, BR61XX_KEYS_POLL_INTERVAL,
-+ ARRAY_SIZE(br61xx_gpio_buttons),
-+ br61xx_gpio_buttons);
-
- br61xx_mac_setup();
- }
---- a/arch/mips/adm5120/mikrotik/rb-1xx.h
-+++ b/arch/mips/adm5120/mikrotik/rb-1xx.h
-@@ -26,7 +26,7 @@
- #include <prom/routerboot.h>
-
- extern struct platform_nand_data rb1xx_nand_data __initdata;
--extern struct gpio_button rb1xx_gpio_buttons[] __initdata;
-+extern struct gpio_keys_button rb1xx_gpio_buttons[] __initdata;
-
- extern void rb1xx_add_device_flash(void) __init;
- extern void rb1xx_add_device_nand(void) __init;
diff --git a/target/linux/adm5120/patches-3.3/a10-pata-rb150-cf-3.3-fix.patch b/target/linux/adm5120/patches-3.3/a10-pata-rb150-cf-3.3-fix.patch
deleted file mode 100644
index fc3257a..0000000
--- a/target/linux/adm5120/patches-3.3/a10-pata-rb150-cf-3.3-fix.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/drivers/ata/pata_rb153_cf.c
-+++ b/drivers/ata/pata_rb153_cf.c
-@@ -56,7 +56,7 @@ static inline void rb153_pata_finish_io(
- ata_sff_dma_pause(ap);
- ndelay(RB153_CF_IO_DELAY);
-
-- set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
-+ irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
- }
-
- static void rb153_pata_exec_command(struct ata_port *ap,
-@@ -107,11 +107,11 @@ static irqreturn_t rb153_pata_irq_handle
- struct rb153_cf_info *info = ah->private_data;
-
- if (gpio_get_value(info->gpio_line)) {
-- set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW);
-+ irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW);
- if (!info->frozen)
- ata_sff_interrupt(irq, dev_instance);
- } else {
-- set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
-+ irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
- }
-
- return IRQ_HANDLED;
-@@ -138,7 +138,6 @@ static void rb153_pata_setup_port(struct
-
- ap->ops = &rb153_pata_port_ops;
- ap->pio_mask = 0x1f; /* PIO4 */
-- ap->flags = ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO;
-
- ap->ioaddr.cmd_addr = info->iobase + RB153_CF_REG_CMD;
- ap->ioaddr.ctl_addr = info->iobase + RB153_CF_REG_CTRL;
diff --git a/target/linux/adm5120/patches-3.3/a11-adm5120_wdt-3.3-fixes.patch b/target/linux/adm5120/patches-3.3/a11-adm5120_wdt-3.3-fixes.patch
deleted file mode 100644
index 261aa79..0000000
--- a/target/linux/adm5120/patches-3.3/a11-adm5120_wdt-3.3-fixes.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/drivers/watchdog/adm5120_wdt.c
-+++ b/drivers/watchdog/adm5120_wdt.c
-@@ -123,8 +123,7 @@ static ssize_t wdt_write(struct file *fi
- return 0;
- }
-
--static int wdt_ioctl(struct inode *inode, struct file *file,
-- unsigned int cmd, unsigned long arg)
-+static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- {
- int new_timeout;
- static struct watchdog_info ident = {
-@@ -166,7 +165,7 @@ static const struct file_operations wdt_
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .write = wdt_write,
-- .ioctl = wdt_ioctl,
-+ .unlocked_ioctl = wdt_ioctl,
- .open = wdt_open,
- .release = wdt_release,
- };
diff --git a/target/linux/adm5120/patches-3.3/a12-adm5120sw-3.3-fixes.patch b/target/linux/adm5120/patches-3.3/a12-adm5120sw-3.3-fixes.patch
deleted file mode 100644
index aa2be2e..0000000
--- a/target/linux/adm5120/patches-3.3/a12-adm5120sw-3.3-fixes.patch
+++ /dev/null
@@ -1,84 +0,0 @@
---- a/drivers/net/adm5120sw.c
-+++ b/drivers/net/adm5120sw.c
-@@ -38,6 +38,7 @@
- #include <asm/mach-adm5120/adm5120_switch.h>
-
- #include "adm5120sw.h"
-+#include <linux/dma-mapping.h>
-
- #define DRV_NAME "adm5120-switch"
- #define DRV_DESC "ADM5120 built-in ethernet switch driver"
-@@ -153,7 +154,7 @@ static unsigned int cur_txl, dirty_txl;
-
- static unsigned int sw_used;
-
--static spinlock_t tx_lock = SPIN_LOCK_UNLOCKED;
-+static DEFINE_SPINLOCK(tx_lock);
-
- /* ------------------------------------------------------------------------ */
-
-@@ -216,6 +217,7 @@ static inline int desc_ipcsum_fail(struc
-
- /* ------------------------------------------------------------------------ */
-
-+#ifdef CONFIG_ADM5120_SWITCH_DEBUG
- static void sw_dump_desc(char *label, struct dma_desc *desc, int tx)
- {
- u32 t;
-@@ -336,6 +338,11 @@ static void sw_dump_regs(void)
- t = sw_read_reg(SWITCH_REG_RLDA);
- SW_DBG("rlda: %08X\n", t);
- }
-+#else
-+static inline void sw_dump_desc(char *label, struct dma_desc *desc, int tx) {}
-+static void sw_dump_intr_mask(char *label, u32 mask) {}
-+static inline void sw_dump_regs(void) {}
-+#endif /* CONFIG_ADM5120_SWITCH_DEBUG */
-
- /* ------------------------------------------------------------------------ */
-
-@@ -502,7 +509,7 @@ static int adm5120_if_poll(struct napi_s
- {
- struct adm5120_if_priv *priv = container_of(napi,
- struct adm5120_if_priv, napi);
-- struct net_device *dev = priv->dev;
-+ struct net_device *dev __maybe_unused = priv->dev;
- int done;
- u32 status;
-
-@@ -920,7 +927,7 @@ static void adm5120_if_tx_timeout(struct
- SW_INFO("TX timeout on %s\n", dev->name);
- }
-
--static void adm5120_if_set_multicast_list(struct net_device *dev)
-+static void adm5120_if_set_rx_mode(struct net_device *dev)
- {
- struct adm5120_if_priv *priv = netdev_priv(dev);
- u32 ports;
-@@ -937,7 +944,7 @@ static void adm5120_if_set_multicast_lis
- t |= (ports << CPUP_CONF_DUNP_SHIFT);
-
- if (dev->flags & IFF_PROMISC || dev->flags & IFF_ALLMULTI ||
-- dev->mc_count)
-+ netdev_mc_count(dev))
- /* enable multicast packets */
- t &= ~(ports << CPUP_CONF_DMCP_SHIFT);
- else
-@@ -1024,7 +1031,7 @@ static const struct net_device_ops adm51
- .ndo_open = adm5120_if_open,
- .ndo_stop = adm5120_if_stop,
- .ndo_start_xmit = adm5120_if_hard_start_xmit,
-- .ndo_set_multicast_list = adm5120_if_set_multicast_list,
-+ .ndo_set_rx_mode = adm5120_if_set_rx_mode,
- .ndo_do_ioctl = adm5120_if_do_ioctl,
- .ndo_tx_timeout = adm5120_if_tx_timeout,
- .ndo_validate_addr = eth_validate_addr,
-@@ -1076,7 +1083,7 @@ static void adm5120_switch_cleanup(void)
- adm5120_switch_rx_ring_free();
- }
-
--static int __init adm5120_switch_probe(struct platform_device *pdev)
-+static int __devinit adm5120_switch_probe(struct platform_device *pdev)
- {
- u32 t;
- int i, err;
diff --git a/target/linux/adm5120/patches-3.3/a13-adm5120_flash-3.3-fixes.patch b/target/linux/adm5120/patches-3.3/a13-adm5120_flash-3.3-fixes.patch
deleted file mode 100644
index ea2e19f..0000000
--- a/target/linux/adm5120/patches-3.3/a13-adm5120_flash-3.3-fixes.patch
+++ /dev/null
@@ -1,166 +0,0 @@
---- a/drivers/mtd/maps/adm5120-flash.c
-+++ b/drivers/mtd/maps/adm5120-flash.c
-@@ -54,10 +54,6 @@ struct adm5120_flash_info {
- struct resource *res;
- struct platform_device *dev;
- struct adm5120_map_info amap;
--#ifdef CONFIG_MTD_PARTITIONS
-- int nr_parts;
-- struct mtd_partition *parts[MAX_PARSED_PARTS];
--#endif
- };
-
- struct flash_desc {
-@@ -96,7 +92,6 @@ static const char const *probe_types[] =
- NULL
- };
-
--#ifdef CONFIG_MTD_PARTITIONS
- static const char const *parse_types[] = {
- "cmdlinepart",
- #ifdef CONFIG_MTD_REDBOOT_PARTS
-@@ -106,7 +101,6 @@ static const char const *parse_types[] =
- "MyLoader",
- #endif
- };
--#endif
-
- #define BANK_SIZE (2<<20)
- #define BANK_SIZE_MAX (4<<20)
-@@ -318,89 +312,6 @@ static void adm5120_flash_initbanks(stru
- info->mtd->size = info->amap.window_size;
- }
-
--#ifdef CONFIG_MTD_PARTITIONS
--static int adm5120_flash_initparts(struct adm5120_flash_info *info)
--{
-- struct adm5120_flash_platform_data *pdata;
-- struct map_info *map = &info->amap.map;
-- int num_parsers;
-- const char *parser[2];
-- int err = 0;
-- int nr_parts;
-- int i;
--
-- info->nr_parts = 0;
--
-- pdata = info->dev->dev.platform_data;
-- if (pdata == NULL)
-- goto out;
--
-- if (pdata->nr_parts) {
-- MAP_INFO(map, "adding static partitions\n");
-- err = add_mtd_partitions(info->mtd, pdata->parts,
-- pdata->nr_parts);
-- if (err == 0) {
-- info->nr_parts += pdata->nr_parts;
-- goto out;
-- }
-- }
--
-- num_parsers = ARRAY_SIZE(parse_types);
-- if (num_parsers > MAX_PARSED_PARTS)
-- num_parsers = MAX_PARSED_PARTS;
--
-- parser[1] = NULL;
-- for (i = 0; i < num_parsers; i++) {
-- parser[0] = parse_types[i];
--
-- MAP_INFO(map, "parsing \"%s\" partitions\n",
-- parser[0]);
-- nr_parts = parse_mtd_partitions(info->mtd, parser,
-- &info->parts[i], 0);
--
-- if (nr_parts <= 0)
-- continue;
--
-- MAP_INFO(map, "adding \"%s\" partitions\n",
-- parser[0]);
--
-- err = add_mtd_partitions(info->mtd, info->parts[i], nr_parts);
-- if (err)
-- break;
--
-- info->nr_parts += nr_parts;
-- }
--out:
-- return err;
--}
--#else
--static int adm5120_flash_initparts(struct adm5120_flash_info *info)
--{
-- return 0;
--}
--#endif /* CONFIG_MTD_PARTITIONS */
--
--#ifdef CONFIG_MTD_PARTITIONS
--static void adm5120_flash_remove_mtd(struct adm5120_flash_info *info)
--{
-- int i;
--
-- if (info->nr_parts) {
-- del_mtd_partitions(info->mtd);
-- for (i = 0; i < MAX_PARSED_PARTS; i++)
-- if (info->parts[i] != NULL)
-- kfree(info->parts[i]);
-- } else {
-- del_mtd_device(info->mtd);
-- }
--}
--#else
--static void adm5120_flash_remove_mtd(struct adm5120_flash_info *info)
--{
-- del_mtd_device(info->mtd);
--}
--#endif
--
- static int adm5120_flash_remove(struct platform_device *dev)
- {
- struct adm5120_flash_info *info;
-@@ -412,7 +323,7 @@ static int adm5120_flash_remove(struct p
- platform_set_drvdata(dev, NULL);
-
- if (info->mtd != NULL) {
-- adm5120_flash_remove_mtd(info);
-+ mtd_device_unregister(info->mtd);
- map_destroy(info->mtd);
- }
-
-@@ -429,11 +340,18 @@ static int adm5120_flash_remove(struct p
-
- static int adm5120_flash_probe(struct platform_device *dev)
- {
-+ struct adm5120_flash_platform_data *pdata;
- struct adm5120_flash_info *info;
- struct map_info *map;
- const char **probe_type;
- int err;
-
-+ pdata = dev->dev.platform_data;
-+ if (!pdata) {
-+ dev_err(&dev->dev, "no platform data\n");
-+ return -EINVAL;
-+ }
-+
- info = kzalloc(sizeof(*info), GFP_KERNEL);
- if (info == NULL) {
- err = -ENOMEM;
-@@ -484,16 +402,11 @@ static int adm5120_flash_probe(struct pl
-
- info->mtd->owner = THIS_MODULE;
-
-- err = adm5120_flash_initparts(info);
-+ err = mtd_device_parse_register(info->mtd, parse_types, 0,
-+ pdata->parts, pdata->nr_parts);
- if (err)
- goto err_out;
-
-- if (info->nr_parts == 0) {
-- MAP_INFO(map, "no partitions available, registering "
-- "whole flash\n");
-- add_mtd_device(info->mtd);
-- }
--
- return 0;
-
- err_out:
diff --git a/target/linux/adm5120/patches-3.3/a14-mtd-trxsplit-fixes.patch b/target/linux/adm5120/patches-3.3/a14-mtd-trxsplit-fixes.patch
deleted file mode 100644
index f9ececf..0000000
--- a/target/linux/adm5120/patches-3.3/a14-mtd-trxsplit-fixes.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/drivers/mtd/trxsplit.c
-+++ b/drivers/mtd/trxsplit.c
-@@ -144,7 +144,7 @@ static void trxsplit_create_partitions(s
- part = &trx_parts[i];
- part->name = "rootfs";
-
-- err = add_mtd_partitions(mtd, trx_parts, trx_nr_parts);
-+ err = mtd_device_register(mtd, trx_parts, trx_nr_parts);
- if (err) {
- printk(KERN_ALERT PFX "adding TRX partitions failed\n");
- return;
-@@ -159,7 +159,7 @@ static int trxsplit_refresh_partitions(s
- mtd->name, MTD_BLOCK_MAJOR, mtd->index);
-
- /* remove old partitions */
-- del_mtd_partitions(mtd);
-+ mtd_device_unregister(mtd);
-
- trxsplit_findtrx(mtd);
- if (!trx_mtd)
diff --git a/target/linux/adm5120/patches-3.3/a15-adm5120-usb-driver-cleanup.patch b/target/linux/adm5120/patches-3.3/a15-adm5120-usb-driver-cleanup.patch
deleted file mode 100644
index 5994d43..0000000
--- a/target/linux/adm5120/patches-3.3/a15-adm5120-usb-driver-cleanup.patch
+++ /dev/null
@@ -1,582 +0,0 @@
---- a/drivers/usb/host/adm5120.h
-+++ b/drivers/usb/host/adm5120.h
-@@ -403,6 +403,7 @@ struct admhcd {
- * other external transceivers should be software-transparent
- */
- struct otg_transceiver *transceiver;
-+ void (*start_hnp)(struct admhcd *ahcd);
- #endif
-
- /*
-@@ -537,15 +538,7 @@ static inline struct usb_hcd *admhcd_to_
- * Big-endian read/write functions are arch-specific.
- * Other arches can be added if/when they're needed.
- *
-- * REVISIT: arch/powerpc now has readl/writel_be, so the
-- * definition below can die once the STB04xxx support is
-- * finally ported over.
- */
--#if defined(CONFIG_PPC) && !defined(CONFIG_PPC_MERGE)
--#define readl_be(addr) in_be32((__force unsigned *)addr)
--#define writel_be(val, addr) out_be32((__force unsigned *)addr, val)
--#endif
--
- static inline unsigned int admhc_readl(const struct admhcd *ahcd,
- __hc32 __iomem *regs)
- {
---- a/drivers/usb/host/adm5120-drv.c
-+++ b/drivers/usb/host/adm5120-drv.c
-@@ -9,7 +9,7 @@
- * (C) Copyright 2002 Hewlett-Packard Company
- *
- * Written by Christopher Hoover <ch@hpl.hp.com>
-- * Based on fragments of previous driver by Rusell King et al.
-+ * Based on fragments of previous driver by Russell King et al.
- *
- * Modified for LH7A404 from ahcd-sa1111.c
- * by Durgesh Pattamatta <pattamattad@sharpsec.com>
-@@ -81,7 +81,7 @@ static int admhc_adm5120_probe(const str
-
- admhc_hcd_init(hcd_to_admhcd(hcd));
-
-- retval = usb_add_hcd(hcd, irq, IRQF_DISABLED);
-+ retval = usb_add_hcd(hcd, irq, 0);
- if (retval)
- goto err_io;
-
-@@ -109,10 +109,7 @@ static void admhc_adm5120_remove(struct
- usb_put_hcd(hcd);
- }
-
--/*-------------------------------------------------------------------------*/
--
--static int __devinit
--admhc_adm5120_start(struct usb_hcd *hcd)
-+static int __devinit admhc_adm5120_start(struct usb_hcd *hcd)
- {
- struct admhcd *ahcd = hcd_to_admhcd(hcd);
- int ret;
-@@ -137,8 +134,6 @@ err:
- return ret;
- }
-
--/*-------------------------------------------------------------------------*/
--
- static const struct hc_driver adm5120_hc_driver = {
- .description = hcd_name,
- .product_desc = "ADM5120 built-in USB 1.1 Host Controller",
-@@ -181,8 +176,6 @@ static const struct hc_driver adm5120_hc
- .start_port_reset = admhc_start_port_reset,
- };
-
--/*-------------------------------------------------------------------------*/
--
- static int usb_hcd_adm5120_probe(struct platform_device *pdev)
- {
- int ret;
---- a/drivers/usb/host/adm5120-dbg.c
-+++ b/drivers/usb/host/adm5120-dbg.c
-@@ -401,25 +401,28 @@ static const struct file_operations debu
- .open = debug_async_open,
- .read = debug_output,
- .release = debug_close,
-+ .llseek = default_llseek,
- };
- static const struct file_operations debug_periodic_fops = {
- .owner = THIS_MODULE,
- .open = debug_periodic_open,
- .read = debug_output,
- .release = debug_close,
-+ .llseek = default_llseek,
- };
- static const struct file_operations debug_registers_fops = {
- .owner = THIS_MODULE,
- .open = debug_registers_open,
- .read = debug_output,
- .release = debug_close,
-+ .llseek = default_llseek,
- };
-
- static struct dentry *admhc_debug_root;
-
- struct debug_buffer {
- ssize_t (*fill_func)(struct debug_buffer *); /* fill method */
-- struct device *dev;
-+ struct admhcd *ahcd;
- struct mutex mutex; /* protect filling of buffer */
- size_t count; /* number of characters filled into buffer */
- char *page;
-@@ -494,15 +497,11 @@ show_list(struct admhcd *ahcd, char *buf
-
- static ssize_t fill_async_buffer(struct debug_buffer *buf)
- {
-- struct usb_bus *bus;
-- struct usb_hcd *hcd;
- struct admhcd *ahcd;
- size_t temp;
- unsigned long flags;
-
-- bus = dev_get_drvdata(buf->dev);
-- hcd = bus_to_hcd(bus);
-- ahcd = hcd_to_admhcd(hcd);
-+ ahcd = buf->ahcd;
-
- spin_lock_irqsave(&ahcd->lock, flags);
- temp = show_list(ahcd, buf->page, PAGE_SIZE, ahcd->ed_head);
-@@ -516,8 +515,6 @@ static ssize_t fill_async_buffer(struct
-
- static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
- {
-- struct usb_bus *bus;
-- struct usb_hcd *hcd;
- struct admhcd *ahcd;
- struct ed **seen, *ed;
- unsigned long flags;
-@@ -530,9 +527,7 @@ static ssize_t fill_periodic_buffer(stru
- return 0;
- seen_count = 0;
-
-- bus = dev_get_drvdata(buf->dev);
-- hcd = bus_to_hcd(bus);
-- ahcd = hcd_to_admhcd(hcd);
-+ ahcd = buf->ahcd;
- next = buf->page;
- size = PAGE_SIZE;
-
-@@ -615,7 +610,6 @@ static ssize_t fill_periodic_buffer(stru
-
- static ssize_t fill_registers_buffer(struct debug_buffer *buf)
- {
-- struct usb_bus *bus;
- struct usb_hcd *hcd;
- struct admhcd *ahcd;
- struct admhcd_regs __iomem *regs;
-@@ -624,9 +618,8 @@ static ssize_t fill_registers_buffer(str
- char *next;
- u32 rdata;
-
-- bus = dev_get_drvdata(buf->dev);
-- hcd = bus_to_hcd(bus);
-- ahcd = hcd_to_admhcd(hcd);
-+ ahcd = buf->ahcd;
-+ hcd = admhc_to_hcd(ahcd);
- regs = ahcd->regs;
- next = buf->page;
- size = PAGE_SIZE;
-@@ -638,13 +631,13 @@ static ssize_t fill_registers_buffer(str
- admhc_dbg_sw(ahcd, &next, &size,
- "bus %s, device %s\n"
- "%s\n"
-- "%s version " DRIVER_VERSION "\n",
-+ "%s\n",
- hcd->self.controller->bus->name,
- dev_name(hcd->self.controller),
- hcd->product_desc,
- hcd_name);
-
-- if (bus->controller->power.power_state.event) {
-+ if (!HCD_HW_ACCESSIBLE(hcd)) {
- size -= scnprintf(next, size,
- "SUSPENDED (no register access)\n");
- goto done;
-@@ -691,7 +684,7 @@ done:
- }
-
-
--static struct debug_buffer *alloc_buffer(struct device *dev,
-+static struct debug_buffer *alloc_buffer(struct admhcd *ahcd,
- ssize_t (*fill_func)(struct debug_buffer *))
- {
- struct debug_buffer *buf;
-@@ -699,7 +692,7 @@ static struct debug_buffer *alloc_buffer
- buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
-
- if (buf) {
-- buf->dev = dev;
-+ buf->ahcd = ahcd;
- buf->fill_func = fill_func;
- mutex_init(&buf->mutex);
- }
-@@ -792,26 +785,25 @@ static int debug_registers_open(struct i
- static inline void create_debug_files(struct admhcd *ahcd)
- {
- struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self;
-- struct device *dev = bus->dev;
-
- ahcd->debug_dir = debugfs_create_dir(bus->bus_name, admhc_debug_root);
- if (!ahcd->debug_dir)
- goto dir_error;
-
- ahcd->debug_async = debugfs_create_file("async", S_IRUGO,
-- ahcd->debug_dir, dev,
-+ ahcd->debug_dir, ahcd,
- &debug_async_fops);
- if (!ahcd->debug_async)
- goto async_error;
-
- ahcd->debug_periodic = debugfs_create_file("periodic", S_IRUGO,
-- ahcd->debug_dir, dev,
-+ ahcd->debug_dir, ahcd,
- &debug_periodic_fops);
- if (!ahcd->debug_periodic)
- goto periodic_error;
-
- ahcd->debug_registers = debugfs_create_file("registers", S_IRUGO,
-- ahcd->debug_dir, dev,
-+ ahcd->debug_dir, ahcd,
- &debug_registers_fops);
- if (!ahcd->debug_registers)
- goto registers_error;
---- a/drivers/usb/host/adm5120-pm.c
-+++ b/drivers/usb/host/adm5120-pm.c
-@@ -257,7 +257,7 @@ static int admhc_bus_suspend(struct usb_
-
- spin_lock_irq(&ahcd->lock);
-
-- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
-+ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
- rc = -ESHUTDOWN;
- else
- rc = admhc_rh_suspend(ahcd, 0);
-@@ -275,7 +275,7 @@ static int admhc_bus_resume(struct usb_h
-
- spin_lock_irq(&ahcd->lock);
-
-- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
-+ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
- rc = -ESHUTDOWN;
- else
- rc = admhc_rh_resume(ahcd);
---- a/drivers/usb/host/adm5120-hcd.c
-+++ b/drivers/usb/host/adm5120-hcd.c
-@@ -32,9 +32,9 @@
- #include <linux/list.h>
- #include <linux/usb.h>
- #include <linux/usb/otg.h>
-+#include <linux/usb/hcd.h>
- #include <linux/dma-mapping.h>
- #include <linux/dmapool.h>
--#include <linux/reboot.h>
- #include <linux/debugfs.h>
- #include <linux/io.h>
-
-@@ -43,9 +43,6 @@
- #include <asm/unaligned.h>
- #include <asm/byteorder.h>
-
--#include "../core/hcd.h"
--#include "../core/hub.h"
--
- #define DRIVER_VERSION "0.27.0"
- #define DRIVER_AUTHOR "Gabor Juhos <juhosg@openwrt.org>"
- #define DRIVER_DESC "ADMtek USB 1.1 Host Controller Driver"
-@@ -117,7 +114,7 @@ static int admhc_urb_enqueue(struct usb_
- td_cnt = 2;
- /* FALLTHROUGH */
- case PIPE_BULK:
-- /* one TD for every 4096 Bytes (can be upto 8K) */
-+ /* one TD for every 4096 Bytes (can be up to 8K) */
- td_cnt += urb->transfer_buffer_length / TD_DATALEN_MAX;
- /* ... and for any remaining bytes ... */
- if ((urb->transfer_buffer_length % TD_DATALEN_MAX) != 0)
-@@ -153,7 +150,7 @@ static int admhc_urb_enqueue(struct usb_
-
- spin_lock_irqsave(&ahcd->lock, flags);
- /* don't submit to a dead HC */
-- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
-+ if (!HCD_HW_ACCESSIBLE(hcd)) {
- ret = -ENODEV;
- goto fail;
- }
-@@ -321,7 +318,6 @@ sanitize:
- ep->hcpriv = NULL;
-
- spin_unlock_irqrestore(&ahcd->lock, flags);
-- return;
- }
-
- static int admhc_get_frame_number(struct usb_hcd *hcd)
-@@ -488,7 +484,7 @@ err:
- */
- static int admhc_run(struct admhcd *ahcd)
- {
-- u32 temp;
-+ u32 val;
- int first = ahcd->fminterval == 0;
- struct usb_hcd *hcd = admhcd_to_hcd(ahcd);
-
-@@ -496,8 +492,8 @@ static int admhc_run(struct admhcd *ahcd
-
- /* boot firmware should have set this up (5.1.1.3.1) */
- if (first) {
-- temp = admhc_readl(ahcd, &ahcd->regs->fminterval);
-- ahcd->fminterval = temp & ADMHC_SFI_FI_MASK;
-+ val = admhc_readl(ahcd, &ahcd->regs->fminterval);
-+ ahcd->fminterval = val & ADMHC_SFI_FI_MASK;
- if (ahcd->fminterval != FI)
- admhc_dbg(ahcd, "fminterval delta %d\n",
- ahcd->fminterval - FI);
-@@ -507,30 +503,30 @@ static int admhc_run(struct admhcd *ahcd
- }
-
- #if 0 /* TODO: not applicable */
-- /* Reset USB nearly "by the book". RemoteWakeupConnected was
-- * saved if boot firmware (BIOS/SMM/...) told us it's connected,
-- * or if bus glue did the same (e.g. for PCI add-in cards with
-- * PCI PM support).
-+ /* Reset USB nearly "by the book". RemoteWakeupConnected has
-+ * to be checked in case boot firmware (BIOS/SMM/...) has set up
-+ * wakeup in a way the bus isn't aware of (e.g., legacy PCI PM).
-+ * If the bus glue detected wakeup capability then it should
-+ * already be enabled; if so we'll just enable it again.
- */
-- if ((ahcd->hc_control & OHCI_CTRL_RWC) != 0
-- && !device_may_wakeup(hcd->self.controller))
-- device_init_wakeup(hcd->self.controller, 1);
-+ if ((ahcd->hc_control & OHCI_CTRL_RWC) != 0)
-+ device_set_wakeup_capable(hcd->self.controller, 1);
- #endif
-
- switch (ahcd->host_control & ADMHC_HC_BUSS) {
- case ADMHC_BUSS_OPER:
-- temp = 0;
-+ val = 0;
- break;
- case ADMHC_BUSS_SUSPEND:
- /* FALLTHROUGH ? */
- case ADMHC_BUSS_RESUME:
- ahcd->host_control = ADMHC_BUSS_RESUME;
-- temp = 10 /* msec wait */;
-+ val = 10 /* msec wait */;
- break;
- /* case ADMHC_BUSS_RESET: */
- default:
- ahcd->host_control = ADMHC_BUSS_RESET;
-- temp = 50 /* msec wait */;
-+ val = 50 /* msec wait */;
- break;
- }
- admhc_writel(ahcd, ahcd->host_control, &ahcd->regs->host_control);
-@@ -538,12 +534,12 @@ static int admhc_run(struct admhcd *ahcd
- /* flush the writes */
- admhc_writel_flush(ahcd);
-
-- msleep(temp);
-- temp = admhc_read_rhdesc(ahcd);
-- if (!(temp & ADMHC_RH_NPS)) {
-+ msleep(val);
-+ val = admhc_read_rhdesc(ahcd);
-+ if (!(val & ADMHC_RH_NPS)) {
- /* power down each port */
-- for (temp = 0; temp < ahcd->num_ports; temp++)
-- admhc_write_portstatus(ahcd, temp, ADMHC_PS_CPP);
-+ for (val = 0; val < ahcd->num_ports; val++)
-+ admhc_write_portstatus(ahcd, val, ADMHC_PS_CPP);
- }
- /* flush those writes */
- admhc_writel_flush(ahcd);
-@@ -552,9 +548,9 @@ static int admhc_run(struct admhcd *ahcd
- spin_lock_irq(&ahcd->lock);
-
- admhc_writel(ahcd, ADMHC_CTRL_SR, &ahcd->regs->gencontrol);
-- temp = 30; /* ... allow extra time */
-+ val = 30; /* ... allow extra time */
- while ((admhc_readl(ahcd, &ahcd->regs->gencontrol) & ADMHC_CTRL_SR) != 0) {
-- if (--temp == 0) {
-+ if (--val == 0) {
- spin_unlock_irq(&ahcd->lock);
- admhc_err(ahcd, "USB HC reset timed out!\n");
- return -1;
-@@ -571,7 +567,7 @@ static int admhc_run(struct admhcd *ahcd
- periodic_reinit(ahcd);
-
- /* use rhsc irqs after khubd is fully initialized */
-- hcd->poll_rh = 1;
-+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
- hcd->uses_new_polling = 1;
-
- #if 0
-@@ -594,10 +590,10 @@ static int admhc_run(struct admhcd *ahcd
- ahcd->host_control = ADMHC_BUSS_OPER;
- admhc_writel(ahcd, ahcd->host_control, &ahcd->regs->host_control);
-
-- temp = 20;
-+ val = 20;
- while ((admhc_readl(ahcd, &ahcd->regs->host_control)
- & ADMHC_HC_BUSS) != ADMHC_BUSS_OPER) {
-- if (--temp == 0) {
-+ if (--val == 0) {
- spin_unlock_irq(&ahcd->lock);
- admhc_err(ahcd, "unable to setup operational mode!\n");
- return -1;
-@@ -613,10 +609,10 @@ static int admhc_run(struct admhcd *ahcd
- /* FIXME: enabling DMA is always failed here for an unknown reason */
- admhc_dma_enable(ahcd);
-
-- temp = 200;
-+ val = 200;
- while ((admhc_readl(ahcd, &ahcd->regs->host_control)
- & ADMHC_HC_DMAE) != ADMHC_HC_DMAE) {
-- if (--temp == 0) {
-+ if (--val == 0) {
- spin_unlock_irq(&ahcd->lock);
- admhc_err(ahcd, "unable to enable DMA!\n");
- admhc_dump(ahcd, 1);
-@@ -688,7 +684,7 @@ static irqreturn_t admhc_irq(struct usb_
- */
- admhc_vdbg(ahcd, "Resume Detect\n");
- admhc_intr_ack(ahcd, ADMHC_INTR_RESI);
-- hcd->poll_rh = 1;
-+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
- if (ahcd->autostop) {
- spin_lock(&ahcd->lock);
- admhc_rh_resume(ahcd);
-@@ -799,9 +795,10 @@ static int __init admhc_hcd_mod_init(voi
- pr_info("%s: " DRIVER_INFO "\n", hcd_name);
- pr_info("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
- sizeof(struct ed), sizeof(struct td));
-+ set_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
-
- #ifdef DEBUG
-- admhc_debug_root = debugfs_create_dir("admhc", NULL);
-+ admhc_debug_root = debugfs_create_dir("admhc", usb_debug_root);
- if (!admhc_debug_root) {
- ret = -ENOENT;
- goto error_debug;
-@@ -826,6 +823,7 @@ error_platform:
- admhc_debug_root = NULL;
- error_debug:
- #endif
-+ clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
- return ret;
- }
- module_init(admhc_hcd_mod_init);
-@@ -836,6 +834,7 @@ static void __exit admhc_hcd_mod_exit(vo
- #ifdef DEBUG
- debugfs_remove(admhc_debug_root);
- #endif
-+ clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);
- }
- module_exit(admhc_hcd_mod_exit);
-
---- a/drivers/usb/host/adm5120-hub.c
-+++ b/drivers/usb/host/adm5120-hub.c
-@@ -75,7 +75,7 @@ admhc_hub_status_data(struct usb_hcd *hc
- u32 status;
-
- spin_lock_irqsave(&ahcd->lock, flags);
-- if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))
-+ if (!HCD_HW_ACCESSIBLE(hcd))
- goto done;
-
- /* init status */
-@@ -106,8 +106,11 @@ admhc_hub_status_data(struct usb_hcd *hc
- }
- }
-
-- hcd->poll_rh = admhc_root_hub_state_changes(ahcd, changed,
-- any_connected);
-+ if (admhc_root_hub_state_changes(ahcd, changed,
-+ any_connected))
-+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
-+ else
-+ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
-
- done:
- spin_unlock_irqrestore(&ahcd->lock, flags);
-@@ -143,9 +146,9 @@ static int admhc_get_hub_descriptor(stru
- temp |= 0x0008;
- desc->wHubCharacteristics = (__force __u16)cpu_to_hc16(ahcd, temp);
-
-- /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */
-- desc->bitmap[0] = 0;
-- desc->bitmap[0] = ~0;
-+ /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
-+ desc->u.hs.DeviceRemovable[0] = 0;
-+ desc->u.hs.DeviceRemovable[0] = ~0;
-
- return 0;
- }
-@@ -310,10 +313,10 @@ static int admhc_hub_control(struct usb_
- u16 wIndex, char *buf, u16 wLength)
- {
- struct admhcd *ahcd = hcd_to_admhcd(hcd);
-- int ports = hcd_to_bus(hcd)->root_hub->maxchild;
-+ int ports = ahcd->num_ports;
- int ret = 0;
-
-- if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
-+ if (unlikely(!HCD_HW_ACCESSIBLE(hcd)))
- return -ESHUTDOWN;
-
- switch (typeReq) {
---- a/drivers/usb/host/adm5120-q.c
-+++ b/drivers/usb/host/adm5120-q.c
-@@ -14,6 +14,7 @@
- */
-
- #include <linux/irq.h>
-+#include <linux/slab.h>
-
- /*-------------------------------------------------------------------------*/
-
-@@ -300,7 +301,7 @@ static struct ed *ed_get(struct admhcd *
- u32 info;
-
- /* FIXME: usbcore changes dev->devnum before SET_ADDRESS
-- * suceeds ... otherwise we wouldn't need "pipe".
-+ * succeeds ... otherwise we wouldn't need "pipe".
- */
- info = usb_pipedevice(pipe);
- info |= (ep->desc.bEndpointAddress & ~USB_DIR_IN) << ED_EN_SHIFT;
-@@ -634,8 +635,7 @@ static int td_done(struct admhcd *ahcd,
-
- /*-------------------------------------------------------------------------*/
-
--static inline void
--ed_halted(struct admhcd *ahcd, struct td *td, int cc, struct td *rev)
-+static void ed_halted(struct admhcd *ahcd, struct td *td, int cc)
- {
- struct urb *urb = td->urb;
- struct urb_priv *urb_priv = urb->hcpriv;
-@@ -764,6 +764,7 @@ rescan_this:
- struct urb *urb;
- struct urb_priv *urb_priv;
- __hc32 savebits;
-+ u32 tdINFO;
- int status;
-
- td = list_entry(entry, struct td, td_list);
-@@ -781,6 +782,16 @@ rescan_this:
- /* patch pointer hc uses */
- savebits = *prev & ~cpu_to_hc32(ahcd, TD_MASK);
- *prev = td->hwNextTD | savebits;
-+ /* If this was unlinked, the TD may not have been
-+ * retired ... so manually save dhe data toggle.
-+ * The controller ignores the value we save for
-+ * control and ISO endpoints.
-+ */
-+ tdINFO = hc32_to_cpup(ahcd, &td->hwINFO);
-+ if ((tdINFO & TD_T) == TD_T_DATA0)
-+ ed->hwHeadP &= ~cpu_to_hc32(ahcd, ED_C);
-+ else if ((tdINFO & TD_T) == TD_T_DATA1)
-+ ed->hwHeadP |= cpu_to_hc32(ahcd, ED_C);
-
- /* HC may have partly processed this TD */
- #ifdef ADMHC_VERBOSE_DEBUG
-@@ -816,13 +827,12 @@ rescan_this:
- }
-
- /*-------------------------------------------------------------------------*/
--
- /*
- * Process normal completions (error or success) and clean the schedules.
- *
- * This is the main path for handing urbs back to drivers. The only other
-- * path is finish_unlinks(), which unlinks URBs using ed_rm_list, instead of
-- * scanning the (re-reversed) donelist as this does.
-+ * normal path is finish_unlinks(), which unlinks URBs using ed_rm_list,
-+ * instead of scanning the (re-reversed) donelist as this does.
- */
-
- static void ed_unhalt(struct admhcd *ahcd, struct ed *ed, struct urb *urb)