aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/chipidea/ci_hdrc_imx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index de155c80eb70..e431c5aafe35 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -83,6 +83,7 @@ struct ci_hdrc_imx_data {
83 struct clk *clk; 83 struct clk *clk;
84 struct imx_usbmisc_data *usbmisc_data; 84 struct imx_usbmisc_data *usbmisc_data;
85 bool supports_runtime_pm; 85 bool supports_runtime_pm;
86 bool override_phy_control;
86 bool in_lpm; 87 bool in_lpm;
87 /* SoC before i.mx6 (except imx23/imx28) needs three clks */ 88 /* SoC before i.mx6 (except imx23/imx28) needs three clks */
88 bool need_three_clks; 89 bool need_three_clks;
@@ -254,6 +255,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
254 int ret; 255 int ret;
255 const struct of_device_id *of_id; 256 const struct of_device_id *of_id;
256 const struct ci_hdrc_imx_platform_flag *imx_platform_flag; 257 const struct ci_hdrc_imx_platform_flag *imx_platform_flag;
258 struct device_node *np = pdev->dev.of_node;
257 259
258 of_id = of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev); 260 of_id = of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev);
259 if (!of_id) 261 if (!of_id)
@@ -288,6 +290,14 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
288 } 290 }
289 291
290 pdata.usb_phy = data->phy; 292 pdata.usb_phy = data->phy;
293
294 if (of_device_is_compatible(np, "fsl,imx53-usb") && pdata.usb_phy &&
295 of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) {
296 pdata.flags |= CI_HDRC_OVERRIDE_PHY_CONTROL;
297 data->override_phy_control = true;
298 usb_phy_init(pdata.usb_phy);
299 }
300
291 pdata.flags |= imx_platform_flag->flags; 301 pdata.flags |= imx_platform_flag->flags;
292 if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM) 302 if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM)
293 data->supports_runtime_pm = true; 303 data->supports_runtime_pm = true;
@@ -341,6 +351,8 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev)
341 pm_runtime_put_noidle(&pdev->dev); 351 pm_runtime_put_noidle(&pdev->dev);
342 } 352 }
343 ci_hdrc_remove_device(data->ci_pdev); 353 ci_hdrc_remove_device(data->ci_pdev);
354 if (data->override_phy_control)
355 usb_phy_shutdown(data->phy);
344 imx_disable_unprepare_clks(&pdev->dev); 356 imx_disable_unprepare_clks(&pdev->dev);
345 357
346 return 0; 358 return 0;