Skip to contentSkip to conversation

staging: typec: tcpm: Do not send PING msgs in TCPM

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

lore
Share & tools
lore
#0 lore raw

PATCH 10/11 staging: typec: tcpm: Do not send PING msgs in TCPM

PING messages are used to monitor the connect/disconnect. However, when PD is carried over CC, so this is not required.

Also, the spec does not clearly say if PD is possible when Type-c is connected to Type-A/B. So, removing sending PING messages altogether.

---
 drivers/staging/typec/tcpm.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/typec/tcpm.c +4 -7
index a7da609006f5..9e0111dea7c4 100644
@@ -2335,14 +2335,11 @@ static void run_state_machine(struct tcpm_port *port)
 		 * - The system is not operating in PD mode
 		 * or
 		 * - Both partners are connected using a Type-C connector
-		 *   XXX How do we know that ?
+		 *
+		 * There is no actual need to send PD messages since the local
+		 * port type-c and the spec does not clearly say whether PD is
+		 * possible when type-c is connected to Type-A/B
 		 */
-		if (port->pwr_opmode == TYPEC_PWR_MODE_PD &&
-		    !port->op_vsafe5v) {
-			tcpm_pd_send_control(port, PD_CTRL_PING);
-			tcpm_set_state_cond(port, SRC_READY,
-					    PD_T_SOURCE_ACTIVITY);
-		}
 		break;
 	case SRC_WAIT_NEW_CAPABILITIES:
 		/* Nothing to do... */
Signature · 1 line
2.14.1.342.g6490525c54-goog
Reviewed-by on v1 10/11
#1 lore raw
Quoted 8 lines · Badhri Jagan Sridharan

PING messages are used to monitor the connect/disconnect. However, when PD is carried over CC, so this is not required.

Also, the spec does not clearly say if PD is possible when Type-c is connected to Type-A/B. So, removing sending PING messages altogether.

Quoted 30 lines
---
 drivers/staging/typec/tcpm.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/typec/tcpm.c +4 -7
index a7da609006f5..9e0111dea7c4 100644
@@ -2335,14 +2335,11 @@ static void run_state_machine(struct tcpm_port *port)
 		 * - The system is not operating in PD mode
 		 * or
 		 * - Both partners are connected using a Type-C connector
-		 *   XXX How do we know that ?
+		 *
+		 * There is no actual need to send PD messages since the local
+		 * port type-c and the spec does not clearly say whether PD is
+		 * possible when type-c is connected to Type-A/B
 		 */
-		if (port->pwr_opmode == TYPEC_PWR_MODE_PD &&
-		    !port->op_vsafe5v) {
-			tcpm_pd_send_control(port, PD_CTRL_PING);
-			tcpm_set_state_cond(port, SRC_READY,
-					    PD_T_SOURCE_ACTIVITY);
-		}
 		break;
 	case SRC_WAIT_NEW_CAPABILITIES:
 		/* Nothing to do... */
Signature · 1 line
2.14.1.342.g6490525c54-goog