From 36f0cac7fee1cefc121f740d598d170bee74b069 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sun, 29 Nov 2026 13:30:31 +1100 Subject: [PATCH] phy: apple: atc-t6050-dp: start a fixed DP PHY at probe A T6050 DP PHY without a Type-C mux, such as the one in front of the MacBook Pro's HDMI port (ATC3, a DP-to-HDMI converter behind it), has nothing that starts it before the display processor connects. A Type-C PHY is started by its mux; the display processor only asks for DisplayPort mode (set_mode) once the link is up. With the PHY off, firmware 27 never gets there: every connect fails with DPTX link faults 22 (DEVICE_BUSY_TIMEOUT) and 24 (DEVICE_NOT_STARTED) on the PHY's target, and the HDMI connector stays disconnected with the monitor's hot-plug line high. Start a fixed DP PHY at the end of probe and keep it started: when the display processor deactivates the port, only the link goes down, as on a combo PHY. Type-C and combo PHYs are unchanged. On a K114s (MacBook Pro 14-inch, M5 Pro) with its HDMI port described, the first connect then trains HBR3 on four lanes and the monitor lights; without this, the connect fails the same way at boot and on every retry. Signed-off-by: Ryan Murray --- drivers/phy/apple/atc-t6050-dp.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/phy/apple/atc-t6050-dp.c b/drivers/phy/apple/atc-t6050-dp.c index 35dd18fa97036..a6f58f69b7f53 100644 --- a/drivers/phy/apple/atc-t6050-dp.c +++ b/drivers/phy/apple/atc-t6050-dp.c @@ -646,8 +646,9 @@ static int t6050_dp_set_mode(struct phy *phy, enum phy_mode mode, int submode) return -EBUSY; if (mode == PHY_MODE_DP) return dp->typec ? (dp->enabled ? 0 : -ENOLINK) : atc_start(dp); + /* A fixed DP PHY stays started (see t6050_dp_start_fixed()): only its link goes down. */ if (mode == PHY_MODE_INVALID) - return dp->combo ? atc_link_rate(dp, -1) : atc_stop(dp); + return dp->combo || !dp->typec ? atc_link_rate(dp, -1) : atc_stop(dp); return -EINVAL; } @@ -997,6 +998,25 @@ static int t6050_typec_register(struct t6050_dp *dp) return devm_add_action_or_reset(dp->dev, t6050_typec_mux_release, mux); } +/* + * A fixed DP PHY, one without a Type-C mux (the PHY in front of an HDMI port's DP-to-HDMI converter), + * has nothing that starts it before the display processor connects: a Type-C PHY is started by its + * mux, and the display processor only asks for DisplayPort mode (t6050_dp_set_mode()) once the link + * is up. Firmware 27 does not get that far with the PHY off: the connect fails with link faults + * 22/24 on the PHY's target. Start it once here; it stays started until shutdown. + */ +static void t6050_dp_start_fixed(struct t6050_dp *dp) +{ + int ret; + + if (dp->typec || dp->combo) + return; + scoped_guard(mutex, &dp->lock) + ret = atc_start(dp); + if (ret) + dev_warn(dp->dev, "fixed DP PHY did not start: %d\n", ret); +} + static int t6050_dp_probe(struct platform_device *pdev) { static const char * const domains[] = {"usb-aon", "common", "wrapper", "usb"}; @@ -1217,7 +1237,10 @@ static int t6050_dp_probe(struct platform_device *pdev) provider = devm_of_phy_provider_register(dev, dp->combo ? combo_xlate : of_phy_simple_xlate); if (IS_ERR(provider)) return PTR_ERR(provider); - return dp->typec ? t6050_typec_register(dp) : 0; + if (dp->typec) + return t6050_typec_register(dp); + t6050_dp_start_fixed(dp); + return 0; } static void t6050_dp_shutdown(struct platform_device *pdev)