[openwrt/openwrt] ipq806x: usb: add phy 1 master reset control

LEDE Commits lede-commits at lists.infradead.org
Wed Jan 17 02:05:30 PST 2018


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/e93a16ed3ff0e6ad8ffb042cd340c28a117380b9

commit e93a16ed3ff0e6ad8ffb042cd340c28a117380b9
Author: Pavel Kubelun <be.dissent at gmail.com>
AuthorDate: Thu Jun 15 13:58:34 2017 +0300

    ipq806x: usb: add phy 1 master reset control
    
    In current state only phy 0 master reset is controlled.
    Add the phy 1 reset.
    
    Signed-off-by: Pavel Kubelun <be.dissent at gmail.com>
---
 .../files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi  |  5 +++-
 ...0074-ipq806x-usb-Control-USB-master-reset.patch | 33 ++++++++++++++--------
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi
index b378da3..90f7a10 100644
--- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -968,7 +968,7 @@
 			ranges;
 
 			resets = <&gcc USB30_0_MASTER_RESET>;
-			reset-names = "usb30_mstr_rst";
+			reset-names = "usb30_0_mstr_rst";
 
 			status = "disabled";
 
@@ -992,6 +992,9 @@
 
 			ranges;
 
+			resets = <&gcc USB30_1_MASTER_RESET>;
+			reset-names = "usb30_1_mstr_rst";
+
 			status = "disabled";
 
 			dwc3 at 10000000 {
diff --git a/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
index feb5a2f..d5ff868 100644
--- a/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
+++ b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch
@@ -11,7 +11,7 @@ Change-Id: I537dc810f6cb2a46664ee674840145066432b957
 Signed-off-by: Vasudevan Murugesan <vmuruges at codeaurora.org>
 (cherry picked from commit 4611e13580a216812f85f0801b95442d02eeb836)
 ---
- drivers/usb/dwc3/dwc3-of-simple.c | 12 ++++++++++++
+ drivers/usb/dwc3/dwc3-of-simple.c | 22 ++++++++++++++++++++++
  1 file changed, 12 insertions(+)
 
 (limited to 'drivers/usb/dwc3/dwc3-of-simple.c')
@@ -28,34 +28,45 @@ index f9e92ef..49bf556 100644
  #include <linux/of.h>
  #include <linux/of_platform.h>
  #include <linux/pm_runtime.h>
-@@ -34,6 +35,7 @@ struct dwc3_of_simple {
+@@ -34,6 +35,8 @@ struct dwc3_of_simple {
  	struct device		*dev;
  	struct clk		**clks;
  	int			num_clocks;
-+	struct reset_control	*mstr_rst;
++	struct reset_control	*mstr_rst_30_0;
++	struct reset_control	*mstr_rst_30_1;
  };
  
  static int dwc3_of_simple_probe(struct platform_device *pdev)
-@@ -89,6 +91,13 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
+@@ -89,6 +92,20 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
  		simple->clks[i] = clk;
  	}
  
-+	simple->mstr_rst = devm_reset_control_get(dev, "usb30_mstr_rst");
++	simple->mstr_rst_30_0 = devm_reset_control_get(dev, "usb30_0_mstr_rst");
 +
-+	if (!IS_ERR(simple->mstr_rst))
-+		reset_control_deassert(simple->mstr_rst);
++	if (!IS_ERR(simple->mstr_rst_30_0))
++		reset_control_deassert(simple->mstr_rst_30_0);
 +	else
-+		dev_dbg(simple->dev, "cannot get handle for master reset control\n");
++		dev_dbg(simple->dev, "cannot get handle for USB PHY 0 master reset control\n");
++
++	simple->mstr_rst_30_1 = devm_reset_control_get(dev, "usb30_1_mstr_rst");
++
++	if (!IS_ERR(simple->mstr_rst_30_1))
++		reset_control_deassert(simple->mstr_rst_30_1);
++	else
++		dev_dbg(simple->dev, "cannot get handle for USB PHY 1 master reset control\n");
 +
  	ret = of_platform_populate(np, NULL, NULL, dev);
  	if (ret) {
  		for (i = 0; i < simple->num_clocks; i++) {
-@@ -117,6 +126,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
+@@ -117,6 +134,12 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
  		clk_put(simple->clks[i]);
  	}
  
-+	if (!IS_ERR(simple->mstr_rst))
-+		reset_control_assert(simple->mstr_rst);
++	if (!IS_ERR(simple->mstr_rst_30_0))
++		reset_control_assert(simple->mstr_rst_30_0);
++
++	if (!IS_ERR(simple->mstr_rst_30_1))
++		reset_control_assert(simple->mstr_rst_30_1);
 +
  	of_platform_depopulate(dev);
  



More information about the lede-commits mailing list