aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/ath79/dev-usb.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-03-12 20:04:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-15 15:45:43 -0400
commit5d98cd4e1df9587963ade40ef29bef604fb3920a (patch)
tree9a7bf0da2755dd2dff845d58be1ca4cf8a1d9c7f /arch/mips/ath79/dev-usb.c
parent7a7a4a592f42d9abf3b6cc40620b3f79fef49246 (diff)
USB: use generic platform driver on ath79
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>
Diffstat (limited to 'arch/mips/ath79/dev-usb.c')
-rw-r--r--arch/mips/ath79/dev-usb.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/arch/mips/ath79/dev-usb.c b/arch/mips/ath79/dev-usb.c
index 002d6d2afe04..36e9570e7bc4 100644
--- a/arch/mips/ath79/dev-usb.c
+++ b/arch/mips/ath79/dev-usb.c
@@ -17,6 +17,8 @@
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/dma-mapping.h> 18#include <linux/dma-mapping.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/usb/ehci_pdriver.h>
21#include <linux/usb/ohci_pdriver.h>
20 22
21#include <asm/mach-ath79/ath79.h> 23#include <asm/mach-ath79/ath79.h>
22#include <asm/mach-ath79/ar71xx_regs.h> 24#include <asm/mach-ath79/ar71xx_regs.h>
@@ -36,14 +38,19 @@ static struct resource ath79_ohci_resources[] = {
36}; 38};
37 39
38static u64 ath79_ohci_dmamask = DMA_BIT_MASK(32); 40static u64 ath79_ohci_dmamask = DMA_BIT_MASK(32);
41
42static struct usb_ohci_pdata ath79_ohci_pdata = {
43};
44
39static struct platform_device ath79_ohci_device = { 45static struct platform_device ath79_ohci_device = {
40 .name = "ath79-ohci", 46 .name = "ohci-platform",
41 .id = -1, 47 .id = -1,
42 .resource = ath79_ohci_resources, 48 .resource = ath79_ohci_resources,
43 .num_resources = ARRAY_SIZE(ath79_ohci_resources), 49 .num_resources = ARRAY_SIZE(ath79_ohci_resources),
44 .dev = { 50 .dev = {
45 .dma_mask = &ath79_ohci_dmamask, 51 .dma_mask = &ath79_ohci_dmamask,
46 .coherent_dma_mask = DMA_BIT_MASK(32), 52 .coherent_dma_mask = DMA_BIT_MASK(32),
53 .platform_data = &ath79_ohci_pdata,
47 }, 54 },
48}; 55};
49 56
@@ -60,8 +67,20 @@ static struct resource ath79_ehci_resources[] = {
60}; 67};
61 68
62static u64 ath79_ehci_dmamask = DMA_BIT_MASK(32); 69static u64 ath79_ehci_dmamask = DMA_BIT_MASK(32);
70
71static struct usb_ehci_pdata ath79_ehci_pdata_v1 = {
72 .has_synopsys_hc_bug = 1,
73 .port_power_off = 1,
74};
75
76static struct usb_ehci_pdata ath79_ehci_pdata_v2 = {
77 .caps_offset = 0x100,
78 .has_tt = 1,
79 .port_power_off = 1,
80};
81
63static struct platform_device ath79_ehci_device = { 82static struct platform_device ath79_ehci_device = {
64 .name = "ath79-ehci", 83 .name = "ehci-platform",
65 .id = -1, 84 .id = -1,
66 .resource = ath79_ehci_resources, 85 .resource = ath79_ehci_resources,
67 .num_resources = ARRAY_SIZE(ath79_ehci_resources), 86 .num_resources = ARRAY_SIZE(ath79_ehci_resources),
@@ -101,7 +120,7 @@ static void __init ath79_usb_setup(void)
101 120
102 ath79_ehci_resources[0].start = AR71XX_EHCI_BASE; 121 ath79_ehci_resources[0].start = AR71XX_EHCI_BASE;
103 ath79_ehci_resources[0].end = AR71XX_EHCI_BASE + AR71XX_EHCI_SIZE - 1; 122 ath79_ehci_resources[0].end = AR71XX_EHCI_BASE + AR71XX_EHCI_SIZE - 1;
104 ath79_ehci_device.name = "ar71xx-ehci"; 123 ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v1;
105 platform_device_register(&ath79_ehci_device); 124 platform_device_register(&ath79_ehci_device);
106} 125}
107 126
@@ -142,7 +161,7 @@ static void __init ar724x_usb_setup(void)
142 161
143 ath79_ehci_resources[0].start = AR724X_EHCI_BASE; 162 ath79_ehci_resources[0].start = AR724X_EHCI_BASE;
144 ath79_ehci_resources[0].end = AR724X_EHCI_BASE + AR724X_EHCI_SIZE - 1; 163 ath79_ehci_resources[0].end = AR724X_EHCI_BASE + AR724X_EHCI_SIZE - 1;
145 ath79_ehci_device.name = "ar724x-ehci"; 164 ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
146 platform_device_register(&ath79_ehci_device); 165 platform_device_register(&ath79_ehci_device);
147} 166}
148 167
@@ -159,7 +178,7 @@ static void __init ar913x_usb_setup(void)
159 178
160 ath79_ehci_resources[0].start = AR913X_EHCI_BASE; 179 ath79_ehci_resources[0].start = AR913X_EHCI_BASE;
161 ath79_ehci_resources[0].end = AR913X_EHCI_BASE + AR913X_EHCI_SIZE - 1; 180 ath79_ehci_resources[0].end = AR913X_EHCI_BASE + AR913X_EHCI_SIZE - 1;
162 ath79_ehci_device.name = "ar913x-ehci"; 181 ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
163 platform_device_register(&ath79_ehci_device); 182 platform_device_register(&ath79_ehci_device);
164} 183}
165 184
@@ -176,7 +195,7 @@ static void __init ar933x_usb_setup(void)
176 195
177 ath79_ehci_resources[0].start = AR933X_EHCI_BASE; 196 ath79_ehci_resources[0].start = AR933X_EHCI_BASE;
178 ath79_ehci_resources[0].end = AR933X_EHCI_BASE + AR933X_EHCI_SIZE - 1; 197 ath79_ehci_resources[0].end = AR933X_EHCI_BASE + AR933X_EHCI_SIZE - 1;
179 ath79_ehci_device.name = "ar933x-ehci"; 198 ath79_ehci_device.dev.platform_data = &ath79_ehci_pdata_v2;
180 platform_device_register(&ath79_ehci_device); 199 platform_device_register(&ath79_ehci_device);
181} 200}
182 201