* [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add optional repeater phys property
2026-08-26 12:38 [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 repeater support for USB2 ports Julien Massot
@ 2026-08-26 12:38 ` Julien Massot
2026-08-26 16:02 ` Conor Dooley
2026-08-26 12:38 ` [PATCH 2/2] phy: mediatek: xsphy: add optional repeater support for USB2 ports Julien Massot
2026-09-16 10:38 ` [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 " AngeloGioacchino Del Regno
2 siblings, 1 reply; 5+ messages in thread
From: Julien Massot @ 2026-08-26 12:38 UTC (permalink / raw)
To: kernel, Chunfeng Yun, Vinod Koul, Neil Armstrong, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno
Cc: linux-arm-kernel, linux-mediatek, linux-phy, devicetree,
linux-kernel, Julien Massot
USB2 PHY ports may be connected to an external eUSB2 repeater chip.
Add an optional phys property to the port sub-node to allow referencing
it, following the same pattern used by the Synopsys eUSB2 PHY binding.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
index edeb32a97978..e779e21a725b 100644
--- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
+++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
@@ -109,6 +109,11 @@ patternProperties:
- PHY_TYPE_USB2
- PHY_TYPE_USB3
+ phys:
+ description:
+ eUSB2 repeater PHY connected between this port and the USB connector.
+ maxItems: 1
+
# The following optional vendor properties are only for debug or HQA test
mediatek,eye-src:
description:
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add optional repeater phys property
2026-08-26 12:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add optional repeater phys property Julien Massot
@ 2026-08-26 16:02 ` Conor Dooley
0 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2026-08-26 16:02 UTC (permalink / raw)
To: Julien Massot
Cc: kernel, Chunfeng Yun, Vinod Koul, Neil Armstrong, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
linux-phy, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] phy: mediatek: xsphy: add optional repeater support for USB2 ports
2026-08-26 12:38 [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 repeater support for USB2 ports Julien Massot
2026-08-26 12:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add optional repeater phys property Julien Massot
@ 2026-08-26 12:38 ` Julien Massot
2026-09-16 10:38 ` [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 " AngeloGioacchino Del Regno
2 siblings, 0 replies; 5+ messages in thread
From: Julien Massot @ 2026-08-26 12:38 UTC (permalink / raw)
To: kernel, Chunfeng Yun, Vinod Koul, Neil Armstrong, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno
Cc: linux-arm-kernel, linux-mediatek, linux-phy, devicetree,
linux-kernel, Julien Massot
USB2 PHY port sub-nodes may carry an optional phys property referencing
an external eUSB2 repeater.
Fetch the repeater during probe using devm_of_phy_optional_get(),
initialize and exit it alongside the USB2 PHY, and propagate USB mode
changes to it.
This follows the same pattern used by the Synopsys eUSB2 PHY driver.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
drivers/phy/mediatek/phy-mtk-xsphy.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/mediatek/phy-mtk-xsphy.c b/drivers/phy/mediatek/phy-mtk-xsphy.c
index cc1d66954212..7bc3d6794d7b 100644
--- a/drivers/phy/mediatek/phy-mtk-xsphy.c
+++ b/drivers/phy/mediatek/phy-mtk-xsphy.c
@@ -94,6 +94,7 @@ struct xsphy_instance {
struct phy *phy;
void __iomem *port_base;
struct clk *ref_clk; /* reference clock of anolog phy */
+ struct phy *repeater;
u32 index;
u32 type;
struct regmap *type_sw;
@@ -391,6 +392,11 @@ static int mtk_phy_init(struct phy *phy)
switch (inst->type) {
case PHY_TYPE_USB2:
+ ret = phy_init(inst->repeater);
+ if (ret) {
+ clk_disable_unprepare(inst->ref_clk);
+ return ret;
+ }
u2_phy_instance_init(xsphy, inst);
u2_phy_props_set(xsphy, inst);
break;
@@ -438,7 +444,11 @@ static int mtk_phy_exit(struct phy *phy)
{
struct xsphy_instance *inst = phy_get_drvdata(phy);
+ if (inst->type == PHY_TYPE_USB2)
+ phy_exit(inst->repeater);
+
clk_disable_unprepare(inst->ref_clk);
+
return 0;
}
@@ -446,9 +456,16 @@ static int mtk_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{
struct xsphy_instance *inst = phy_get_drvdata(phy);
struct mtk_xsphy *xsphy = dev_get_drvdata(phy->dev.parent);
+ int ret;
- if (inst->type == PHY_TYPE_USB2)
- u2_phy_instance_set_mode(xsphy, inst, mode);
+ if (inst->type != PHY_TYPE_USB2)
+ return 0;
+
+ ret = phy_set_mode_ext(inst->repeater, mode, submode);
+ if (ret)
+ return ret;
+
+ u2_phy_instance_set_mode(xsphy, inst, mode);
return 0;
}
@@ -590,6 +607,11 @@ static int mtk_xsphy_probe(struct platform_device *pdev)
retval = phy_type_syscon_get(inst, child_np);
if (retval)
return retval;
+
+ inst->repeater = devm_of_phy_optional_get(dev, child_np, NULL);
+ if (IS_ERR(inst->repeater))
+ return dev_err_probe(dev, PTR_ERR(inst->repeater),
+ "failed to get repeater\n");
}
provider = devm_of_phy_provider_register(dev, mtk_phy_xlate);
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 repeater support for USB2 ports
2026-08-26 12:38 [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 repeater support for USB2 ports Julien Massot
2026-08-26 12:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add optional repeater phys property Julien Massot
2026-08-26 12:38 ` [PATCH 2/2] phy: mediatek: xsphy: add optional repeater support for USB2 ports Julien Massot
@ 2026-09-16 10:38 ` AngeloGioacchino Del Regno
2 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-09-16 10:38 UTC (permalink / raw)
To: Julien Massot, kernel, Chunfeng Yun, Vinod Koul, Neil Armstrong,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger
Cc: linux-arm-kernel, linux-mediatek, linux-phy, devicetree, linux-kernel
On 8/26/26 14:38, Julien Massot wrote:
> Some USB2 PHY ports are connected to an external eUSB2 repeater chip
> that sits between the PHY and the USB connector. To support such
> configurations, this series adds an optional phys property to the
> MediaTek xsphy port sub-node and integrates the repeater into the USB2
> PHY init, exit and mode handling.
>
> The binding follows the same pattern as the Synopsys eUSB2 PHY, which
> already uses a phys property at the sub-node level to reference an
> external repeater. The driver change similarly manages the repeater PHY
> alongside the MediaTek USB2 PHY.
>
> Signed-off-by: Julien Massot <julien.massot@collabora.com>
Series is
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cheers,
Angelo
> ---
> Julien Massot (2):
> dt-bindings: phy: mediatek,xsphy: add optional repeater phys property
> phy: mediatek: xsphy: add optional repeater support for USB2 ports
>
> .../devicetree/bindings/phy/mediatek,xsphy.yaml | 5 +++++
> drivers/phy/mediatek/phy-mtk-xsphy.c | 26 ++++++++++++++++++++--
> 2 files changed, 29 insertions(+), 2 deletions(-)
> ---
> base-commit: 917df6be58562d024374b4076e6e7618876a0c4a
> change-id: 20260826-mtk-usb2-repeater-usb2-7d5bad6afce8
>
> Best regards,
^ permalink raw reply [flat|nested] 5+ messages in thread