Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpm: Record the partner's Product Type VDOs
@ 2026-11-02 14:21 Alexey Charkov
  2026-11-02 14:27 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Charkov @ 2026-11-02 14:21 UTC (permalink / raw)
  To: Badhri Jagan Sridharan, Heikki Krogerus, Greg Kroah-Hartman
  Cc: Sebastian Reichel, linux-usb, linux-kernel, Alexey Charkov

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>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: typec: tcpm: Record the partner's Product Type VDOs
  2026-11-02 14:21 [PATCH] usb: typec: tcpm: Record the partner's Product Type VDOs Alexey Charkov
@ 2026-11-02 14:27 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-02 14:27 UTC (permalink / raw)
  To: Alexey Charkov; +Cc: linux-usb

> 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>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102-tcpm-product-type-vdo-v1-1-02e90dadbc2d@flipper.net?part=1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-02 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 14:21 [PATCH] usb: typec: tcpm: Record the partner's Product Type VDOs Alexey Charkov
2026-11-02 14:27 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox