Skip to content

Commit a20dcf5

Browse files
kyletsoadlgregkh
authored andcommitted
usb: typec: tcpm: Respond Not_Supported if no snk_vdo
If snk_vdo is not populated from fwnode, it implies the port does not support responding to SVDM commands. Not_Supported Message shall be sent if the contract is in PD3. And for PD2, the port shall ignore the commands. Fixes: 193a680 ("staging: typec: tcpm: Respond to Discover Identity commands") Cc: stable <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Signed-off-by: Kyle Tso <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0bc3ee9 commit a20dcf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,10 @@ static void tcpm_pd_data_request(struct tcpm_port *port,
24302430
NONE_AMS);
24312431
break;
24322432
case PD_DATA_VENDOR_DEF:
2433-
tcpm_handle_vdm_request(port, msg->payload, cnt);
2433+
if (tcpm_vdm_ams(port) || port->nr_snk_vdo)
2434+
tcpm_handle_vdm_request(port, msg->payload, cnt);
2435+
else if (port->negotiated_rev > PD_REV20)
2436+
tcpm_pd_handle_msg(port, PD_MSG_CTRL_NOT_SUPP, NONE_AMS);
24342437
break;
24352438
case PD_DATA_BIST:
24362439
port->bist_request = le32_to_cpu(msg->payload[0]);

0 commit comments

Comments
 (0)