diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-24 15:21:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-24 15:21:10 +0200 |
commit | 85fb1a27b128f6404cb9a08f3a4a094e92a78ac0 (patch) | |
tree | 85b23c9ace88f2a72665dd0c72768fd0a4c3e4ca /drivers/usb/typec | |
parent | e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb (diff) | |
parent | e22ce8eb631bdc47a4a4ea7ecf4e4ba499db4f93 (diff) | |
download | linux-stable-85fb1a27b128f6404cb9a08f3a4a094e92a78ac0.tar.gz linux-stable-85fb1a27b128f6404cb9a08f3a4a094e92a78ac0.tar.bz2 linux-stable-85fb1a27b128f6404cb9a08f3a4a094e92a78ac0.zip |
Merge 5.14-rc7 into usb-next
We need the USB fix in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
-rw-r--r-- | drivers/usb/typec/tcpm/tcpm.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index c40e0513873d..049f4c61ee82 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1742,6 +1742,10 @@ static int tcpm_pd_svdm(struct tcpm_port *port, struct typec_altmode *adev, return rlen; } +static void tcpm_pd_handle_msg(struct tcpm_port *port, + enum pd_msg_request message, + enum tcpm_ams ams); + static void tcpm_handle_vdm_request(struct tcpm_port *port, const __le32 *payload, int cnt) { @@ -1769,11 +1773,11 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port, port->vdm_state = VDM_STATE_DONE; } - if (PD_VDO_SVDM(p[0])) { + if (PD_VDO_SVDM(p[0]) && (adev || tcpm_vdm_ams(port) || port->nr_snk_vdo)) { rlen = tcpm_pd_svdm(port, adev, p, cnt, response, &adev_action); } else { if (port->negotiated_rev >= PD_REV30) - tcpm_queue_message(port, PD_MSG_CTRL_NOT_SUPP); + tcpm_pd_handle_msg(port, PD_MSG_CTRL_NOT_SUPP, NONE_AMS); } /* @@ -2476,10 +2480,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port, NONE_AMS); break; case PD_DATA_VENDOR_DEF: - if (tcpm_vdm_ams(port) || port->nr_snk_vdo) - tcpm_handle_vdm_request(port, msg->payload, cnt); - else if (port->negotiated_rev > PD_REV20) - tcpm_pd_handle_msg(port, PD_MSG_CTRL_NOT_SUPP, NONE_AMS); + tcpm_handle_vdm_request(port, msg->payload, cnt); break; case PD_DATA_BIST: port->bist_request = le32_to_cpu(msg->payload[0]); |