Skip to contentSkip to conversation

usb: typec: tcpm: Correct port source pdo array in pd_set callback

PATCH In review Kyle Tso 2 participants 2 messages Mar 11, 2024 – Mar 12, 2024

Subsystems (4)
lore
Share & tools
lore

Kyle Tso

author
#0 lore raw

PATCH 1/1 usb: typec: tcpm: Correct port source pdo array in pd_set callback

In tcpm_pd_set, the array of port source capabilities is port->src_pdo, not port->snk_pdo.

Fixes cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
---
 drivers/usb/typec/tcpm/tcpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
index 3d505614bff1..9485f6373de4 100644
@@ -6858,7 +6858,7 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd)
 
 	if (data->source_desc.pdo[0]) {
 		for (i = 0; i < PDO_MAX_OBJECTS && data->source_desc.pdo[i]; i++)
-			port->snk_pdo[i] = data->source_desc.pdo[i];
+			port->src_pdo[i] = data->source_desc.pdo[i];
 		port->nr_src_pdo = i + 1;
 	}
 
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Kyle Tso

In tcpm_pd_set, the array of port source capabilities is port->src_pdo, not port->snk_pdo.

Fixes cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
Quoted 19 lines
---
 drivers/usb/typec/tcpm/tcpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
index 3d505614bff1..9485f6373de4 100644
@@ -6858,7 +6858,7 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd)
 
 	if (data->source_desc.pdo[0]) {
 		for (i = 0; i < PDO_MAX_OBJECTS && data->source_desc.pdo[i]; i++)
-			port->snk_pdo[i] = data->source_desc.pdo[i];
+			port->src_pdo[i] = data->source_desc.pdo[i];
 		port->nr_src_pdo = i + 1;
 	}
 
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog
Signature · 1 line
heikki