aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <[email protected]>2021-05-17 12:21:09 -0700
committerGreg Kroah-Hartman <[email protected]>2021-05-21 20:05:56 +0200
commitd112efbe6dbf7d4c482e2a3f381fa315aabfe63b (patch)
treefb1f9384d89826dcf9d49dd62ea442a4331e586e
parent56d426146cdfa08dc56cda0d0897af4e5090ffcf (diff)
usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled
During PR_SWAP, When TCPM is in PR_SWAP_SNK_SRC_SINK_OFF, vbus is expected to reach VSAFE0V when source turns off vbus. Do not move to SNK_UNATTACHED state when this happens. Fixes: 28b43d3d746b ("usb: typec: tcpm: Introduce vsafe0v for vbus") Reviewed-by: Guenter Roeck <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Signed-off-by: Badhri Jagan Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/typec/tcpm/tcpm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 64133e586c64..0be7559abb5a 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -5155,6 +5155,9 @@ static void _tcpm_pd_vbus_vsafe0v(struct tcpm_port *port)
tcpm_set_state(port, SNK_UNATTACHED, 0);
}
break;
+ case PR_SWAP_SNK_SRC_SINK_OFF:
+ /* Do nothing, vsafe0v is expected during transition */
+ break;
default:
if (port->pwr_role == TYPEC_SINK && port->auto_vbus_discharge_enabled)
tcpm_set_state(port, SNK_UNATTACHED, 0);