From: Alexey Charkov <alchark@flipper.net>
To: Badhri Jagan Sridharan <badhri@google.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexey Charkov <alchark@flipper.net>
Subject: [PATCH] usb: typec: tcpm: Record the partner's Product Type VDOs
Date: Mon, 02 Nov 2026 18:21:24 +0400 [thread overview]
Message-ID: <20261102-tcpm-product-type-vdo-v1-1-02e90dadbc2d@flipper.net> (raw)
A Discover Identity response can carry up to three Product Type VDOs
after the Product VDO, describing what the partner is as a UFP, DFP or
alternate mode adapter. The Type-C class keeps them in the identity and
shows them as product_type_vdo1-3, but TCPM stores only the ID header,
Cert Stat and Product VDOs of a partner, so those always read 0. Cable
identities already get their VDOs.
Store the Product Type VDOs as received and zero the ones the partner
does not send, leaving their PD revision specific layout to the reader.
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
drivers/usb/typec/tcpm/tcpm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index d721baef5210..8fd6b1f842b3 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -2064,6 +2064,7 @@ static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
{
u32 vdo = p[VDO_INDEX_IDH];
u32 product = p[VDO_INDEX_PRODUCT];
+ int i;
if (cnt <= VDO_INDEX_PRODUCT)
return;
@@ -2073,6 +2074,10 @@ static void svdm_consume_identity(struct tcpm_port *port, const u32 *p, int cnt)
port->partner_ident.id_header = vdo;
port->partner_ident.cert_stat = p[VDO_INDEX_CSTAT];
port->partner_ident.product = product;
+ /* Product Type VDOs, if any, follow the Product VDO */
+ for (i = 0; i < ARRAY_SIZE(port->partner_ident.vdo); i++)
+ port->partner_ident.vdo[i] = VDO_INDEX_PRODUCT + 1 + i < cnt ?
+ p[VDO_INDEX_PRODUCT + 1 + i] : 0;
if (port->partner)
typec_partner_set_identity(port->partner);
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
change-id: 20261102-tcpm-product-type-vdo-af873ef1fdf4
Best regards,
--
Alexey Charkov <alchark@flipper.net>
next reply other threads:[~2026-11-02 14:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 14:21 Alexey Charkov [this message]
2026-11-06 12:46 ` Heikki Krogerus
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=20261102-tcpm-product-type-vdo-v1-1-02e90dadbc2d@flipper.net \
--to=alchark@flipper.net \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sebastian.reichel@collabora.com \
/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
all inboxes | Powered by JetHome®