Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbdH0Gwq (ORCPT ); Sun, 27 Aug 2017 02:52:46 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:36633 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbdH0Gwp (ORCPT ); Sun, 27 Aug 2017 02:52:45 -0400 X-Google-Smtp-Source: ADKCNb4zm7g+8f3/H73TaaaOl6TuPrdRalye4ANpQai41AC/plSqhBE5mJq0iX8kowtVS5MNLZgwpQ== From: Badhri Jagan Sridharan X-Google-Original-From: Badhri Jagan Sridharan To: Guenter Roeck , Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Badhri Jagan Sridharan Subject: [PATCH 11/11] staging: typec: tcpm: Switch to PORT_RESET instead of SNK_UNATTACHED Date: Sat, 26 Aug 2017 23:52:33 -0700 Message-Id: <20170827065233.3524-1-Badhri@google.com> X-Mailer: git-send-email 2.14.1.342.g6490525c54-goog Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 996 Lines: 28 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. Signed-off-by: Badhri Jagan Sridharan --- drivers/staging/typec/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index 9e0111dea7c4..47b8fec5ea36 100644 --- a/drivers/staging/typec/tcpm.c +++ b/drivers/staging/typec/tcpm.c @@ -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: -- 2.14.1.342.g6490525c54-goog