diff options
author | Felipe Balbi <balbi@ti.com> | 2011-10-12 14:08:26 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-12 11:48:12 +0200 |
commit | d07e8819a03dc2d1f03f725194ae56544e6c680b (patch) | |
tree | 0715634a05d360ef7939fd0c23befaf11c40919a /drivers/usb/dwc3/core.c | |
parent | 0949e99b05736946cf0ac78e37194be0807e497e (diff) | |
download | linux-d07e8819a03dc2d1f03f725194ae56544e6c680b.tar.bz2 |
usb: dwc3: add xHCI Host support
The Designware USB3 IP can be configured with
an internal xHCI. If we're running on such a
version, let's start the xHCI stack.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r-- | drivers/usb/dwc3/core.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index df151992e49d..410835e28cf6 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -350,6 +350,8 @@ static int __devinit dwc3_probe(struct platform_device *pdev) goto err1; } + dwc->res = res; + res = request_mem_region(res->start, resource_size(res), dev_name(&pdev->dev)); if (!res) { @@ -401,7 +403,6 @@ static int __devinit dwc3_probe(struct platform_device *pdev) mode = DWC3_MODE(dwc->hwparams.hwparams0); switch (mode) { - case DWC3_MODE_DRD: case DWC3_MODE_DEVICE: ret = dwc3_gadget_init(dwc); if (ret) { @@ -409,6 +410,26 @@ static int __devinit dwc3_probe(struct platform_device *pdev) goto err4; } break; + case DWC3_MODE_HOST: + ret = dwc3_host_init(dwc); + if (ret) { + dev_err(&pdev->dev, "failed to initialize host\n"); + goto err4; + } + break; + case DWC3_MODE_DRD: + ret = dwc3_host_init(dwc); + if (ret) { + dev_err(&pdev->dev, "failed to initialize host\n"); + goto err4; + } + + ret = dwc3_gadget_init(dwc); + if (ret) { + dev_err(&pdev->dev, "failed to initialize gadget\n"); + goto err4; + } + break; default: dev_err(&pdev->dev, "Unsupported mode of operation %d\n", mode); goto err4; @@ -427,10 +448,16 @@ static int __devinit dwc3_probe(struct platform_device *pdev) err5: switch (mode) { - case DWC3_MODE_DRD: case DWC3_MODE_DEVICE: dwc3_gadget_exit(dwc); break; + case DWC3_MODE_HOST: + dwc3_host_exit(dwc); + break; + case DWC3_MODE_DRD: + dwc3_host_exit(dwc); + dwc3_gadget_exit(dwc); + break; default: /* do nothing */ break; @@ -465,10 +492,16 @@ static int __devexit dwc3_remove(struct platform_device *pdev) dwc3_debugfs_exit(dwc); switch (dwc->mode) { - case DWC3_MODE_DRD: case DWC3_MODE_DEVICE: dwc3_gadget_exit(dwc); break; + case DWC3_MODE_HOST: + dwc3_host_exit(dwc); + break; + case DWC3_MODE_DRD: + dwc3_host_exit(dwc); + dwc3_gadget_exit(dwc); + break; default: /* do nothing */ break; |