@@ -17,6 +17,7 @@
#include <linux/platform_device.h>
#include <linux/usb/xhci_pdriver.h>
+#include <linux/of_device.h>
#include "core.h"
@@ -35,8 +36,6 @@ int dwc3_host_init(struct dwc3 *dwc)
dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);
xhci->dev.parent = dwc->dev;
- xhci->dev.dma_mask = dwc->dev->dma_mask;
- xhci->dev.dma_parms = dwc->dev->dma_parms;
dwc->xhci = xhci;
@@ -62,6 +61,12 @@ int dwc3_host_init(struct dwc3 *dwc)
phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy",
dev_name(&xhci->dev));
+ if (!dwc->dev->of_node) {
+ xhci->dev.dma_mask = dwc->dev->dma_mask;
+ xhci->dev.dma_parms = dwc->dev->dma_parms;
+ } else
+ of_dma_configure(&xhci->dev, dwc->dev->of_node);
+
ret = platform_device_add(xhci);
if (ret) {
dev_err(dwc->dev, "failed to register xHCI device\n");