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)