Skip to content

Commit

Permalink
USB: use generic platform driver on ath79
Browse files Browse the repository at this point in the history
The ath79 usb driver doesn't do anything special and is now converted
to the generic ehci and ohci driver.
This was tested on a TP-Link TL-WR1043ND (AR9132)

Acked-by: Gabor Juhos <juhosg@openwrt.org>
CC: Imre Kaloz <kaloz@openwrt.org>
CC: linux-mips@linux-mips.org
CC: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Hauke Mehrtens authored and Greg Kroah-Hartman committed Mar 15, 2012
1 parent 7a7a4a5 commit 5d98cd4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 377 deletions.
31 changes: 25 additions & 6 deletions arch/mips/ath79/dev-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <linux/irq.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/usb/ehci_pdriver.h>
#include <linux/usb/ohci_pdriver.h>

#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>
Expand All @@ -36,14 +38,19 @@ static struct resource ath79_ohci_resources[] = {
};

static u64 ath79_ohci_dmamask = DMA_BIT_MASK(32);

static struct usb_ohci_pdata ath79_ohci_pdata = {
};

static struct platform_device ath79_ohci_device = {
.name = "ath79-ohci",
.name = "ohci-platform",
.id = -1,
.resource = ath79_ohci_resources,
.num_resources = ARRAY_SIZE(ath79_ohci_resources),
.dev = {
.dma_mask = &ath79_ohci_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &ath79_ohci_pdata,
},
};

Expand All @@ -60,8 +67,20 @@ static struct resource ath79_ehci_resources[] = {
};

static u64 ath79_ehci_dmamask = DMA_BIT_MASK(32);

static struct usb_ehci_pdata ath79_ehci_pdata_v1 = {
.has_synopsys_hc_bug = 1,
.port_power_off = 1,
};

static struct usb_ehci_pdata ath79_ehci_pdata_v2 = {
.caps_offset = 0x100,
.has_tt = 1,
.port_power_off = 1,
};

static struct platform_device ath79_ehci_device = {
.name = "ath79-ehci",
.name = "ehci-platform",
.id = -1,
.resource = ath79_ehci_resources,
.num_resources = ARRAY_SIZE(ath79_ehci_resources),
Expand Down Expand Up @@ -101,7 +120,7 @@ static void __init ath79_usb_setup(void)

ath79_ehci_resources[0].start = AR71XX_EHCI_BASE;
ath79_ehci_resources[0].end = AR71XX_EHCI_BASE + AR71XX_EHCI_SIZE - 1;
ath79_ehci_device.name = "ar71xx-ehci";
ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v1;
platform_device_register(&ath79_ehci_device);
}

Expand Down Expand Up @@ -142,7 +161,7 @@ static void __init ar724x_usb_setup(void)

ath79_ehci_resources[0].start = AR724X_EHCI_BASE;
ath79_ehci_resources[0].end = AR724X_EHCI_BASE + AR724X_EHCI_SIZE - 1;
ath79_ehci_device.name = "ar724x-ehci";
ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
platform_device_register(&ath79_ehci_device);
}

Expand All @@ -159,7 +178,7 @@ static void __init ar913x_usb_setup(void)

ath79_ehci_resources[0].start = AR913X_EHCI_BASE;
ath79_ehci_resources[0].end = AR913X_EHCI_BASE + AR913X_EHCI_SIZE - 1;
ath79_ehci_device.name = "ar913x-ehci";
ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
platform_device_register(&ath79_ehci_device);
}

Expand All @@ -176,7 +195,7 @@ static void __init ar933x_usb_setup(void)

ath79_ehci_resources[0].start = AR933X_EHCI_BASE;
ath79_ehci_resources[0].end = AR933X_EHCI_BASE + AR933X_EHCI_SIZE - 1;
ath79_ehci_device.name = "ar933x-ehci";
ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
platform_device_register(&ath79_ehci_device);
}

Expand Down
12 changes: 10 additions & 2 deletions drivers/usb/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,15 @@ config USB_CNS3XXX_EHCI
support.

config USB_EHCI_ATH79
bool "EHCI support for AR7XXX/AR9XXX SoCs"
bool "EHCI support for AR7XXX/AR9XXX SoCs (DEPRECATED)"
depends on USB_EHCI_HCD && (SOC_AR71XX || SOC_AR724X || SOC_AR913X || SOC_AR933X)
select USB_EHCI_ROOT_HUB_TT
select USB_EHCI_HCD_PLATFORM
default y
---help---
This option is deprecated now and the driver was removed, use
USB_EHCI_HCD_PLATFORM instead.

Enables support for the built-in EHCI controller present
on the Atheros AR7XXX/AR9XXX SoCs.

Expand Down Expand Up @@ -316,10 +320,14 @@ config USB_OHCI_HCD_OMAP3
OMAP3 and later chips.

config USB_OHCI_ATH79
bool "USB OHCI support for the Atheros AR71XX/AR7240 SoCs"
bool "USB OHCI support for the Atheros AR71XX/AR7240 SoCs (DEPRECATED)"
depends on USB_OHCI_HCD && (SOC_AR71XX || SOC_AR724X)
select USB_OHCI_HCD_PLATFORM
default y
help
This option is deprecated now and the driver was removed, use
USB_OHCI_HCD_PLATFORM instead.

Enables support for the built-in OHCI controller present on the
Atheros AR71XX/AR7240 SoCs.

Expand Down
208 changes: 0 additions & 208 deletions drivers/usb/host/ehci-ath79.c

This file was deleted.

5 changes: 0 additions & 5 deletions drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,11 +1351,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER s5p_ehci_driver
#endif

#ifdef CONFIG_USB_EHCI_ATH79
#include "ehci-ath79.c"
#define PLATFORM_DRIVER ehci_ath79_driver
#endif

#ifdef CONFIG_SPARC_LEON
#include "ehci-grlib.c"
#define PLATFORM_DRIVER ehci_grlib_driver
Expand Down
Loading

0 comments on commit 5d98cd4

Please sign in to comment.