From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Andrei Kuchynski <akuchynski@chromium.org>
Cc: Jameson Thies <jthies@google.com>,
Benson Leung <bleung@chromium.org>,
Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Reorder altmode registration
Date: Thu, 15 Oct 2026 12:14:50 +0000 [thread overview]
Message-ID: <atDDunhd_1mucOVh@google.com> (raw)
In-Reply-To: <20261008134056.3816556-3-akuchynski@chromium.org>
On Thu, Oct 08, 2026 at 01:40:56PM +0000, Andrei Kuchynski wrote:
> @@ -406,17 +406,6 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
> struct typec_altmode_desc desc;
> struct typec_altmode *amode;
>
> - /* All PD capable CrOS devices are assumed to support DP altmode. */
> - memset(&desc, 0, sizeof(desc));
> - desc.svid = USB_TYPEC_DP_SID;
> - desc.mode = USB_TYPEC_DP_MODE;
> - desc.vdo = DP_PORT_VDO;
> - amode = cros_typec_register_displayport(port, &desc,
> - typec->ap_driven_altmode);
> - if (IS_ERR(amode))
> - return PTR_ERR(amode);
> - port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
> -
> /*
> * Register TBT compatibility alt mode. The EC will not enter the mode
> * if it doesn't support it and it will not enter automatically by
> @@ -433,6 +422,17 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
> port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
> }
>
> + /* All PD capable CrOS devices are assumed to support DP altmode. */
> + memset(&desc, 0, sizeof(desc));
> + desc.svid = USB_TYPEC_DP_SID;
> + desc.mode = USB_TYPEC_DP_MODE;
> + desc.vdo = DP_PORT_VDO;
> + amode = cros_typec_register_displayport(port, &desc,
> + typec->ap_driven_altmode);
> + if (IS_ERR(amode))
> + return PTR_ERR(amode);
> + port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
> +
It deserves a code comment to note that the registration order dictates
the priorities.
prev parent reply other threads:[~2026-10-15 12:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 13:40 [PATCH v2 0/2] USB Type-C mode selection Andrei Kuchynski
2026-10-08 13:40 ` [PATCH v2 1/2] platform/chrome: cros_ec_typec: Enforce priority-based " Andrei Kuchynski
2026-10-15 12:15 ` Tzung-Bi Shih
2026-10-08 13:40 ` [PATCH v2 2/2] platform/chrome: cros_ec_typec: Reorder altmode registration Andrei Kuchynski
2026-10-15 12:14 ` Tzung-Bi Shih [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=atDDunhd_1mucOVh@google.com \
--to=tzungbi@kernel.org \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=jthies@google.com \
--cc=linux-kernel@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