On Thu, Jun 11, 2026 at 12:21:46PM +0000, Andrei Kuchynski wrote: > Update the probe function to utilize the new > typec_cable_altmode_unsupported() helper. If the cable doesn't support > DisplayPort altmode, don't initialize altmode_ops and prevent altmode > from being activated. > A captive cable shouldn't be checked; it may not provide discoverable > capability information, but it is inherently designed to support the > device's requirements. > Thanks for explaining clearly that this unsupported check only makes sense when the port partner reports it has a receptacle. > Signed-off-by: Andrei Kuchynski Reviewed-by: Benson Leung > --- > drivers/usb/typec/altmodes/displayport.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c > index 263a89c5f3243..5ee33a69b9cf7 100644 > --- a/drivers/usb/typec/altmodes/displayport.c > +++ b/drivers/usb/typec/altmodes/displayport.c > @@ -790,7 +790,6 @@ int dp_altmode_probe(struct typec_altmode *alt) > dp->alt = alt; > > alt->desc = "DisplayPort"; > - typec_altmode_set_ops(alt, &dp_altmode_ops); > > if (plug) { > plug->desc = "Displayport"; > @@ -811,6 +810,10 @@ int dp_altmode_probe(struct typec_altmode *alt) > if (plug) > typec_altmode_set_drvdata(plug, dp); > > + if ((alt->vdo & DP_CAP_RECEPTACLE) && typec_cable_altmode_unsupported(alt)) > + return 0; > + > + typec_altmode_set_ops(alt, &dp_altmode_ops); > if (!alt->mode_selection) { > dp->state = plug ? DP_STATE_ENTER_PRIME : DP_STATE_ENTER; > schedule_work(&dp->work); > -- > 2.54.0.1099.g489fc7bff1-goog > >