aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-07 10:09:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-07 10:09:55 -0700
commit23063b378de734383c9f42de770b01cd661cd9b4 (patch)
treee02c091743d8880e2bc8f37044b280a61714065d /drivers/usb/dwc3/core.c
parenta5c708e84140bb19553303531316c540396a3a33 (diff)
parent3ef35fafdc87b72851f7785dc5331a0f4eb1b3ce (diff)
Merge tag 'dwc3-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
usb: dwc3: patches for v3.5 merge window This pull request contains one workaround for a Silicon Issue found on all RTL releases prior to 2.20a, which would cause a metastability state on Run/Stop bit. We also have some patches implementing a few extra Standard requests introduced by USB3 spec (Set SEL and Set Isoch Delay), as well as one patch, which has been pending for a long time, implementing LPM support. Last, but not least, we are splitting the host address space out of the dwc3 core driver otherwise xHCI won't be able to request_mem_region() its own address space. This patch is only needed because we are (as we should) re-using the xHCI driver, which is a completely separate module. Together with these three big changes, come a few extra preparatory patches which most move code around, define macros and so on, as well as a fix for Isochronous transfers which hasn't been triggered before. [ resolved conflicts and build error in drivers/usb/dwc3/gadget.c - gregkh]
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r--drivers/usb/dwc3/core.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 99b58d84553..1040bdb8dc8 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -410,7 +410,6 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
int ret = -ENOMEM;
- int irq;
void __iomem *regs;
void *mem;
@@ -425,15 +424,28 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
dwc->mem = mem;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
- dev_err(dev, "missing resource\n");
+ dev_err(dev, "missing IRQ\n");
return -ENODEV;
}
+ dwc->xhci_resources[1] = *res;
- dwc->res = res;
-
- res = devm_request_mem_region(dev, res->start, resource_size(res),
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(dev, "missing memory resource\n");
+ return -ENODEV;
+ }
+ dwc->xhci_resources[0] = *res;
+ dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
+ DWC3_XHCI_REGS_END;
+
+ /*
+ * Request memory region but exclude xHCI regs,
+ * since it will be requested by the xhci-plat driver.
+ */
+ res = devm_request_mem_region(dev, res->start + DWC3_GLOBALS_REGS_START,
+ resource_size(res) - DWC3_GLOBALS_REGS_START,
dev_name(dev));
if (!res) {
dev_err(dev, "can't request mem region\n");
@@ -446,19 +458,12 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
return -ENOMEM;
}
- irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- dev_err(dev, "missing IRQ\n");
- return -ENODEV;
- }
-
spin_lock_init(&dwc->lock);
platform_set_drvdata(pdev, dwc);
dwc->regs = regs;
dwc->regs_size = resource_size(res);
dwc->dev = dev;
- dwc->irq = irq;
if (!strncmp("super", maximum_speed, 5))
dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;