diff options
author | Florian Fainelli <florian@openwrt.org> | 2012-10-08 09:11:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 14:23:58 -0400 |
commit | f3a958d30dd1ceac83a3b82b5260475c7697d53a (patch) | |
tree | 6fe1ef8a2b7c81e47195068cab04828ec0e9e979 | |
parent | b898f5fa39f8606d64f1760ac09400e9323fed83 (diff) |
USB: EHCI: remove CNS3xxx EHCI platform driver
The users have been converted to use the ehci platform driver instead, thus
making the ehci-cns3xxx driver obsolete, so remove it.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/Kconfig | 6 | ||||
-rw-r--r-- | drivers/usb/host/ehci-cns3xxx.c | 155 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 5 |
3 files changed, 5 insertions, 161 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index e6b64f60608..d21c0070b05 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -215,9 +215,13 @@ config USB_W90X900_EHCI | |||
215 | Enables support for the W90X900 USB controller | 215 | Enables support for the W90X900 USB controller |
216 | 216 | ||
217 | config USB_CNS3XXX_EHCI | 217 | config USB_CNS3XXX_EHCI |
218 | bool "Cavium CNS3XXX EHCI Module" | 218 | bool "Cavium CNS3XXX EHCI Module (DEPRECATED)" |
219 | depends on USB_EHCI_HCD && ARCH_CNS3XXX | 219 | depends on USB_EHCI_HCD && ARCH_CNS3XXX |
220 | select USB_EHCI_HCD_PLATFORM | ||
220 | ---help--- | 221 | ---help--- |
222 | This option is deprecated now and the driver was removed, use | ||
223 | USB_EHCI_HCD_PLATFORM instead. | ||
224 | |||
221 | Enable support for the CNS3XXX SOC's on-chip EHCI controller. | 225 | Enable support for the CNS3XXX SOC's on-chip EHCI controller. |
222 | It is needed for high-speed (480Mbit/sec) USB 2.0 device | 226 | It is needed for high-speed (480Mbit/sec) USB 2.0 device |
223 | support. | 227 | support. |
diff --git a/drivers/usb/host/ehci-cns3xxx.c b/drivers/usb/host/ehci-cns3xxx.c deleted file mode 100644 index d91708d2e72..00000000000 --- a/drivers/usb/host/ehci-cns3xxx.c +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Cavium Networks | ||
3 | * | ||
4 | * This file is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License, Version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/atomic.h> | ||
11 | #include <mach/cns3xxx.h> | ||
12 | #include <mach/pm.h> | ||
13 | |||
14 | static int cns3xxx_ehci_init(struct usb_hcd *hcd) | ||
15 | { | ||
16 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
17 | int retval; | ||
18 | |||
19 | /* | ||
20 | * EHCI and OHCI share the same clock and power, | ||
21 | * resetting twice would cause the 1st controller been reset. | ||
22 | * Therefore only do power up at the first up device, and | ||
23 | * power down at the last down device. | ||
24 | * | ||
25 | * Set USB AHB INCR length to 16 | ||
26 | */ | ||
27 | if (atomic_inc_return(&usb_pwr_ref) == 1) { | ||
28 | cns3xxx_pwr_power_up(1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB); | ||
29 | cns3xxx_pwr_clk_en(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
30 | cns3xxx_pwr_soft_rst(1 << PM_SOFT_RST_REG_OFFST_USB_HOST); | ||
31 | __raw_writel((__raw_readl(MISC_CHIP_CONFIG_REG) | (0X2 << 24)), | ||
32 | MISC_CHIP_CONFIG_REG); | ||
33 | } | ||
34 | |||
35 | ehci->caps = hcd->regs; | ||
36 | |||
37 | hcd->has_tt = 0; | ||
38 | |||
39 | retval = ehci_setup(hcd); | ||
40 | if (retval) | ||
41 | return retval; | ||
42 | |||
43 | ehci_port_power(ehci, 0); | ||
44 | |||
45 | return retval; | ||
46 | } | ||
47 | |||
48 | static const struct hc_driver cns3xxx_ehci_hc_driver = { | ||
49 | .description = hcd_name, | ||
50 | .product_desc = "CNS3XXX EHCI Host Controller", | ||
51 | .hcd_priv_size = sizeof(struct ehci_hcd), | ||
52 | .irq = ehci_irq, | ||
53 | .flags = HCD_MEMORY | HCD_USB2, | ||
54 | .reset = cns3xxx_ehci_init, | ||
55 | .start = ehci_run, | ||
56 | .stop = ehci_stop, | ||
57 | .shutdown = ehci_shutdown, | ||
58 | .urb_enqueue = ehci_urb_enqueue, | ||
59 | .urb_dequeue = ehci_urb_dequeue, | ||
60 | .endpoint_disable = ehci_endpoint_disable, | ||
61 | .endpoint_reset = ehci_endpoint_reset, | ||
62 | .get_frame_number = ehci_get_frame, | ||
63 | .hub_status_data = ehci_hub_status_data, | ||
64 | .hub_control = ehci_hub_control, | ||
65 | #ifdef CONFIG_PM | ||
66 | .bus_suspend = ehci_bus_suspend, | ||
67 | .bus_resume = ehci_bus_resume, | ||
68 | #endif | ||
69 | .relinquish_port = ehci_relinquish_port, | ||
70 | .port_handed_over = ehci_port_handed_over, | ||
71 | |||
72 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
73 | }; | ||
74 | |||
75 | static int cns3xxx_ehci_probe(struct platform_device *pdev) | ||
76 | { | ||
77 | struct device *dev = &pdev->dev; | ||
78 | struct usb_hcd *hcd; | ||
79 | const struct hc_driver *driver = &cns3xxx_ehci_hc_driver; | ||
80 | struct resource *res; | ||
81 | int irq; | ||
82 | int retval; | ||
83 | |||
84 | if (usb_disabled()) | ||
85 | return -ENODEV; | ||
86 | |||
87 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
88 | if (!res) { | ||
89 | dev_err(dev, "Found HC with no IRQ.\n"); | ||
90 | return -ENODEV; | ||
91 | } | ||
92 | irq = res->start; | ||
93 | |||
94 | hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); | ||
95 | if (!hcd) | ||
96 | return -ENOMEM; | ||
97 | |||
98 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
99 | if (!res) { | ||
100 | dev_err(dev, "Found HC with no register addr.\n"); | ||
101 | retval = -ENODEV; | ||
102 | goto err1; | ||
103 | } | ||
104 | |||
105 | hcd->rsrc_start = res->start; | ||
106 | hcd->rsrc_len = resource_size(res); | ||
107 | |||
108 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | ||
109 | if (hcd->regs == NULL) { | ||
110 | dev_dbg(dev, "error mapping memory\n"); | ||
111 | retval = -EFAULT; | ||
112 | goto err1; | ||
113 | } | ||
114 | |||
115 | retval = usb_add_hcd(hcd, irq, IRQF_SHARED); | ||
116 | if (retval == 0) | ||
117 | return retval; | ||
118 | |||
119 | err1: | ||
120 | usb_put_hcd(hcd); | ||
121 | |||
122 | return retval; | ||
123 | } | ||
124 | |||
125 | static int cns3xxx_ehci_remove(struct platform_device *pdev) | ||
126 | { | ||
127 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | ||
128 | |||
129 | usb_remove_hcd(hcd); | ||
130 | |||
131 | /* | ||
132 | * EHCI and OHCI share the same clock and power, | ||
133 | * resetting twice would cause the 1st controller been reset. | ||
134 | * Therefore only do power up at the first up device, and | ||
135 | * power down at the last down device. | ||
136 | */ | ||
137 | if (atomic_dec_return(&usb_pwr_ref) == 0) | ||
138 | cns3xxx_pwr_clk_dis(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
139 | |||
140 | usb_put_hcd(hcd); | ||
141 | |||
142 | platform_set_drvdata(pdev, NULL); | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | MODULE_ALIAS("platform:cns3xxx-ehci"); | ||
148 | |||
149 | static struct platform_driver cns3xxx_ehci_driver = { | ||
150 | .probe = cns3xxx_ehci_probe, | ||
151 | .remove = cns3xxx_ehci_remove, | ||
152 | .driver = { | ||
153 | .name = "cns3xxx-ehci", | ||
154 | }, | ||
155 | }; | ||
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index add37bc4bc1..28fb5ddaf78 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1259,11 +1259,6 @@ MODULE_LICENSE ("GPL"); | |||
1259 | #define PLATFORM_DRIVER ehci_octeon_driver | 1259 | #define PLATFORM_DRIVER ehci_octeon_driver |
1260 | #endif | 1260 | #endif |
1261 | 1261 | ||
1262 | #ifdef CONFIG_USB_CNS3XXX_EHCI | ||
1263 | #include "ehci-cns3xxx.c" | ||
1264 | #define PLATFORM_DRIVER cns3xxx_ehci_driver | ||
1265 | #endif | ||
1266 | |||
1267 | #ifdef CONFIG_ARCH_VT8500 | 1262 | #ifdef CONFIG_ARCH_VT8500 |
1268 | #include "ehci-vt8500.c" | 1263 | #include "ehci-vt8500.c" |
1269 | #define PLATFORM_DRIVER vt8500_ehci_driver | 1264 | #define PLATFORM_DRIVER vt8500_ehci_driver |