static int __init ehci_orion_init(void) { if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "\n", hcd_name); ehci_init_driver(&ehci_orion_hc_driver, NULL); return platform_driver_register(&ehci_orion_driver); }
static int ohci_hcd_mcs814x_drv_probe(struct platform_device *pdev) { int ret; ret = -ENODEV; if (!usb_disabled()) ret = usb_hcd_mcs814x_probe(&ohci_mcs814x_hc_driver, pdev); return ret; }
static int __init ohci_omap_init(void) { if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "\n", hcd_name); ohci_init_driver(&ohci_omap_hc_driver, &omap_overrides); return platform_driver_register(&ohci_hcd_omap_driver); }
static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev) { int ret; if (usb_disabled()) return -ENODEV; ret = usb_hcd_ppc_soc_probe(&ohci_ppc_soc_hc_driver, pdev); return ret; }
static int __init ohci_hcd_pci_init (void) { printk (KERN_DEBUG "%s: " DRIVER_INFO " (PCI)\n", hcd_name); if (usb_disabled()) return -ENODEV; pr_debug ("%s: block sizes: ed %Zd td %Zd\n", hcd_name, sizeof (struct ed), sizeof (struct td)); return pci_register_driver (&ohci_pci_driver); }
static int ohci_hcd_sa1111_drv_probe(struct sa1111_dev *dev) { int ret; if (usb_disabled()) return -ENODEV; ret = usb_hcd_sa1111_probe(&ohci_sa1111_hc_driver, dev); return ret; }
static int __init ehci_msm2_init(void) { if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "\n", hcd_name); ehci_init_driver(&ehci_msm2_hc_driver, &ehci_msm2_overrides); return platform_driver_register(&ehci_msm2_driver); }
static int ohci_hcd_rtl8652_drv_probe(struct platform_device *pdev) { int ret; ret = -ENODEV; if (!usb_disabled()) { ret = usb_hcd_rtl8652_probe(&ohci_rtl8652_hc_driver, pdev); } return ret; }
static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct resource *res; int irq; int ret; if (usb_disabled()) return -ENODEV; irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENXIO; hcd = usb_create_hcd(&ohci_ep93xx_hc_driver, &pdev->dev, "ep93xx"); if (!hcd) return -ENOMEM; hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(hcd->regs)) { ret = PTR_ERR(hcd->regs); goto err_put_hcd; } usb_host_clock = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(usb_host_clock)) { ret = PTR_ERR(usb_host_clock); goto err_put_hcd; } clk_enable(usb_host_clock); ohci_hcd_init(hcd_to_ohci(hcd)); ret = usb_add_hcd(hcd, irq, 0); if (ret) goto err_clk_disable; return 0; err_clk_disable: clk_disable(usb_host_clock); err_put_hcd: usb_put_hcd(hcd); return ret; }
static int ehci_drv_ar9130_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct usb_hcd *hcd = dev_get_drvdata(dev); if(usb_disabled()){ ar9130_error("USB_DISABLED \n"); return -ENODEV; } return usb_ehci_ar9130_probe(&ehci_hc_ar9130_driver,&hcd,pdev); }
static int __init ohci_pxa27x_init(void) { if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "\n", hcd_name); ohci_init_driver(&ohci_pxa27x_hc_driver, &pxa27x_overrides); ohci_pxa27x_hc_driver.hub_control = pxa27x_ohci_hub_control; return platform_driver_register(&ohci_hcd_pxa27x_driver); }
static int ehci_hcd_ls1x_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct resource *res; int irq; int ret; pr_debug("initializing loongson1 ehci USB Controller\n"); if (usb_disabled()) return -ENODEV; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(&pdev->dev, "Found HC with no IRQ. Check %s setup!\n", dev_name(&pdev->dev)); return -ENODEV; } irq = res->start; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "Found HC with no register addr. Check %s setup!\n", dev_name(&pdev->dev)); return -ENODEV; } hcd = usb_create_hcd(&ehci_ls1x_hc_driver, &pdev->dev, dev_name(&pdev->dev)); if (!hcd) return -ENOMEM; hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_request_and_ioremap(&pdev->dev, res); if (hcd->regs == NULL) { dev_dbg(&pdev->dev, "error mapping memory\n"); ret = -EFAULT; goto err_put_hcd; } ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto err_put_hcd; return ret; err_put_hcd: usb_put_hcd(hcd); return ret; }
static int ohci_hcd_ep93xx_drv_probe(struct platform_device *dev) { struct platform_device *pdev = dev;/*to_platform_device(dev);*/ int ret; if (usb_disabled()) return -ENODEV; ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev); return ret; }
static int __init str9100_ehci_hcd_init(void) { if (usb_disabled()) return -ENODEV; pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", hcd_name, sizeof(struct ehci_qh), sizeof(struct ehci_qtd), sizeof(struct ehci_itd), sizeof(struct ehci_sitd)); return platform_driver_register(&str9100_ehci_hcd_driver); }
/***************************************************************** * * Function Name: hci_hcd_init * * This is an init function, and it is the first function being called * * Input: none * * Return: 0 = success or error condition * *****************************************************************/ static int __init hci_hcd_init (void) { int ret; DBGFUNC ("Enter hci_hcd_init\n"); if (usb_disabled()) return -ENODEV; ret = hc_found_hci (base_addr, data_reg_addr, irq); return ret; }
static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev) { int ret; pr_debug ("In ohci_hcd_lh7a404_drv_probe"); if (usb_disabled()) return -ENODEV; ret = usb_hcd_lh7a404_probe(&ohci_lh7a404_hc_driver, pdev); return ret; }
static int vt8500_ehci_drv_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct ehci_hcd *ehci; struct resource *res; int ret; if (usb_disabled()) return -ENODEV; if (pdev->resource[1].flags != IORESOURCE_IRQ) { pr_debug("resource[1] is not IORESOURCE_IRQ"); return -ENOMEM; } hcd = usb_create_hcd(&vt8500_ehci_hc_driver, &pdev->dev, "VT8500"); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { pr_debug("request_mem_region failed"); ret = -EBUSY; goto err1; } hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!hcd->regs) { pr_debug("ioremap failed"); ret = -ENOMEM; goto err2; } ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); if (ret == 0) { platform_set_drvdata(pdev, hcd); return ret; } iounmap(hcd->regs); err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err1: usb_put_hcd(hcd); return ret; }
static int ohci_hcd_pxa27x_drv_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); int ret; pr_debug ("In ohci_hcd_pxa27x_drv_probe"); if (usb_disabled()) return -ENODEV; ret = usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev); return ret; }
static int __init ehci_s5p_init(void) { if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "\n", hcd_name); ehci_init_driver(&s5p_ehci_hc_driver, &s5p_overrides); bus_resume = s5p_ehci_hc_driver.bus_resume; s5p_ehci_hc_driver.bus_resume = s5p_ehci_bus_resume; return platform_driver_register(&s5p_ehci_driver); }
static int ehci_rtl819x_driver_probe(struct platform_device *pdev) { struct usb_hcd *hcd = NULL; int ret; if (usb_disabled()) return -ENODEV; ret = ehci_rtl819x_probe(&ehci_rtl819x_hc_driver, &hcd, pdev); //ret = usb_hcd_rtl8652_probe(&ehci_rtl819x_hc_driver, pdev); return ret; }
static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) { struct usb_hcd *hcd = NULL; int ret; pr_debug("In ehci_hcd_au1xxx_drv_probe\n"); if (usb_disabled()) return -ENODEV; ret = usb_ehci_au1xxx_probe(&ehci_au1xxx_hc_driver, &hcd, pdev); return ret; }
/* * Init */ static int __init usb_init(void) { int retval; if (usb_disabled()) { pr_info("%s: USB support disabled\n", usbcore_name); return 0; } usb_init_pool_max(); usb_debugfs_init(); usb_acpi_register(); retval = bus_register(&usb_bus_type); if (retval) goto bus_register_failed; retval = bus_register_notifier(&usb_bus_type, &usb_bus_nb); if (retval) goto bus_notifier_failed; retval = usb_major_init(); if (retval) goto major_init_failed; retval = usb_register(&usbfs_driver); if (retval) goto driver_register_failed; retval = usb_devio_init(); if (retval) goto usb_devio_init_failed; retval = usb_hub_init(); if (retval) goto hub_init_failed; retval = usb_register_device_driver(&usb_generic_driver, THIS_MODULE); if (!retval) goto out; usb_hub_cleanup(); hub_init_failed: usb_devio_cleanup(); usb_devio_init_failed: usb_deregister(&usbfs_driver); driver_register_failed: usb_major_cleanup(); major_init_failed: bus_unregister_notifier(&usb_bus_type, &usb_bus_nb); bus_notifier_failed: bus_unregister(&usb_bus_type); bus_register_failed: usb_acpi_unregister(); usb_debugfs_cleanup(); out: return retval; }
static int vt8500_ehci_drv_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct ehci_hcd *ehci; struct resource *res; int ret; if (usb_disabled()) return -ENODEV; /* * Right now device-tree probed devices don't get dma_mask set. * Since shared usb code relies on it, set it here for now. * Once we have dma capability bindings this can go away. */ if (!pdev->dev.dma_mask) pdev->dev.dma_mask = &vt8500_ehci_dma_mask; if (pdev->resource[1].flags != IORESOURCE_IRQ) { pr_debug("resource[1] is not IORESOURCE_IRQ"); return -ENOMEM; } hcd = usb_create_hcd(&vt8500_ehci_hc_driver, &pdev->dev, "VT8500"); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_request_and_ioremap(&pdev->dev, res); if (!hcd->regs) { pr_debug("ioremap failed"); ret = -ENOMEM; goto err1; } ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); if (ret == 0) { platform_set_drvdata(pdev, hcd); return ret; } err1: usb_put_hcd(hcd); return ret; }
static int hiusb_ohci_hcd_drv_probe(struct platform_device *pdev) { int ret; struct usb_hcd *hcd; if (usb_disabled()) return -ENODEV; if (pdev->resource[1].flags != IORESOURCE_IRQ) { pr_debug("resource[1] is not IORESOURCE_IRQ\n"); return -ENOMEM; } hcd = usb_create_hcd(&hiusb_ohci_hc_driver, &pdev->dev, "hiusb-ohci"); if (!hcd) return -ENOMEM; hcd->rsrc_start = pdev->resource[0].start; hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { pr_debug("request_mem_region failed\n"); ret = -EBUSY; goto err1; } hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!hcd->regs) { pr_debug("ioremap failed\n"); ret = -ENOMEM; goto err2; } hiusb_start_hcd(); ohci_hcd_init(hcd_to_ohci(hcd)); ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED | IRQF_SHARED); if (ret == 0) { platform_set_drvdata(pdev, hcd); return ret; } hiusb_stop_hcd(); iounmap(hcd->regs); err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err1: usb_put_hcd(hcd); return ret; }
static int ohci_hcd_brcm_probe(struct platform_device *pdev) { struct resource *res = NULL; struct usb_hcd *hcd = NULL; int irq = -1; int ret; if (usb_disabled()) return -ENODEV; /* clear this to enable Port Power management */ distrust_firmware = 0; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { err("platform_get_resource error."); return -ENODEV; } irq = platform_get_irq(pdev, 0); if (irq < 0) { err("platform_get_irq error."); return -ENODEV; } #ifndef CONFIG_USB_EHCI_HCD // Init common registers for board and HC specific issues brcm_usb_init(); #endif /* initialize hcd */ hcd = usb_create_hcd(&ohci_brcm_hc_driver, &pdev->dev, (char *)hcd_name); if (!hcd) { err("Failed to create hcd"); return -ENOMEM; } hcd->regs = ioremap(res->start, res->end - res->start); hcd->rsrc_start = res->start; hcd->rsrc_len = resource_len(res); ret = usb_add_hcd(hcd, irq, IRQF_DISABLED); if (ret != 0) { err("Failed to add hcd"); usb_put_hcd(hcd); iounmap(hcd->regs); return ret; } return ret; }
static int uhci_hcd_platform_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct uhci_hcd *uhci; struct resource *res; int ret; if (usb_disabled()) return -ENODEV; /* * Right now device-tree probed devices don't get dma_mask set. * Since shared usb code relies on it, set it here for now. * Once we have dma capability bindings this can go away. */ ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (ret) return ret; hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, pdev->name); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(hcd->regs)) { ret = PTR_ERR(hcd->regs); goto err_rmr; } hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); uhci = hcd_to_uhci(hcd); uhci->regs = hcd->regs; ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); if (ret) goto err_rmr; device_wakeup_enable(hcd->self.controller); return 0; err_rmr: usb_put_hcd(hcd); return ret; }
static int cns3xxx_ehci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct usb_hcd *hcd; const struct hc_driver *driver = &cns3xxx_ehci_hc_driver; struct resource *res; int irq; int retval; if (usb_disabled()) return -ENODEV; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(dev, "Found HC with no IRQ.\n"); return -ENODEV; } irq = res->start; hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); if (!hcd) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(dev, "Found HC with no register addr.\n"); retval = -ENODEV; goto err1; } hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); hcd->regs = devm_request_and_ioremap(&pdev->dev, res); if (hcd->regs == NULL) { dev_dbg(dev, "error mapping memory\n"); retval = -EFAULT; goto err1; } retval = usb_add_hcd(hcd, irq, IRQF_SHARED); if (retval == 0) return retval; err1: usb_put_hcd(hcd); return retval; }
static int ohci_hcd_omap_drv_probe(struct omap_dev *dev) { struct usb_hcd *hcd = NULL; int ret; if (usb_disabled()) return -ENODEV; ret = usb_hcd_omap_probe(&ohci_omap_hc_driver, &hcd, dev); if (ret == 0) omap_set_drvdata(dev, hcd); return ret; }
static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct usb_hcd *hcd = NULL; int ret; if (usb_disabled()) return -ENODEV; ret = usb_hcd_ppc_soc_probe(&ohci_ppc_soc_hc_driver, &hcd, pdev); if (ret == 0) dev_set_drvdata(dev, hcd); return ret; }
static int __init ohci_pci_init(void) { if (usb_disabled()) return -ENODEV; pr_info("%s: " DRIVER_DESC "\n", hcd_name); ohci_init_driver(&ohci_pci_hc_driver, &pci_overrides); #ifdef CONFIG_PM /* Entries for the PCI suspend/resume callbacks are special */ ohci_pci_hc_driver.pci_suspend = ohci_suspend; ohci_pci_hc_driver.pci_resume = ohci_resume; #endif return pci_register_driver(&ohci_pci_driver); }