Lines Matching +full:usb +full:- +full:attach
1 // SPDX-License-Identifier: GPL-2.0
4 * Broadcom USB-core driver (SSB bus glue)
6 * Copyright 2011-2012 Hauke Mehrtens <hauke@hauke-m.de>
8 * Based on ssb-ohci driver
11 * Derived from the OHCI-PCI driver
13 * Copyright 2000-2002 David Brownell
17 * Derived from the USBcore related parts of Broadcom-SB
18 * Copyright 2005-2011 Broadcom Corporation
25 #include <linux/usb/ehci_pdriver.h>
26 #include <linux/usb/ohci_pdriver.h>
29 MODULE_DESCRIPTION("Common USB driver for SSB Bus");
45 if (dev->id.revision == 2 && dev->bus->chip_id == 0x5354) { in ssb_hcd_5354wa()
57 if (dev->id.coreid == SSB_DEV_USB20_HOST) { in ssb_hcd_usb20wa()
59 * USB 2.0 special considerations: in ssb_hcd_usb20wa()
62 * Control Register must be programmed to bring the USB core in ssb_hcd_usb20wa()
81 /* based on arch/mips/brcm-boards/bcm947xx/pcibios.c */
86 if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV) in ssb_hcd_init_chip()
87 /* Put the device into host-mode. */ in ssb_hcd_init_chip()
112 hci_res[0].end = hci_res[0].start + len - 1; in ssb_hcd_create_pdev()
115 hci_res[1].start = dev->irq; in ssb_hcd_create_pdev()
118 hci_dev = platform_device_alloc(ohci ? "ohci-platform" : in ssb_hcd_create_pdev()
119 "ehci-platform" , 0); in ssb_hcd_create_pdev()
121 return ERR_PTR(-ENOMEM); in ssb_hcd_create_pdev()
123 hci_dev->dev.parent = dev->dev; in ssb_hcd_create_pdev()
124 hci_dev->dev.dma_mask = &hci_dev->dev.coherent_dma_mask; in ssb_hcd_create_pdev()
155 u16 coreid = dev->id.coreid; in ssb_hcd_probe()
159 chipid_top = (dev->bus->chip_id & 0xFF00); in ssb_hcd_probe()
161 return -ENODEV; in ssb_hcd_probe()
165 if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32))) in ssb_hcd_probe()
166 return -EOPNOTSUPP; in ssb_hcd_probe()
168 usb_dev = devm_kzalloc(dev->dev, sizeof(struct ssb_hcd_device), in ssb_hcd_probe()
171 return -ENOMEM; in ssb_hcd_probe()
173 /* We currently always attach SSB_DEV_USB11_HOSTDEV in ssb_hcd_probe()
174 * as HOST OHCI. If we want to attach it as Client device, in ssb_hcd_probe()
177 usb_dev->enable_flags = ssb_hcd_init_chip(dev); in ssb_hcd_probe()
183 usb_dev->ohci_dev = ssb_hcd_create_pdev(dev, true, start, len); in ssb_hcd_probe()
184 if (IS_ERR(usb_dev->ohci_dev)) in ssb_hcd_probe()
185 return PTR_ERR(usb_dev->ohci_dev); in ssb_hcd_probe()
189 usb_dev->ehci_dev = ssb_hcd_create_pdev(dev, false, start, len); in ssb_hcd_probe()
190 if (IS_ERR(usb_dev->ehci_dev)) { in ssb_hcd_probe()
191 err = PTR_ERR(usb_dev->ehci_dev); in ssb_hcd_probe()
200 platform_device_unregister(usb_dev->ohci_dev); in ssb_hcd_probe()
207 struct platform_device *ohci_dev = usb_dev->ohci_dev; in ssb_hcd_remove()
208 struct platform_device *ehci_dev = usb_dev->ehci_dev; in ssb_hcd_remove()
236 ssb_device_enable(dev, usb_dev->enable_flags); in ssb_hcd_resume()