+MODULE_LICENSE("GPL");
--- /dev/null
+++ b/drivers/phy/phy-ar7200-usb.c
-@@ -0,0 +1,123 @@
+@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2015 Alban Bedel <albeu@free.fr>
+ *
+
+struct ar7200_usb_phy {
+ struct reset_control *rst_phy;
++ struct reset_control *rst_phy_analog;
+ struct reset_control *suspend_override;
+ struct phy *phy;
+ int gpio;
+ struct ar7200_usb_phy *priv = phy_get_drvdata(phy);
+ int err = 0;
+
-+ if (priv->rst_phy)
-+ err = reset_control_deassert(priv->rst_phy);
-+ if (!err && priv->suspend_override)
++ if (priv->suspend_override)
+ err = reset_control_assert(priv->suspend_override);
-+ if (err && priv->rst_phy)
-+ err = reset_control_assert(priv->rst_phy);
++ if (priv->rst_phy)
++ err |= reset_control_deassert(priv->rst_phy);
++ if (priv->rst_phy_analog)
++ err |= reset_control_deassert(priv->rst_phy_analog);
+
+ return err;
+}
+ err = reset_control_deassert(priv->suspend_override);
+ if (priv->rst_phy)
+ err |= reset_control_assert(priv->rst_phy);
++ if (priv->rst_phy_analog)
++ err |= reset_control_assert(priv->rst_phy_analog);
+
+ return err;
+}
+ return PTR_ERR(priv->rst_phy);
+ }
+
++ priv->rst_phy_analog = devm_reset_control_get_optional(
++ &pdev->dev, "usb-phy-analog");
++ if (IS_ERR(priv->rst_phy_analog)) {
++ if (PTR_ERR(priv->rst_phy_analog) == -ENOENT)
++ priv->rst_phy_analog = NULL;
++ else
++ return PTR_ERR(priv->rst_phy_analog);
++ }
++
+ priv->suspend_override = devm_reset_control_get_optional(
+ &pdev->dev, "usb-suspend-override");
+ if (IS_ERR(priv->suspend_override)) {