1 From 57857d7df6c22eaf11e3c67042d55a9546415059 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 26 Nov 2011 21:36:50 +0100
4 Subject: [PATCH 186/186] USB: OHCI: remove old SSB OHCI driver
6 This is now replaced by the new ssb USB driver, which also supports
7 devices with an EHCI controller.
9 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 drivers/usb/host/Kconfig | 13 --
12 drivers/usb/host/ohci-hcd.c | 21 +----
13 drivers/usb/host/ohci-ssb.c | 260 -------------------------------------------
14 3 files changed, 1 insertions(+), 293 deletions(-)
15 delete mode 100644 drivers/usb/host/ohci-ssb.c
17 --- a/drivers/usb/host/Kconfig
18 +++ b/drivers/usb/host/Kconfig
19 @@ -351,19 +351,6 @@ config USB_OHCI_HCD_PCI
20 Enables support for PCI-bus plug-in USB controller cards.
23 -config USB_OHCI_HCD_SSB
24 - bool "OHCI support for Broadcom SSB OHCI core"
25 - depends on USB_OHCI_HCD && (SSB = y || SSB = USB_OHCI_HCD) && EXPERIMENTAL
28 - Support for the Sonics Silicon Backplane (SSB) attached
29 - Broadcom USB OHCI core.
31 - This device is present in some embedded devices with
32 - Broadcom based SSB bus.
37 bool "OHCI support for SuperH USB controller"
38 depends on USB_OHCI_HCD && SUPERH
39 --- a/drivers/usb/host/ohci-hcd.c
40 +++ b/drivers/usb/host/ohci-hcd.c
41 @@ -1076,11 +1076,6 @@ MODULE_LICENSE ("GPL");
42 #define PS3_SYSTEM_BUS_DRIVER ps3_ohci_driver
45 -#ifdef CONFIG_USB_OHCI_HCD_SSB
46 -#include "ohci-ssb.c"
47 -#define SSB_OHCI_DRIVER ssb_ohci_driver
50 #ifdef CONFIG_MFD_SM501
51 #include "ohci-sm501.c"
52 #define SM501_OHCI_DRIVER ohci_hcd_sm501_driver
53 @@ -1129,8 +1124,7 @@ MODULE_LICENSE ("GPL");
54 !defined(SA1111_DRIVER) && \
55 !defined(PS3_SYSTEM_BUS_DRIVER) && \
56 !defined(SM501_OHCI_DRIVER) && \
57 - !defined(TMIO_OHCI_DRIVER) && \
58 - !defined(SSB_OHCI_DRIVER)
59 + !defined(TMIO_OHCI_DRIVER)
60 #error "missing bus glue for ohci-hcd"
63 @@ -1196,12 +1190,6 @@ static int __init ohci_hcd_mod_init(void
67 -#ifdef SSB_OHCI_DRIVER
68 - retval = ssb_driver_register(&SSB_OHCI_DRIVER);
73 #ifdef SM501_OHCI_DRIVER
74 retval = platform_driver_register(&SM501_OHCI_DRIVER);
76 @@ -1225,10 +1213,6 @@ static int __init ohci_hcd_mod_init(void
77 platform_driver_unregister(&SM501_OHCI_DRIVER);
80 -#ifdef SSB_OHCI_DRIVER
81 - ssb_driver_unregister(&SSB_OHCI_DRIVER);
85 pci_unregister_driver(&PCI_DRIVER);
87 @@ -1276,9 +1260,6 @@ static void __exit ohci_hcd_mod_exit(voi
88 #ifdef SM501_OHCI_DRIVER
89 platform_driver_unregister(&SM501_OHCI_DRIVER);
91 -#ifdef SSB_OHCI_DRIVER
92 - ssb_driver_unregister(&SSB_OHCI_DRIVER);
95 pci_unregister_driver(&PCI_DRIVER);
97 --- a/drivers/usb/host/ohci-ssb.c
101 - * Sonics Silicon Backplane
102 - * Broadcom USB-core OHCI driver
104 - * Copyright 2007 Michael Buesch <m@bues.ch>
106 - * Derived from the OHCI-PCI driver
107 - * Copyright 1999 Roman Weissgaerber
108 - * Copyright 2000-2002 David Brownell
109 - * Copyright 1999 Linus Torvalds
110 - * Copyright 1999 Gregory P. Smith
112 - * Derived from the USBcore related parts of Broadcom-SB
113 - * Copyright 2005 Broadcom Corporation
115 - * Licensed under the GNU/GPL. See COPYING for details.
117 -#include <linux/ssb/ssb.h>
120 -#define SSB_OHCI_TMSLOW_HOSTMODE (1 << 29)
122 -struct ssb_ohci_device {
123 - struct ohci_hcd ohci; /* _must_ be at the beginning. */
129 -struct ssb_ohci_device *hcd_to_ssb_ohci(struct usb_hcd *hcd)
131 - return (struct ssb_ohci_device *)(hcd->hcd_priv);
135 -static int ssb_ohci_reset(struct usb_hcd *hcd)
137 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
138 - struct ohci_hcd *ohci = &ohcidev->ohci;
141 - ohci_hcd_init(ohci);
142 - err = ohci_init(ohci);
147 -static int ssb_ohci_start(struct usb_hcd *hcd)
149 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
150 - struct ohci_hcd *ohci = &ohcidev->ohci;
153 - err = ohci_run(ohci);
155 - ohci_err(ohci, "can't start\n");
162 -static const struct hc_driver ssb_ohci_hc_driver = {
163 - .description = "ssb-usb-ohci",
164 - .product_desc = "SSB OHCI Controller",
165 - .hcd_priv_size = sizeof(struct ssb_ohci_device),
168 - .flags = HCD_MEMORY | HCD_USB11,
170 - .reset = ssb_ohci_reset,
171 - .start = ssb_ohci_start,
173 - .shutdown = ohci_shutdown,
175 - .urb_enqueue = ohci_urb_enqueue,
176 - .urb_dequeue = ohci_urb_dequeue,
177 - .endpoint_disable = ohci_endpoint_disable,
179 - .get_frame_number = ohci_get_frame,
181 - .hub_status_data = ohci_hub_status_data,
182 - .hub_control = ohci_hub_control,
184 - .bus_suspend = ohci_bus_suspend,
185 - .bus_resume = ohci_bus_resume,
188 - .start_port_reset = ohci_start_port_reset,
191 -static void ssb_ohci_detach(struct ssb_device *dev)
193 - struct usb_hcd *hcd = ssb_get_drvdata(dev);
195 - if (hcd->driver->shutdown)
196 - hcd->driver->shutdown(hcd);
197 - usb_remove_hcd(hcd);
198 - iounmap(hcd->regs);
199 - release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
201 - ssb_device_disable(dev, 0);
204 -static int ssb_ohci_attach(struct ssb_device *dev)
206 - struct ssb_ohci_device *ohcidev;
207 - struct usb_hcd *hcd;
209 - u32 tmp, flags = 0;
211 - if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
212 - dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
213 - return -EOPNOTSUPP;
215 - if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV) {
216 - /* Put the device into host-mode. */
217 - flags |= SSB_OHCI_TMSLOW_HOSTMODE;
218 - ssb_device_enable(dev, flags);
219 - } else if (dev->id.coreid == SSB_DEV_USB20_HOST) {
221 - * USB 2.0 special considerations:
223 - * In addition to the standard SSB reset sequence, the Host
224 - * Control Register must be programmed to bring the USB core
225 - * and various phy components out of reset.
227 - ssb_device_enable(dev, 0);
228 - ssb_write32(dev, 0x200, 0x7ff);
230 - /* Change Flush control reg */
231 - tmp = ssb_read32(dev, 0x400);
233 - ssb_write32(dev, 0x400, tmp);
234 - tmp = ssb_read32(dev, 0x400);
236 - /* Change Shim control reg */
237 - tmp = ssb_read32(dev, 0x304);
239 - ssb_write32(dev, 0x304, tmp);
240 - tmp = ssb_read32(dev, 0x304);
244 - /* Work around for 5354 failures */
245 - if (dev->id.revision == 2 && dev->bus->chip_id == 0x5354) {
246 - /* Change syn01 reg */
248 - ssb_write32(dev, 0x894, tmp);
250 - /* Change syn03 reg */
251 - tmp = ssb_read32(dev, 0x89c);
253 - ssb_write32(dev, 0x89c, tmp);
256 - ssb_device_enable(dev, 0);
258 - hcd = usb_create_hcd(&ssb_ohci_hc_driver, dev->dev,
259 - dev_name(dev->dev));
261 - goto err_dev_disable;
262 - ohcidev = hcd_to_ssb_ohci(hcd);
263 - ohcidev->enable_flags = flags;
265 - tmp = ssb_read32(dev, SSB_ADMATCH0);
266 - hcd->rsrc_start = ssb_admatch_base(tmp);
267 - hcd->rsrc_len = ssb_admatch_size(tmp);
268 - hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
271 - err = usb_add_hcd(hcd, dev->irq, IRQF_SHARED);
275 - ssb_set_drvdata(dev, hcd);
280 - iounmap(hcd->regs);
284 - ssb_device_disable(dev, flags);
288 -static int ssb_ohci_probe(struct ssb_device *dev,
289 - const struct ssb_device_id *id)
294 - /* USBcores are only connected on embedded devices. */
295 - chipid_top = (dev->bus->chip_id & 0xFF00);
296 - if (chipid_top != 0x4700 && chipid_top != 0x5300)
299 - /* TODO: Probably need checks here; is the core connected? */
301 - if (usb_disabled())
304 - /* We currently always attach SSB_DEV_USB11_HOSTDEV
305 - * as HOST OHCI. If we want to attach it as Client device,
306 - * we must branch here and call into the (yet to
307 - * be written) Client mode driver. Same for remove(). */
309 - err = ssb_ohci_attach(dev);
314 -static void ssb_ohci_remove(struct ssb_device *dev)
316 - ssb_ohci_detach(dev);
321 -static int ssb_ohci_suspend(struct ssb_device *dev, pm_message_t state)
323 - ssb_device_disable(dev, 0);
328 -static int ssb_ohci_resume(struct ssb_device *dev)
330 - struct usb_hcd *hcd = ssb_get_drvdata(dev);
331 - struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
333 - ssb_device_enable(dev, ohcidev->enable_flags);
335 - ohci_finish_controller_resume(hcd);
339 -#else /* !CONFIG_PM */
340 -#define ssb_ohci_suspend NULL
341 -#define ssb_ohci_resume NULL
342 -#endif /* CONFIG_PM */
344 -static const struct ssb_device_id ssb_ohci_table[] = {
345 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV),
346 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV),
347 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV),
350 -MODULE_DEVICE_TABLE(ssb, ssb_ohci_table);
352 -static struct ssb_driver ssb_ohci_driver = {
353 - .name = KBUILD_MODNAME,
354 - .id_table = ssb_ohci_table,
355 - .probe = ssb_ohci_probe,
356 - .remove = ssb_ohci_remove,
357 - .suspend = ssb_ohci_suspend,
358 - .resume = ssb_ohci_resume,