Re: [PATCH v1 2/3] usb: typec: thunderbolt: Check cable altmode support

From: Heikki Krogerus

Date: Thu Jun 18 2026 - 09:17:27 EST


On Thu, Jun 11, 2026 at 12:21:45PM +0000, Andrei Kuchynski wrote:
> Update the probe function to utilize the new
> typec_cable_altmode_unsupported() helper. If the cable doesn't support
> Thunderbolt altmode, don't initialize altmode_ops and prevent altmode
> from being activated.
>
> Signed-off-by: Andrei Kuchynski <akuchynski@xxxxxxxxxxxx>

Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>

> ---
> drivers/usb/typec/altmodes/thunderbolt.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/typec/altmodes/thunderbolt.c b/drivers/usb/typec/altmodes/thunderbolt.c
> index 32250b94262a9..2eccdddf1b1f4 100644
> --- a/drivers/usb/typec/altmodes/thunderbolt.c
> +++ b/drivers/usb/typec/altmodes/thunderbolt.c
> @@ -284,6 +284,10 @@ static int tbt_altmode_probe(struct typec_altmode *alt)
>
> alt->desc = "Thunderbolt3";
> typec_altmode_set_drvdata(alt, tbt);
> +
> + if (typec_cable_altmode_unsupported(alt))
> + return 0;
> +
> typec_altmode_set_ops(alt, &tbt_altmode_ops);
>
> if (!alt->mode_selection && tbt_ready(alt)) {
> --
> 2.54.0.1099.g489fc7bff1-goog

--
heikki