From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Andrei Kuchynski <akuchynski@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/3] usb: typec: displayport: Check cable altmode support
Date: Thu, 18 Jun 2026 16:11:23 +0300 [thread overview]
Message-ID: <ajPue_yC33pnuPMI@kuha> (raw)
In-Reply-To: <20260611122146.262184-4-akuchynski@chromium.org>
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.
>
> Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> 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
--
heikki
prev parent reply other threads:[~2026-06-18 13:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 12:21 [PATCH v1 0/3] Restrict alternate modes based on cable capabilities Andrei Kuchynski
2026-06-11 12:21 ` [PATCH v1 1/3] usb: typec: Add helper to check cable altmode support Andrei Kuchynski
2026-06-11 18:47 ` Benson Leung
2026-06-15 11:29 ` Andrei Kuchynski
2026-06-11 12:21 ` [PATCH v1 2/3] usb: typec: thunderbolt: Check " Andrei Kuchynski
2026-06-18 0:23 ` Benson Leung
2026-06-18 13:10 ` Heikki Krogerus
2026-06-11 12:21 ` [PATCH v1 3/3] usb: typec: displayport: " Andrei Kuchynski
2026-06-18 0:22 ` Benson Leung
2026-06-18 13:11 ` Heikki Krogerus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ajPue_yC33pnuPMI@kuha \
--to=heikki.krogerus@linux.intel.com \
--cc=akuchynski@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox