All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled
@ 2021-05-17 19:21 Badhri Jagan Sridharan
  2021-05-17 19:21 ` [PATCH v2 2/4] usb: typec: tcpm: Refactor logic to enable/disable auto vbus dicharge Badhri Jagan Sridharan
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Badhri Jagan Sridharan @ 2021-05-17 19:21 UTC (permalink / raw)
  To: Guenter Roeck, Heikki Krogerus, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Kyle Tso, stable, Badhri Jagan Sridharan

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")
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
Changes since V1:
- Fixed type s/of/off in commit message.
- Added Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/usb/typec/tcpm/tcpm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index c4fdc00a3bc8..b93c4c8d7b15 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -5114,6 +5114,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);
-- 
2.31.1.751.gd2f1c929bd-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-18 12:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 19:21 [PATCH v2 1/4] usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled Badhri Jagan Sridharan
2021-05-17 19:21 ` [PATCH v2 2/4] usb: typec: tcpm: Refactor logic to enable/disable auto vbus dicharge Badhri Jagan Sridharan
2021-05-18 12:27   ` Heikki Krogerus
2021-05-17 19:21 ` [PATCH v2 3/4] usb: typec: tcpm: Move TCPC to APPLY_RC state during PR_SWAP Badhri Jagan Sridharan
2021-05-17 19:56   ` Guenter Roeck
2021-05-18 12:28   ` Heikki Krogerus
2021-05-17 19:21 ` [PATCH v2 4/4] usb: typec: tcpci: Implement callback for apply_rc Badhri Jagan Sridharan
2021-05-18 12:29   ` Heikki Krogerus
2021-05-18 12:27 ` [PATCH v2 1/4] usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.