return _exynos5_usb_phy30_init(pdev, use_ext_clk);
}
-static int exynos5_usb_phy30_init(struct platform_device *pdev)
+static int exynos5_usb_phy30_init(struct platform_device *pdev, bool ext_clk)
{
int ret;
struct clk *host_clk = NULL;
return -ENODEV;
}
- /*
- * We'll start out with the XusbXTI turned on
- * for phy reference clock refclksel [3:2]
- */
- ret = _exynos5_usb_phy30_init(pdev, true);
+ ret = _exynos5_usb_phy30_init(pdev, ext_clk);
exynos_usb_phy_clock_disable(host_clk);
return 0;
}
-int s5p_usb_phy_init(struct platform_device *pdev, int type)
+int s5p_usb_phy_init(struct platform_device *pdev, int type, bool ext_clk)
{
if (type == S5P_USB_PHY_HOST) {
if (soc_is_exynos5250())
return exynos4_usb_phy1_init(pdev);
} else if (type == S5P_USB_PHY_DRD) {
if (soc_is_exynos5250())
- return exynos5_usb_phy30_init(pdev);
+ return exynos5_usb_phy30_init(pdev, ext_clk);
else
dev_err(&pdev->dev, "USB 3.0 DRD not present\n");
}
if (!pdata) {
dev_dbg(&pdev->dev, "missing platform data\n");
} else {
+ /*
+ * if we have no gpio to control external PLL, we are using
+ * the internal clock.
+ */
if (pdata->phy_init)
- pdata->phy_init(pdev, pdata->phy_type);
+ pdata->phy_init(pdev, pdata->phy_type,
+ gpio_is_valid(exynos->phyclk_gpio));
}
pm_runtime_set_active(&pdev->dev);
dev_dbg(dev, "entering runtime suspend\n");
- if (!pdata) {
- dev_dbg(&pdev->dev, "missing platform data\n");
- } else {
- if (pdata->phyclk_switch)
- pdata->phyclk_switch(pdev, false);
- }
+ if (gpio_is_valid(exynos->phyclk_gpio)) {
+ if (!pdata) {
+ dev_dbg(&pdev->dev, "missing platform data\n");
+ } else {
+ if (pdata->phyclk_switch)
+ pdata->phyclk_switch(pdev, false);
+ }
- if (gpio_is_valid(exynos->phyclk_gpio))
gpio_set_value(exynos->phyclk_gpio, 0);
+ }
return 0;
}
* and cross our fingers that it's enough.
*/
msleep(10);
- }
- if (!pdata) {
- dev_dbg(&pdev->dev, "missing platform data\n");
- } else {
- if (pdata->phyclk_switch)
- pdata->phyclk_switch(pdev, true);
+ if (!pdata) {
+ dev_dbg(&pdev->dev, "missing platform data\n");
+ } else {
+ if (pdata->phyclk_switch)
+ pdata->phyclk_switch(pdev, true);
+ }
}
return 0;
dev_dbg(&pdev->dev, "missing platform data\n");
} else {
if (pdata->phy_init)
- pdata->phy_init(pdev, pdata->phy_type);
+ pdata->phy_init(pdev, pdata->phy_type,
+ gpio_is_valid(exynos->phyclk_gpio));
}
/* runtime set active to reflect active state. */
struct dwc3_exynos_data {
int phy_type;
- int (*phy_init)(struct platform_device *pdev, int type);
+ int (*phy_init)(struct platform_device *pdev, int type, bool ext_clk);
int (*phy_exit)(struct platform_device *pdev, int type);
int (*phyclk_switch)(struct platform_device *pdev, bool use_ext_clk);
};