* [PATCH v2 1/2] dt-bindings: phy: qca,ar7100-usb-phy: add AR9340, QCA9550 and the analog reset
2026-11-09 4:04 [PATCH v2 0/2] phy: ath79-usb: support the AR934x+ analog reset Rosen Penev
@ 2026-11-09 4:04 ` Rosen Penev
2026-11-09 4:04 ` [PATCH v2 2/2] phy: ath79-usb: support " Rosen Penev
1 sibling, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2026-11-09 4:04 UTC (permalink / raw)
To: Alban Bedel, Vinod Koul, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Philipp Zabel
Cc: Neil Armstrong, Manivannan Sadhasivam, linux-phy, devicetree,
linux-kernel, linux-arm-msm
From AR934x on, the analog part of the USB PHY has its own reset,
which has to be released along with the PHY one. Add it as a third,
optional reset, and add compatibles for AR934x and QCA955x, which need
it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
.../bindings/phy/qca,ar7100-usb-phy.yaml | 38 ++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/phy/qca,ar7100-usb-phy.yaml b/Documentation/devicetree/bindings/phy/qca,ar7100-usb-phy.yaml
index 029665530829..358b3f345c12 100644
--- a/Documentation/devicetree/bindings/phy/qca,ar7100-usb-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qca,ar7100-usb-phy.yaml
@@ -11,8 +11,13 @@ maintainers:
properties:
compatible:
- items:
+ oneOf:
- const: qca,ar7100-usb-phy
+ - items:
+ - enum:
+ - qca,ar9340-usb-phy
+ - qca,qca9550-usb-phy
+ - const: qca,ar7100-usb-phy
reset-names:
description: Names of reset lines in order.
@@ -20,6 +25,7 @@ properties:
items:
- const: phy
- const: suspend-override
+ - const: phy-analog
resets:
description: References to the reset controllers.
@@ -27,6 +33,7 @@ properties:
items:
- description: Reset controller for phy
- description: Reset controller for suspend-override
+ - description: Reset controller for the analog part of the phy
'#phy-cells':
const: 0
@@ -37,6 +44,27 @@ required:
- resets
- '#phy-cells'
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qca,ar9340-usb-phy
+ - qca,qca9550-usb-phy
+ then:
+ properties:
+ resets:
+ minItems: 3
+ reset-names:
+ minItems: 3
+ else:
+ properties:
+ resets:
+ maxItems: 2
+ reset-names:
+ maxItems: 2
+
additionalProperties: false
examples:
@@ -47,3 +75,11 @@ examples:
resets = <&rst 4>, <&rst 3>;
#phy-cells = <0>;
};
+
+ - |
+ usb-phy {
+ compatible = "qca,qca9550-usb-phy", "qca,ar7100-usb-phy";
+ reset-names = "phy", "suspend-override", "phy-analog";
+ resets = <&rst 4>, <&rst 3>, <&rst 11>;
+ #phy-cells = <0>;
+ };
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v2 2/2] phy: ath79-usb: support the analog reset
2026-11-09 4:04 [PATCH v2 0/2] phy: ath79-usb: support the AR934x+ analog reset Rosen Penev
2026-11-09 4:04 ` [PATCH v2 1/2] dt-bindings: phy: qca,ar7100-usb-phy: add AR9340, QCA9550 and the " Rosen Penev
@ 2026-11-09 4:04 ` Rosen Penev
1 sibling, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2026-11-09 4:04 UTC (permalink / raw)
To: Alban Bedel, Vinod Koul, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Philipp Zabel
Cc: Neil Armstrong, Manivannan Sadhasivam, linux-phy, devicetree,
linux-kernel, linux-arm-msm
From AR934x on, the analog part of the USB PHY has its own reset. The
old platform code released it after the PHY reset on AR934x, and left
it to the bootloader on QCA955x.
Take it as an optional "phy-analog" reset, release it after the PHY one
when powering on, and assert it first when powering off. This is the
reset handling OpenWrt has used on its AR934x, QCA955x and QCA956x
boards.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/phy/qualcomm/phy-ath79-usb.c | 33 +++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-ath79-usb.c b/drivers/phy/qualcomm/phy-ath79-usb.c
index 8e9565846b2f..1e7868fc0b5f 100644
--- a/drivers/phy/qualcomm/phy-ath79-usb.c
+++ b/drivers/phy/qualcomm/phy-ath79-usb.c
@@ -12,6 +12,7 @@
struct ath79_usb_phy {
struct reset_control *reset;
+ struct reset_control *analog_reset;
/* The suspend override logic is inverted, hence the no prefix
* to make the code a bit easier to understand.
*/
@@ -30,7 +31,19 @@ static int ath79_usb_phy_power_on(struct phy *phy)
}
err = reset_control_deassert(priv->reset);
- if (err && priv->no_suspend_override)
+ if (err)
+ goto err_suspend_override;
+
+ err = reset_control_deassert(priv->analog_reset);
+ if (err) {
+ reset_control_assert(priv->reset);
+ goto err_suspend_override;
+ }
+
+ return 0;
+
+err_suspend_override:
+ if (priv->no_suspend_override)
reset_control_deassert(priv->no_suspend_override);
return err;
@@ -41,14 +54,22 @@ static int ath79_usb_phy_power_off(struct phy *phy)
struct ath79_usb_phy *priv = phy_get_drvdata(phy);
int err = 0;
- err = reset_control_assert(priv->reset);
+ err = reset_control_assert(priv->analog_reset);
if (err)
return err;
+ err = reset_control_assert(priv->reset);
+ if (err) {
+ reset_control_deassert(priv->analog_reset);
+ return err;
+ }
+
if (priv->no_suspend_override) {
err = reset_control_deassert(priv->no_suspend_override);
- if (err)
+ if (err) {
reset_control_deassert(priv->reset);
+ reset_control_deassert(priv->analog_reset);
+ }
}
return err;
@@ -78,6 +99,12 @@ static int ath79_usb_phy_probe(struct platform_device *pdev)
if (IS_ERR(priv->no_suspend_override))
return PTR_ERR(priv->no_suspend_override);
+ /* AR934x and later also hold the analog part in reset */
+ priv->analog_reset = devm_reset_control_get_optional(&pdev->dev,
+ "phy-analog");
+ if (IS_ERR(priv->analog_reset))
+ return PTR_ERR(priv->analog_reset);
+
phy = devm_phy_create(&pdev->dev, NULL, &ath79_usb_phy_ops);
if (IS_ERR(phy))
return PTR_ERR(phy);
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread