source: trunk/target/linux/brcm47xx/patches-2.6.39/023-usb_ehci_ohci.patch @ 27219

Last change on this file since 27219 was 27219, checked in by hauke, 5 years ago

brcm47xx: refresh patches

File size: 5.0 KB
  • drivers/usb/host/ohci-ssb.c

    a b  
    1717 */ 
    1818#include <linux/ssb/ssb.h> 
    1919 
     20extern int ssb_ehci_attach(struct ssb_device *dev, struct usb_hcd **hcd); 
     21extern void ssb_ehci_detach(struct ssb_device *dev, struct usb_hcd *hcd); 
    2022 
    2123#define SSB_OHCI_TMSLOW_HOSTMODE        (1 << 29) 
    2224 
    struct ssb_ohci_device { 
    2426        struct ohci_hcd ohci; /* _must_ be at the beginning. */ 
    2527 
    2628        u32 enable_flags; 
     29#ifdef CONFIG_USB_EHCI_HCD_SSB 
     30        struct usb_hcd *ehci_hcd; 
     31#endif 
    2732}; 
    2833 
    2934static inline 
    static const struct hc_driver ssb_ohci_h 
    9297static void ssb_ohci_detach(struct ssb_device *dev) 
    9398{ 
    9499        struct usb_hcd *hcd = ssb_get_drvdata(dev); 
     100#ifdef CONFIG_USB_EHCI_HCD_SSB 
     101        struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd); 
     102#endif 
    95103 
    96104        if (hcd->driver->shutdown) 
    97105                hcd->driver->shutdown(hcd); 
    static void ssb_ohci_detach(struct ssb_d 
    99107        iounmap(hcd->regs); 
    100108        release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 
    101109        usb_put_hcd(hcd); 
     110 
     111#ifdef CONFIG_USB_EHCI_HCD_SSB 
     112        /* 
     113         * Also detach ehci function 
     114         */ 
     115        if (dev->id.coreid == SSB_DEV_USB20_HOST) 
     116                ssb_ehci_detach(dev, ohcidev->ehci_hcd); 
     117#endif 
    102118        ssb_device_disable(dev, 0); 
    103119} 
    104120 
    static int ssb_ohci_attach(struct ssb_de 
    121137                /* 
    122138                 * USB 2.0 special considerations: 
    123139                 * 
     140                 * Since the core supports both OHCI and EHCI functions,  
     141                 * it must only be reset once. 
     142                 * 
    124143                 * In addition to the standard SSB reset sequence, the Host 
    125144                 * Control Register must be programmed to bring the USB core 
    126145                 * and various phy components out of reset. 
    static int ssb_ohci_attach(struct ssb_de 
    175194 
    176195        ssb_set_drvdata(dev, hcd); 
    177196 
     197#ifdef CONFIG_USB_EHCI_HCD_SSB 
     198        /* 
     199         *  attach ehci function in this core 
     200         */ 
     201        if (dev->id.coreid == SSB_DEV_USB20_HOST) 
     202                err = ssb_ehci_attach(dev, &(ohcidev->ehci_hcd)); 
     203#endif 
     204 
    178205        return err; 
    179206 
    180207err_iounmap: 
  • drivers/usb/host/ehci-ssb.c

    a b static void ssb_ehci_detach(struct ssb_d 
    106106        iounmap(hcd->regs); 
    107107        release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 
    108108        usb_put_hcd(hcd); 
     109#ifndef CONFIG_USB_OHCI_HCD_SSB 
     110        ssb_device_disable(dev, 0); 
     111#endif 
    109112        ssb_device_disable(dev, 0); 
    110113} 
     114EXPORT_SYMBOL_GPL(ssb_ehci_detach); 
    111115 
     116#ifndef CONFIG_USB_OHCI_HCD_SSB 
    112117static int ssb_ehci_attach(struct ssb_device *dev) 
     118#else 
     119static int ssb_ehci_attach(struct ssb_device *dev, struct usb_hcd **ehci_hcd) 
     120#endif 
    113121{ 
    114122        struct ssb_ehci_device *ehcidev; 
    115123        struct usb_hcd *hcd; 
    static int ssb_ehci_attach(struct ssb_de 
    120128            dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32))) 
    121129                return -EOPNOTSUPP; 
    122130 
     131#ifndef CONFIG_USB_OHCI_HCD_SSB 
    123132        /* 
    124133         * USB 2.0 special considerations: 
    125134         * 
    static int ssb_ehci_attach(struct ssb_de 
    155164                tmp |= 0x1; 
    156165                ssb_write32(dev, 0x89c, tmp); 
    157166        } 
     167#endif 
    158168 
    159169        hcd = usb_create_hcd(&ssb_ehci_hc_driver, dev->dev, 
    160170                             dev_name(dev->dev)); 
    static int ssb_ehci_attach(struct ssb_de 
    175185        if (err) 
    176186                goto err_iounmap; 
    177187 
     188#ifndef CONFIG_USB_OHCI_HCD_SSB 
    178189        ssb_set_drvdata(dev, hcd); 
     190#else 
     191        *ehci_hcd = hcd; 
     192#endif 
    179193 
    180194        return err; 
    181195 
    err_dev_disable: 
    187201        ssb_device_disable(dev, 0); 
    188202        return err; 
    189203} 
     204EXPORT_SYMBOL_GPL(ssb_ehci_attach); 
    190205 
     206#ifndef CONFIG_USB_OHCI_HCD_SSB 
    191207static int ssb_ehci_probe(struct ssb_device *dev, 
    192208                const struct ssb_device_id *id) 
    193209{ 
    static int ssb_ehci_resume(struct ssb_de 
    238254#define ssb_ehci_suspend        NULL 
    239255#define ssb_ehci_resume NULL 
    240256#endif /* CONFIG_PM */ 
     257#endif /* !CONFIG_USB_OHCI_HCD_SSB */ 
    241258 
    242259static const struct ssb_device_id ssb_ehci_table[] = { 
    243260        SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV), 
    static const struct ssb_device_id ssb_eh 
    245262}; 
    246263MODULE_DEVICE_TABLE(ssb, ssb_ehci_table); 
    247264 
     265 
     266#ifndef CONFIG_USB_OHCI_HCD_SSB 
    248267static struct ssb_driver ssb_ehci_driver = { 
    249268        .name           = KBUILD_MODNAME, 
    250269        .id_table       = ssb_ehci_table, 
    static struct ssb_driver ssb_ehci_driver 
    253272        .suspend        = ssb_ehci_suspend, 
    254273        .resume         = ssb_ehci_resume, 
    255274}; 
     275#endif 
  • drivers/usb/host/ehci-hcd.c

    a b static int __init ehci_hcd_init(void) 
    13351335                goto clean4; 
    13361336#endif 
    13371337 
     1338#ifndef CONFIG_USB_OHCI_HCD_SSB 
    13381339#ifdef SSB_EHCI_DRIVER 
    13391340        retval = ssb_driver_register(&SSB_EHCI_DRIVER); 
    13401341        if (retval < 0) 
    13411342                goto clean5; 
    13421343#endif 
     1344#endif /* !CONFIG_USB_OHCI_HCD_SSB */ 
    13431345        return retval; 
    13441346 
     1347#ifndef CONFIG_USB_OHCI_HCD_SSB 
    13451348#ifdef SSB_EHCI_DRIVER 
    13461349        /* ssb_driver_unregister(&SSB_EHCI_DRIVER); */ 
    13471350clean5: 
    13481351#endif 
     1352#endif /* !CONFIG_USB_OHCI_HCD_SSB */ 
    13491353#ifdef XILINX_OF_PLATFORM_DRIVER 
    13501354        platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); 
    13511355clean4: 
    module_init(ehci_hcd_init); 
    13781382 
    13791383static void __exit ehci_hcd_cleanup(void) 
    13801384{ 
     1385#ifndef CONFIG_USB_OHCI_HCD_SSB 
    13811386#ifdef SSB_EHCI_DRIVER 
    13821387        ssb_driver_unregister(&SSB_EHCI_DRIVER); 
    13831388#endif 
     1389#endif /* !CONFIG_USB_OHCI_HCD_SSB */ 
    13841390#ifdef XILINX_OF_PLATFORM_DRIVER 
    13851391        platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); 
    13861392#endif 
Note: See TracBrowser for help on using the repository browser.