summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary King <gking@nvidia.com>2010-06-21 10:41:14 -0700
committerGary King <gking@nvidia.com>2010-06-22 16:39:53 -0700
commitdb47e4a3e890c34cb6fd73cb817ef4edfbd5f9d9 (patch)
treef51079d27f23b366e82a838e037b342ff5a691ec
parent5179ed331c337c7dfe245f6e4a34206266c7d4f3 (diff)
tegra-ehci: enable DMABOUNCE for tegra EHCI controller
tegra 2 EHCI controllers need transfers aligned to 32B boundaries; enable DMABOUNCE by default whenever USB_TEGRA_HCD is selected, and create DMA pools for the EHCI devices Change-Id: I6c391a52370e19c904cab714a4ebd223c7647329 Reviewed-on: http://git-master.nvidia.com/r/2959 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
-rw-r--r--drivers/usb/host/Kconfig1
-rw-r--r--drivers/usb/host/ehci-tegra.c23
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 83012eaa6ea1..eae8063ded91 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -386,6 +386,7 @@ config USB_TEGRA_HCD
boolean "NVIDIA Tegra HCD support"
depends on USB && ARCH_TEGRA && USB_EHCI_HCD
select USB_EHCI_ROOT_HUB_TT
+ select DMABOUNCE
help
This driver enables support for the internal USB Host Controller
found in NVIDIA Tegra SoCs. The Tegra controller is EHCI compliant.
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 32dba3a84fb2..a5a32021f2a6 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -563,13 +563,21 @@ static int tegra_ehci_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, hcd);
+#ifdef CONFIG_DMABOUNCE
+ e = dmabounce_register_dev(&pdev->dev, 1024, 32768);
+ if (e != 0) {
+ dev_err(&pdev->dev, "failed to register DMA bounce\n");
+ goto fail_add;
+ }
+#endif
+
#ifdef CONFIG_USB_OTG_UTILS
if (pdata->otg_mode) {
ehci->transceiver = otg_get_transceiver();
if (!ehci->transceiver) {
dev_err(&pdev->dev, "Failed to get OTG transceiver\n");
e = -ENODEV;
- goto fail_add;
+ goto fail_dmabounce;
}
otg_set_host(ehci->transceiver, (struct usb_bus *)hcd);
@@ -610,6 +618,10 @@ static int tegra_ehci_probe(struct platform_device *pdev)
return 0;
+fail_dmabounce:
+#ifdef CONFIG_DMABOUNCE
+ dmabounce_unregister_dev(&pdev->dev);
+#endif
fail_add:
usb_remove_hcd(hcd);
fail_iomap:
@@ -713,12 +725,17 @@ static int tegra_ehci_remove(struct platform_device *pdev)
if (pdata == NULL || hcd == NULL)
return -EINVAL;
+ usb_remove_hcd(hcd);
+ usb_put_hcd(hcd);
+
+#ifdef CONFIG_DMABOUNCE
+ dmabounce_unregister_dev(&pdev->dev);
+#endif
+
NvDdkUsbPhyClose(pdata->hUsbPhy);
iounmap(hcd->regs);
- usb_remove_hcd(hcd);
- usb_put_hcd(hcd);
if (pdata->gpio_nr)
gpio_free(pdata->gpio_nr);