[PATCH 5/5] usb: chipidea: tegra: enable tegra-udc host mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the functions to the chipidea host driver to enable tegra specific
dma alignment and reset handlers.

Signed-off-by: Peter Geis <pgwipeout@xxxxxxxxx>
---
 drivers/usb/chipidea/ci_hdrc_tegra.c |  7 +++++++
 drivers/usb/chipidea/host.c          | 13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c
index 29415c3a2f48..2f7d542d2273 100644
--- a/drivers/usb/chipidea/ci_hdrc_tegra.c
+++ b/drivers/usb/chipidea/ci_hdrc_tegra.c
@@ -118,6 +118,13 @@ static int tegra_udc_probe(struct platform_device *pdev)
 	udc->data.usb_phy = udc->phy;
 	udc->data.capoffset = DEF_CAPOFFSET;
 
+	/* check the double reset flag */
+	if (of_property_read_bool(pdev->dev.of_node,
+				"nvidia,needs-double-reset")) {
+		dev_dbg(&pdev->dev, "setting double reset flag\n");
+		udc->data.flags |= CI_HDRC_TEGRA_DOUBLE_RESET;
+	}
+
 	udc->dev = ci_hdrc_add_device(&pdev->dev, pdev->resource,
 				      pdev->num_resources, &udc->data);
 	if (IS_ERR(udc->dev)) {
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index b45ceb91c735..e95b7cb8c54d 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -20,6 +20,7 @@
 #include "ci.h"
 #include "bits.h"
 #include "host.h"
+#include "tegra.h"
 
 static struct hc_driver __read_mostly ci_ehci_hc_driver;
 static int (*orig_bus_suspend)(struct usb_hcd *hcd);
@@ -275,6 +276,13 @@ static int ci_ehci_hub_control(
 		goto done;
 	}
 
+	/* For Tegra USB1 port we need to issue Port Reset twice internally */
+	if (ci->platdata->flags & CI_HDRC_TEGRA_DOUBLE_RESET &&
+	(typeReq == SetPortFeature && wValue == USB_PORT_FEAT_RESET)) {
+		spin_unlock_irqrestore(&ehci->lock, flags);
+		return tegra_ehci_internal_port_reset(ehci, status_reg);
+	}
+
 	/*
 	 * After resume has finished, it needs do some post resume
 	 * operation for some SoCs.
@@ -364,6 +372,11 @@ int ci_hdrc_host_init(struct ci_hdrc *ci)
 	rdrv->name	= "host";
 	ci->roles[CI_ROLE_HOST] = rdrv;
 
+	if (ci->platdata->flags & CI_HDRC_TEGRA_HOST) {
+		ci_ehci_hc_driver.map_urb_for_dma = tegra_ehci_map_urb_for_dma;
+		ci_ehci_hc_driver.unmap_urb_for_dma = tegra_ehci_unmap_urb_for_dma;
+	}
+
 	return 0;
 }
 
-- 
2.17.1




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux