diff options
author | Felipe Balbi <balbi@ti.com> | 2013-06-30 14:19:33 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-07-29 13:56:46 +0300 |
commit | 6462cbd54d2fa649b27633267d8ddf835705e47a (patch) | |
tree | e1f6634558af44b76f2b81308b44a6878406bedc /drivers/usb/dwc3/core.c | |
parent | 1494a1f62bf7cf57345e9282c8189fe2a21fab64 (diff) | |
download | linux-6462cbd54d2fa649b27633267d8ddf835705e47a.tar.gz linux-6462cbd54d2fa649b27633267d8ddf835705e47a.tar.bz2 linux-6462cbd54d2fa649b27633267d8ddf835705e47a.zip |
usb: dwc3: let non-DT platforms pass tx-fifo-resize flag;
in case we're not in a DT boot, we should
still be able to tell the driver how to behave.
In order to be able to pass flags to the driver,
we introduce platform_data structure which the
core driver should use.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r-- | drivers/usb/dwc3/core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index f69e45a50039..cb1eb37c6d6c 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -37,6 +37,7 @@ #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> +#include "platform_data.h" #include "core.h" #include "gadget.h" #include "io.h" @@ -350,6 +351,7 @@ static void dwc3_core_exit(struct dwc3 *dwc) static int dwc3_probe(struct platform_device *pdev) { + struct dwc3_platform_data *pdata = pdev->dev.platform_data; struct device_node *node = pdev->dev.of_node; struct resource *res; struct dwc3 *dwc; @@ -412,9 +414,13 @@ static int dwc3_probe(struct platform_device *pdev) if (node) { dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0); dwc->usb3_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 1); + + dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize"); } else { dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); + + dwc->needs_fifo_resize = pdata->tx_fifo_resize; } if (IS_ERR(dwc->usb2_phy)) { @@ -472,8 +478,6 @@ static int dwc3_probe(struct platform_device *pdev) else dwc->maximum_speed = DWC3_DCFG_SUPERSPEED; - dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize"); - pm_runtime_enable(dev); pm_runtime_get_sync(dev); pm_runtime_forbid(dev); |