From: Pavel Kubelun Date: Thu, 15 Jun 2017 10:00:18 +0000 (+0300) Subject: ipq806x: usb: Control USB master reset X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=de748a121e9c167cfd0b706eaa5fcca6387ff5d9;p=openwrt%2Fstaging%2Flynxis.git ipq806x: usb: Control USB master reset Picking commit from QSDK https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=eggplant&id=a86bda9f8a7965f0cedd347a9c04800eb9f41ea3 Commit message: "During removal of the glue layer(dwc3-of-simple), USB master reset is set to active and during insertion it is de-activated." Change-Id: I537dc810f6cb2a46664ee674840145066432b957 Signed-off-by: Vasudevan Murugesan (cherry picked from commit 4611e13580a216812f85f0801b95442d02eeb836)" Signed-off-by: Pavel Kubelun --- 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 4b93fea98a..b378da31a6 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 @@ -967,6 +967,9 @@ ranges; + resets = <&gcc USB30_0_MASTER_RESET>; + reset-names = "usb30_mstr_rst"; + status = "disabled"; dwc3@11000000 { 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 new file mode 100644 index 0000000000..feb5a2f4d3 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/0074-ipq806x-usb-Control-USB-master-reset.patch @@ -0,0 +1,64 @@ +From a86bda9f8a7965f0cedd347a9c04800eb9f41ea3 Mon Sep 17 00:00:00 2001 +From: Vasudevan Murugesan +Date: Tue, 21 Jul 2015 10:22:38 +0530 +Subject: ipq806x: usb: Control USB master reset + +During removal of the glue layer(dwc3-of-simple), +USB master reset is set to active and during insertion +it is de-activated. + +Change-Id: I537dc810f6cb2a46664ee674840145066432b957 +Signed-off-by: Vasudevan Murugesan +(cherry picked from commit 4611e13580a216812f85f0801b95442d02eeb836) +--- + drivers/usb/dwc3/dwc3-of-simple.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +(limited to 'drivers/usb/dwc3/dwc3-of-simple.c') + +diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c +index f9e92ef..49bf556 100644 +--- a/drivers/usb/dwc3/dwc3-of-simple.c ++++ b/drivers/usb/dwc3/dwc3-of-simple.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -34,6 +35,7 @@ struct dwc3_of_simple { + struct device *dev; + struct clk **clks; + int num_clocks; ++ struct reset_control *mstr_rst; + }; + + static int dwc3_of_simple_probe(struct platform_device *pdev) +@@ -89,6 +91,13 @@ 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"); ++ ++ if (!IS_ERR(simple->mstr_rst)) ++ reset_control_deassert(simple->mstr_rst); ++ else ++ dev_dbg(simple->dev, "cannot get handle for 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) + clk_put(simple->clks[i]); + } + ++ if (!IS_ERR(simple->mstr_rst)) ++ reset_control_assert(simple->mstr_rst); ++ + of_platform_depopulate(dev); + + pm_runtime_put_sync(dev); +-- +cgit v1.1