浏览代码

usb: cdns3: use phy power on/off

PHY needs to be powered on.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Roger Quadros 6 年之前
父节点
当前提交
7a3ad11be1
共有 1 个文件被更改,包括 14 次插入1 次删除
  1. 14 1
      drivers/usb/cdns3/core.c

+ 14 - 1
drivers/usb/cdns3/core.c

@@ -392,7 +392,18 @@ static int cdns3_probe(struct platform_device *pdev)
 	if (IS_ERR(cdns->phy))
 		return PTR_ERR(cdns->phy);
 
-	phy_init(cdns->phy);
+	ret = phy_init(cdns->phy);
+	if (ret) {
+		dev_err(dev, "phy_init error\n");
+		return ret;
+	}
+
+	ret = phy_power_on(cdns->phy);
+	if (ret) {
+		dev_err(dev, "phy_power_on error\n");
+		phy_exit(cdns->phy);
+		return ret;
+	}
 
 	INIT_WORK(&cdns->role_switch_wq, cdns3_role_switch);
 
@@ -422,6 +433,7 @@ static int cdns3_probe(struct platform_device *pdev)
 	return 0;
 
 err:
+	phy_power_off(cdns->phy);
 	phy_exit(cdns->phy);
 	return ret;
 }
@@ -441,6 +453,7 @@ static int cdns3_remove(struct platform_device *pdev)
 	pm_runtime_put_noidle(&pdev->dev);
 	cdns3_debugfs_exit(cdns);
 	cdns3_exit_roles(cdns);
+	phy_power_off(cdns->phy);
 	phy_exit(cdns->phy);
 	return 0;
 }