| .. | .. |
|---|
| 1724 | 1724 | rlen = 1; |
|---|
| 1725 | 1725 | } else if (port->data_role == TYPEC_HOST) { |
|---|
| 1726 | 1726 | tcpm_register_partner_altmodes(port); |
|---|
| 1727 | + } else { |
|---|
| 1728 | + /* Do dr_swap for ufp if the port supports drd */ |
|---|
| 1729 | + if (port->typec_caps.data == TYPEC_PORT_DRD && |
|---|
| 1730 | + !IS_ERR_OR_NULL(port->port_altmode[0])) { |
|---|
| 1731 | + port->vdm_sm_running = false; |
|---|
| 1732 | + port->upcoming_state = DR_SWAP_SEND; |
|---|
| 1733 | + tcpm_ams_start(port, DATA_ROLE_SWAP); |
|---|
| 1734 | + } |
|---|
| 1727 | 1735 | } |
|---|
| 1728 | 1736 | break; |
|---|
| 1729 | 1737 | case CMD_ENTER_MODE: |
|---|
| .. | .. |
|---|
| 1755 | 1763 | tcpm_ams_finish(port); |
|---|
| 1756 | 1764 | switch (cmd) { |
|---|
| 1757 | 1765 | case CMD_DISCOVER_IDENT: |
|---|
| 1766 | + /* Do dr_swap for ufp if the port supports drd */ |
|---|
| 1767 | + if (port->typec_caps.data == TYPEC_PORT_DRD && |
|---|
| 1768 | + port->data_role == TYPEC_DEVICE && |
|---|
| 1769 | + !IS_ERR_OR_NULL(port->port_altmode[0])) { |
|---|
| 1770 | + port->vdm_sm_running = false; |
|---|
| 1771 | + port->upcoming_state = DR_SWAP_SEND; |
|---|
| 1772 | + tcpm_ams_start(port, DATA_ROLE_SWAP); |
|---|
| 1773 | + break; |
|---|
| 1774 | + } |
|---|
| 1775 | + fallthrough; |
|---|
| 1758 | 1776 | case CMD_DISCOVER_SVID: |
|---|
| 1759 | 1777 | case CMD_DISCOVER_MODES: |
|---|
| 1760 | 1778 | case VDO_CMD_VENDOR(0) ... VDO_CMD_VENDOR(15): |
|---|