Skip to contentSkip to conversation

staging: typec: tcpm: Switch to PORT_RESET instead of SNK_UNATTACHED

PATCH In review Badhri Jagan Sridharan 2 participants 2 messages Aug 27, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 11/11 staging: typec: tcpm: Switch to PORT_RESET instead of SNK_UNATTACHED

When VBUS is not discovered within PD_T_PS_SOURCE_ON although Rp is detected on CC, TCPM switches the port to SNK_UNATTACHED state. SNK_UNATTACHED, however does not force TYPEC_CC_OPEN which makes the partner(source) to think that it is connected.

To overcome this issue, force the port into PORT_RESET state to make sure the CC lines are open.

---
 drivers/staging/typec/tcpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/typec/tcpm.c +1 -1
index 9e0111dea7c4..47b8fec5ea36 100644
@@ -2380,7 +2380,7 @@ static void run_state_machine(struct tcpm_port *port)
 				       0);
 		else
 			/* Wait for VBUS, but not forever */
-			tcpm_set_state(port, SNK_UNATTACHED, PD_T_PS_SOURCE_ON);
+			tcpm_set_state(port, PORT_RESET, PD_T_PS_SOURCE_ON);
 		break;
 
 	case SRC_TRY:
Signature · 1 line
2.14.1.342.g6490525c54-goog
Reviewed-by on v1 11/11
#1 lore raw
Quoted 9 lines · Badhri Jagan Sridharan

When VBUS is not discovered within PD_T_PS_SOURCE_ON although Rp is detected on CC, TCPM switches the port to SNK_UNATTACHED state. SNK_UNATTACHED, however does not force TYPEC_CC_OPEN which makes the partner(source) to think that it is connected.

To overcome this issue, force the port into PORT_RESET state to make sure the CC lines are open.

Quoted 20 lines
---
 drivers/staging/typec/tcpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/typec/tcpm.c +1 -1
index 9e0111dea7c4..47b8fec5ea36 100644
@@ -2380,7 +2380,7 @@ static void run_state_machine(struct tcpm_port *port)
 				       0);
 		else
 			/* Wait for VBUS, but not forever */
-			tcpm_set_state(port, SNK_UNATTACHED, PD_T_PS_SOURCE_ON);
+			tcpm_set_state(port, PORT_RESET, PD_T_PS_SOURCE_ON);
 		break;
 
 	case SRC_TRY:
Signature · 1 line
2.14.1.342.g6490525c54-goog