aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/typec
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <Badhri@google.com>2017-08-10 21:15:41 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-18 15:57:16 -0700
commitc749d4d0e4b80cf52b9f916887c5480089cbdd93 (patch)
treedba31812abd94f4c34cb4e5298bd77ce27dd679e /drivers/staging/typec
parentstaging: typec: tcpm: Report role swap complete after entering READY state (diff)
downloadlinux-dev-c749d4d0e4b80cf52b9f916887c5480089cbdd93.tar.xz
linux-dev-c749d4d0e4b80cf52b9f916887c5480089cbdd93.zip
staging: typec: tcpm: Set default state after error recovery based on port type
While exiting ERROR_RECOVERY, choose default state based on the port type instead of current power role. Quoting from specification: 4.5.2.2.2 ErrorRecovery State This state appears in Figure 4-12, Figure 4-13, Figure 4-14, Figure 4-15, Figure 4-16 and Figure 4-17. The ErrorRecovery state is where the port removes the terminations from the CC1 and CC2 pins for tErrorRecovery followed by transitioning to the appropriate Unattached.SNK or Unattached.SRC state based on port type. This is the equivalent of forcing a detach event and looking for a new attach. Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/typec')
-rw-r--r--drivers/staging/typec/tcpm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c
index c52b33623304..eb113399f2ab 100644
--- a/drivers/staging/typec/tcpm.c
+++ b/drivers/staging/typec/tcpm.c
@@ -3037,10 +3037,7 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)
break;
case ERROR_RECOVERY_WAIT_OFF:
- tcpm_set_state(port,
- port->pwr_role == TYPEC_SOURCE ?
- SRC_UNATTACHED : SNK_UNATTACHED,
- 0);
+ tcpm_set_state(port, tcpm_default_state(port), 0);
break;
default: