#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
-@@ -33,6 +34,8 @@
- struct device *dev;
- struct clk **clks;
- int num_clocks;
+@@ -33,6 +34,8 @@ struct dwc3_of_simple {
+ struct device *dev;
+ struct clk **clks;
+ int num_clocks;
+ struct reset_control *mstr_rst_30_0;
+ struct reset_control *mstr_rst_30_1;
};
-
+
static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count)
-@@ -102,6 +105,20 @@
- if (ret)
- return ret;
-
+@@ -102,6 +105,20 @@ static int dwc3_of_simple_probe(struct p
+ if (ret)
+ return ret;
+
+ simple->mstr_rst_30_0 = devm_reset_control_get(dev, "usb30_0_mstr_rst");
+
+ if (!IS_ERR(simple->mstr_rst_30_0))
+ 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++) {
-@@ -130,6 +147,12 @@
- clk_put(simple->clks[i]);
- }
-
+ ret = of_platform_populate(np, NULL, NULL, dev);
+ if (ret) {
+ for (i = 0; i < simple->num_clocks; i++) {
+@@ -130,6 +147,12 @@ static int dwc3_of_simple_remove(struct
+ clk_put(simple->clks[i]);
+ }
+
+ 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);
-
- pm_runtime_put_sync(dev);
+ of_platform_depopulate(dev);
+
+ pm_runtime_put_sync(dev);